# /packages/mp3jukebox/www/admin/swap.tcl ad_page_contract { Swaps current item with next item @author wirth@ybos.net @creation-date 2000-03-02 @param mp3_id (the id of the mp3 to be swapped with the next in order) @param playlist_id } { mp3_id:naturalnum,notnull playlist_id:naturalnum,notnull } set package_id [ad_conn package_id] #ad_require_permission $package_id mp3_modify_playlist db_1row get_sort_key "select sort_key from mp3_mp3_playlist_map where playlist_id=:playlist_id and mp3_id=:mp3_id" if [catch { db_exec_plsql swap_item " begin mp3_playlist.item_order_swap ( playlist_id => :playlist_id, sort_key => :sort_key ); end; " } errmsg ] { set complaint " The database did not accept your input. See details for the error message below\n\n\t
$errmsg" ad_return_error "Database Error" "$complaint" ad_script_abort } else { ad_returnredirect one-playlist?[export_url_vars playlist_id] }