Index: openacs-4/packages/file-storage/www/copy-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/copy-oracle.xql,v diff -u -r1.6.6.1 -r1.6.6.2 --- openacs-4/packages/file-storage/www/copy-oracle.xql 21 Apr 2017 17:14:16 -0000 1.6.6.1 +++ openacs-4/packages/file-storage/www/copy-oracle.xql 9 May 2017 12:01:01 -0000 1.6.6.2 @@ -15,7 +15,7 @@ - select fs.object_id, fs.name, fs.parent_id, fs.file_upload_name, + select fs.object_id, fs.name, fs.title, fs.parent_id, acs_permission.permission_p(fs.object_id, :user_id, 'read') as copy_p, fs.type from fs_objects fs where fs.object_id in ([template::util::tcl_to_sql_list $object_id]) @@ -31,8 +31,8 @@ :folder_id, :user_id, :peer_addr, - :file_upload_name, - :name); + :name, + :title); end; @@ -45,8 +45,8 @@ :folder_id, :user_id, :peer_addr, - :file_upload_name, - :name); + :name, + :title); end; Index: openacs-4/packages/file-storage/www/copy-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/copy-postgresql.xql,v diff -u -r1.8.4.2 -r1.8.4.3 --- openacs-4/packages/file-storage/www/copy-postgresql.xql 21 Apr 2017 17:14:16 -0000 1.8.4.2 +++ openacs-4/packages/file-storage/www/copy-postgresql.xql 9 May 2017 12:01:02 -0000 1.8.4.3 @@ -14,7 +14,7 @@ - select fs.object_id, fs.name, fs.parent_id, fs.file_upload_name, + select fs.object_id, fs.name, fs.title, fs.parent_id, acs_permission__permission_p(fs.object_id, :user_id, 'read') as copy_p, fs.type from fs_objects fs where fs.object_id in ([template::util::tcl_to_sql_list $object_id]) @@ -29,8 +29,8 @@ :folder_id, :user_id, :peer_addr, - :file_upload_name, - :name + :name, + :title ) @@ -42,8 +42,8 @@ :folder_id, :user_id, :peer_addr, - :file_upload_name, - :name + :name, + :title ) 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.10.2.4 -r1.10.2.5 --- openacs-4/packages/file-storage/www/copy.tcl 9 May 2017 10:07:44 -0000 1.10.2.4 +++ openacs-4/packages/file-storage/www/copy.tcl 9 May 2017 12:01:02 -0000 1.10.2.5 @@ -58,19 +58,24 @@ # 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] + set error_items [list] template::multirow foreach copy_objects { db_transaction { # Allow to copy files into folders that already contain # one with the same name by appending a numeric suffix set suffix 1 - set orig_file_upload_name $file_upload_name - set orig_name $name + set orig_title $title + set orig_name $name while {[content::item::get_id_by_name \ - -name $file_upload_name \ + -name $name \ -parent_id $folder_id] ne ""} { - set file_upload_name ${orig_file_upload_name}-${suffix} - set name ${orig_name}-${suffix} + set title ${orig_title}-${suffix} + # for name, put the suffix just before the extension, + # so browser can keep guessing the correct filetype at + # download + set name_ext [file extension $name] + set name [string range ${orig_name} 0 end-[string length $name_ext]] + set name ${name}-${suffix}${name_ext} incr suffix } @@ -83,9 +88,10 @@ } else { db_exec_plsql copy_folder {} } - } on_error { - lappend error_items $name - } + } + # on_error { + # lappend error_items $name + # } } if {[llength $error_items]} { set message "[_ file-storage.There_was_a_problem_copying_the_following_items]: [join $error_items ", "]"