Index: openacs-4/packages/file-storage/www/copy.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/copy.tcl,v diff -u -r1.5.2.1 -r1.5.2.2 --- openacs-4/packages/file-storage/www/copy.tcl 2 Apr 2006 22:11:49 -0000 1.5.2.1 +++ openacs-4/packages/file-storage/www/copy.tcl 6 Apr 2006 01:21:58 -0000 1.5.2.2 @@ -13,6 +13,7 @@ {root_folder_id ""} {redirect_to_folder:boolean 0} {show_items:boolean 0} +} -errors {object_id:,notnull,integer,multiple {Please select at least one item to copy.} } set objects_to_copy $object_id @@ -51,26 +52,25 @@ # check for WRTIE permission on each object to be copyd # DaveB: I think it should be DELETE instead of WRITE # but the existing file-copy page checks for WRITE - + set error_items [list] template::multirow foreach copy_objects { db_transaction { if {![string equal $type "folder"] } { set file_rev_id [db_exec_plsql copy_item {}] - set file_id [content::revision::item_id -revision_id $file_rev_id] - set object_rev_id [content::item::get_best_revision -item_id $object_id] - - set object_path "[cr_fs_path][cr_create_content_file_path $object_id $object_rev_id]" - set file_path [cr_create_content_file_path $file_id $file_rev_id] - cr_create_content_file $file_id $file_rev_id $object_path - callback fs::file_revision_new -package_id $package_id -file_id $file_id -parent_id $folder_id } else { db_exec_plsql copy_folder {} } - } + } on_error { + lappend error_items $name + } } - - ad_returnredirect $return_url + if {[llength $error_items]} { + set message "There was a problem copying the following items: [join $error_items ", "]" + } else { + set message "Selected items copied." + } + ad_returnredirect -message $message $return_url ad_script_abort } else { 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.4.2.2 -r1.4.2.3 --- openacs-4/packages/file-storage/www/delete.tcl 14 Oct 2005 17:38:36 -0000 1.4.2.2 +++ openacs-4/packages/file-storage/www/delete.tcl 6 Apr 2006 01:21:58 -0000 1.4.2.3 @@ -4,6 +4,7 @@ object_id:notnull,multiple {confirm_p:optional,boolean 0} {return_url ""} +} -errors {object_id:,notnull,integer,multiple {Please select at least one item to delete.} } set user_id [ad_conn user_id] Index: openacs-4/packages/file-storage/www/move.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/move.tcl,v diff -u -r1.5.2.1 -r1.5.2.2 --- openacs-4/packages/file-storage/www/move.tcl 2 Apr 2006 22:11:50 -0000 1.5.2.1 +++ openacs-4/packages/file-storage/www/move.tcl 6 Apr 2006 01:21:58 -0000 1.5.2.2 @@ -13,9 +13,9 @@ {root_folder_id ""} {redirect_to_folder:boolean 0} {show_items:boolean 0} +} -errors {object_id:,notnull,integer,multiple {Please select at least one item to move.} } - set objects_to_move $object_id set object_id_list [join $object_id ","] @@ -52,14 +52,20 @@ # check for WRTIE permission on each object to be moved # DaveB: I think it should be DELETE instead of WRITE # but the existing file-move page checks for WRITE - + set error_items [list] template::multirow foreach move_objects { db_transaction { db_exec_plsql move_item {} - } + } on_error { + lappend error_items $name + } } - - ad_returnredirect $return_url + if {[llength $error_items]} { + set message "There was a problem moving the following items: [join $error_items ", "]" + } else { + set message "Selected items moved" + } + ad_returnredirect -message $message $return_url ad_script_abort } else {