Index: openacs-4/packages/file-storage/www/delete.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/delete.tcl,v diff -u -r1.1.2.2 -r1.1.2.3 --- openacs-4/packages/file-storage/www/delete.tcl 22 Jul 2004 12:51:52 -0000 1.1.2.2 +++ openacs-4/packages/file-storage/www/delete.tcl 25 Jul 2004 17:31:38 -0000 1.1.2.3 @@ -1,7 +1,7 @@ ad_page_contract { delete items } { - object_id:notnull,integer,multiple + object_id:notnull,multiple {confirm_p:optional,boolean 0} {return_url ""} } @@ -11,7 +11,7 @@ template::list::create \ -name delete_list \ -multirow delete_list \ - -key object_id \ + -key fs_object_id \ -no_data "No items selected" \ -elements { name { @@ -27,6 +27,16 @@ # make sure none of these items are root folders. There is no way to # click a checkbox, but who knows how the item_id might get in there +if {[llength $object_id] == 1} { + set object_id [split [lindex $object_id 0]] +} +ns_log notice " +DB -------------------------------------------------------------------------------- +DB DAVE debugging /var/lib/aolserver/openacs-5-1/packages/file-storage/www/delete.tcl +DB -------------------------------------------------------------------------------- +DB object_id = '${object_id}' +DB llength object_id = '[llength $object_id]' +DB --------------------------------------------------------------------------------" set root_folders_count [db_string count_root_folders "" -default 0] if {$root_folders_count > 0} { @@ -35,7 +45,7 @@ } db_multirow -extend {delete_message} delete_list get_to_be_deleted " - select fs.object_id, fs.name, + select fs.object_id as fs_object_id, fs.name, acs_permission__permission_p(fs.object_id, :user_id, 'write') as delete_p from fs_objects fs where fs.object_id in ([template::util::tcl_to_sql_list $object_id])" { @@ -50,13 +60,17 @@ } set total_count [template::multirow size delete_list] -set delete_inform [_ file-storage.lt_Do_you_want_to_delete]" - ad_form -name delete_confirm -cancel_url $return_url -form { - {notice:text(inform) {label ""} {value $delete_inform}} - {object_id:text(hidden) {value $object_id}} - {return_url:text(hidden) {value $return_url}} - } -on_submit { - set object_id [split $object_id] + +set delete_inform [_ file-storage.lt_Do_you_want_to_delete] + +ad_form -name delete_confirm -cancel_url $return_url -form { + {notice:text(inform) {label ""} {value $delete_inform}} + {return_url:text(hidden) {value $return_url}} + {object_id:text(hidden) {value $object_id}} +} + +ad_form -extend -name delete_confirm -on_submit { + set object_id [split $object_id] db_transaction { template::multirow foreach delete_list { if {$delete_p} {