Index: openacs-4/packages/file-storage/file-storage.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/file-storage.info,v diff -u -r1.38.2.16 -r1.38.2.17 --- openacs-4/packages/file-storage/file-storage.info 5 May 2006 19:26:22 -0000 1.38.2.16 +++ openacs-4/packages/file-storage/file-storage.info 30 May 2006 10:37:45 -0000 1.38.2.17 @@ -44,6 +44,7 @@ + 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.6 -r1.5.2.7 --- openacs-4/packages/file-storage/www/copy.tcl 17 May 2006 21:07:03 -0000 1.5.2.6 +++ openacs-4/packages/file-storage/www/copy.tcl 30 May 2006 10:37:45 -0000 1.5.2.7 @@ -15,7 +15,6 @@ {show_items:boolean 0} } -errors {object_id:,notnull,integer,multiple {Please select at least one item to copy.} } -ns_log Notice "Huh? right script..." set objects_to_copy $object_id set object_id_list [join $object_id ","] Index: openacs-4/packages/file-storage/www/move-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/Attic/move-postgresql.xql,v diff -u -r1.4.2.3 -r1.4.2.4 --- openacs-4/packages/file-storage/www/move-postgresql.xql 5 May 2006 19:26:23 -0000 1.4.2.3 +++ openacs-4/packages/file-storage/www/move-postgresql.xql 30 May 2006 10:37:45 -0000 1.4.2.4 @@ -15,7 +15,7 @@ - select fs.object_id, fs.name, + select fs.object_id, fs.name, fs.type, fs.parent_id, acs_permission__permission_p(fs.object_id, :user_id, 'write') as move_p from fs_objects fs where fs.object_id in ([template::util::tcl_to_sql_list $object_id]) @@ -50,5 +50,27 @@ order by ci1.tree_sortkey, cf.label + + + + select file_storage__copy_file( + :object_id, + :folder_id, + :user_id, + :peer_addr + ) + + + + + + select content_folder__copy ( + :object_id, + :folder_id, + :user_id, + :peer_addr + ) + + \ No newline at end of file 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.5 -r1.5.2.6 --- openacs-4/packages/file-storage/www/move.tcl 17 May 2006 21:07:03 -0000 1.5.2.5 +++ openacs-4/packages/file-storage/www/move.tcl 30 May 2006 10:37:45 -0000 1.5.2.6 @@ -16,6 +16,10 @@ } -errors {object_id:,notnull,integer,multiple {Please select at least one item to move.} } +set peer_addr [ad_conn peeraddr] +set package_id [ad_conn package_id] +set copy_and_delete_p [parameter::get -parameter MoveByCopyDeleteP -package_id $package_id -default 0] + set objects_to_move $object_id set object_id_list [join $object_id ","] @@ -54,12 +58,31 @@ # 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 - } - } + if {$copy_and_delete_p} { + # copy and delete file to move it + 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] + callback fs::file_revision_new -package_id $package_id -file_id $file_id -parent_id $folder_id + fs::delete_file -item_id $object_id -parent_id $parent_id + } else { + db_exec_plsql copy_folder {} + fs::delete_folder -folder_id $object_id -parent_id $parent_id + } + } on_error { + lappend error_items $name + } + } else { + # execute move command + db_transaction { + db_exec_plsql move_item {} + } on_error { + lappend error_items $name + } + } + } + if {[llength $error_items]} { set message "There was a problem moving the following items: [join $error_items ", "]" } else { @@ -103,7 +126,8 @@ # Oracle issue with key words. set target_url [export_vars -base "[ad_conn package_url]move" { object_id:multiple folder_id return_url }] - set move_url [export_vars -base "file-upload-confirm" {folder_id cancel_url {return_url $target_url}}] +# set move_url [export_vars -base "file-upload-confirm" {folder_id cancel_url {return_url $target_url}}] + set move_url $target_url } } Index: openacs-4/packages/file-storage/www/admin/upload-size-limit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/admin/upload-size-limit.tcl,v diff -u -r1.3 -r1.3.2.1 --- openacs-4/packages/file-storage/www/admin/upload-size-limit.tcl 13 Jan 2005 13:58:13 -0000 1.3 +++ openacs-4/packages/file-storage/www/admin/upload-size-limit.tcl 30 May 2006 10:37:45 -0000 1.3.2.1 @@ -22,7 +22,7 @@ set upload_limit [parameter::get -parameter "MaximumFileSize"] ad_form -name upload_limit_size -export folder_id -form { - {new_size:integer(text) {label "#file-storage.Upload_Limit# $max_size"} {value $upload_limit} {html { maxlength 8}}} + {new_size:integer(text) {label "#file-storage.Upload_Limit# $max_size"} {value $upload_limit} {html { maxlength 10}}} {return_url:text(hidden) {value $return_url}} {submit:text(submit) {label "[_ file-storage.Change_upload_limit]"}} } -validate {