Index: openacs-4/packages/file-storage/lib/folder-links.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/lib/Attic/folder-links.xql,v diff -u -N --- openacs-4/packages/file-storage/lib/folder-links.xql 8 Aug 2006 21:26:48 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,13 +0,0 @@ - - - - - - select subscr_id, short_name, folder_id - from fs_rss_subscrs - where folder_id = :folder_id - order by upper(short_name) - - - - Index: openacs-4/packages/file-storage/tcl/file-storage-callback-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/tcl/file-storage-callback-procs-oracle.xql,v diff -u -N -r1.1 -r1.1.10.1 --- openacs-4/packages/file-storage/tcl/file-storage-callback-procs-oracle.xql 18 Jun 2005 09:58:32 -0000 1.1 +++ openacs-4/packages/file-storage/tcl/file-storage-callback-procs-oracle.xql 2 Jan 2016 20:13:29 -0000 1.1.10.1 @@ -22,26 +22,4 @@ - - - select f.package_id as package_id - from fs_root_folders f, - (select i2.parent_id - from cr_items i1, cr_items i2, cr_revisions r - where i1.item_id = r.item_id - and r.revision_id = :revision_id - and i2.tree_sortkey <= i1.tree_sortkey - and i1.tree_sortkey i2.tree_sortkey and tree_right(i2.tree_sortkey)) as i - where f.folder_id = i.parent_id - - - - - - select site_node.url(node_id) as url_stub - from site_nodes - where object_id=:package_id - - - Index: openacs-4/packages/file-storage/tcl/file-storage-callback-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/tcl/file-storage-callback-procs-postgresql.xql,v diff -u -N -r1.1 -r1.1.10.1 --- openacs-4/packages/file-storage/tcl/file-storage-callback-procs-postgresql.xql 18 Jun 2005 09:58:32 -0000 1.1 +++ openacs-4/packages/file-storage/tcl/file-storage-callback-procs-postgresql.xql 2 Jan 2016 20:13:29 -0000 1.1.10.1 @@ -22,26 +22,4 @@ - - - select f.package_id as package_id - from fs_root_folders f, - (select i2.parent_id - from cr_items i1, cr_items i2, cr_revisions r - where i1.item_id = r.item_id - and r.revision_id = :revision_id - and i2.tree_sortkey <= i1.tree_sortkey - and i1.tree_sortkey i2.tree_sortkey and tree_right(i2.tree_sortkey)) as i - where f.folder_id = i.parent_id - - - - - - select site_node__url(node_id) as url_stub - from site_nodes - where object_id=:package_id - - - Index: openacs-4/packages/file-storage/tcl/file-storage-callback-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/tcl/file-storage-callback-procs.tcl,v diff -u -N -r1.11.2.1 -r1.11.2.2 --- openacs-4/packages/file-storage/tcl/file-storage-callback-procs.tcl 12 Sep 2015 11:06:17 -0000 1.11.2.1 +++ openacs-4/packages/file-storage/tcl/file-storage-callback-procs.tcl 2 Jan 2016 20:13:29 -0000 1.11.2.2 @@ -60,21 +60,7 @@ } { # We probably don't need the whole big query here. TODO: Review. - db_0or1row fs_datasource { - select r.revision_id as object_id, - i.name as title, - case i.storage_type - when 'lob' then r.lob::text - when 'file' then '[cr_fs_path]' || r.content - else r.content - end as content, - r.mime_type as mime, - '' as keywords, - i.storage_type as storage_type - from cr_items i, cr_revisions r - where r.item_id = i.item_id - and r.revision_id = :object_id - } -column_array datasource + db_0or1row fs_datasource {} -column_array datasource return [list object_id $object_id \ title $datasource(title) \ @@ -90,7 +76,9 @@ Return the URL to the file_storage_object } { set item_id [content::revision::item_id -revision_id $object_id] - set name [db_string item "select name from cr_items where item_id = :item_id" -default ""] + set name [db_string item { + select name from cr_items where item_id = :item_id + } -default ""] return "[ad_url]/file/$item_id/$name" } Index: openacs-4/packages/file-storage/tcl/file-storage-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/tcl/file-storage-procs-oracle.xql,v diff -u -N -r1.35 -r1.35.4.1 --- openacs-4/packages/file-storage/tcl/file-storage-procs-oracle.xql 22 Jan 2010 19:58:42 -0000 1.35 +++ openacs-4/packages/file-storage/tcl/file-storage-procs-oracle.xql 2 Jan 2016 20:13:29 -0000 1.35.4.1 @@ -26,20 +26,6 @@ - - - begin - :1 := file_storage.new_folder( - name => :name, - folder_name => :pretty_name, - parent_id => :parent_id, - creation_user => :creation_user, - creation_ip => :creation_ip - ); - end; - - - begin Index: openacs-4/packages/file-storage/tcl/file-storage-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/tcl/file-storage-procs-postgresql.xql,v diff -u -N -r1.46 -r1.46.4.1 --- openacs-4/packages/file-storage/tcl/file-storage-procs-postgresql.xql 2 Apr 2013 12:04:43 -0000 1.46 +++ openacs-4/packages/file-storage/tcl/file-storage-procs-postgresql.xql 2 Jan 2016 20:13:30 -0000 1.46.4.1 @@ -20,18 +20,6 @@ - - - select file_storage__new_folder( - :name, - :pretty_name, - :parent_id, - :creation_user, - :creation_ip - ); - - - select content_folder__edit_name( @@ -57,38 +45,6 @@ - - - select fs_objects.object_id, - fs_objects.name, - fs_objects.title, - fs_objects.live_revision, - fs_objects.type, - to_char(fs_objects.last_modified, 'YYYY-MM-DD HH24:MI:SS') as last_modified_ansi, - fs_objects.content_size, - fs_objects.url, - fs_objects.key, - fs_objects.sort_key, - fs_objects.file_upload_name, - fs_objects.title, - case when fs_objects.last_modified >= (now() - interval '$n_past_days days') then 1 else 0 end as new_p, - acs_permission__permission_p(fs_objects.object_id, :user_id, 'admin') as admin_p, - acs_permission__permission_p(fs_objects.object_id, :user_id, 'delete') as delete_p, - acs_permission__permission_p(fs_objects.object_id, :user_id, 'write') as write_p - from fs_objects - where fs_objects.parent_id = :folder_id - and exists (select 1 - from acs_object_party_privilege_map m - where m.object_id = fs_objects.object_id - and m.party_id = :user_id - and m.privilege = 'read') - order by fs_objects.sort_key, fs_objects.name - - - - - - postgresql8.4 @@ -340,25 +296,6 @@ - - - select content_revision__new ( - /* title => */ :title, - /* description => */ :description, - /* publish_date => */ current_timestamp, - /* mime_type => */ :mime_type, - /* nls_language => */ null, - /* data => */ null, - /* item_id => */ :item_id, - /* revision_id => */ :revision_id, - /* creation_date => */ current_timestamp, - /* creation_user => */ :creation_user, - /* creation_ip => */ :creation_ip, - /* package_id => */ :package_id - ) - - - Index: openacs-4/packages/file-storage/tcl/file-storage-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/tcl/file-storage-procs.tcl,v diff -u -N -r1.69.2.1 -r1.69.2.2 --- openacs-4/packages/file-storage/tcl/file-storage-procs.tcl 12 Sep 2015 11:06:18 -0000 1.69.2.1 +++ openacs-4/packages/file-storage/tcl/file-storage-procs.tcl 2 Jan 2016 20:13:30 -0000 1.69.2.2 @@ -63,10 +63,11 @@ Returns 1 if the file_id corresponds to a file in the file-storage system. Returns 0 otherwise. } { - if {[db_string object_type " - select object_type - from acs_objects - where object_id = :file_id" -default ""] eq "content_item"} { + if {[db_string object_type { + select object_type + from acs_objects + where object_id = :file_id + } -default ""] eq "content_item"} { return 1 } else { return 0 @@ -79,10 +80,11 @@ Returns 1 if the version_id corresponds to a version in the file-storage system. Returns 0 otherwise. } { - if {[db_string object_type " - select object_type - from acs_objects - where object_id = :version_id" -default ""] eq "file_storage_object"} { + if {[db_string object_type { + select object_type + from acs_objects + where object_id = :version_id + } -default ""] eq "file_storage_object"} { return 1 } else { return 0 @@ -110,28 +112,12 @@ # This only gets child folders and items - set num_wo_perm [db_string child_perms " - select count(*) - from cr_items - where item_id in (select item_id - from cr_items - connect by prior item_id = parent_id - start with item_id = :item_id) - and acs_permission.permission_p(item_id,:user_id,:privilege) = 'f'"] + set num_wo_perm [db_string child_perms {}] # now check revisions - db_foreach child_items { - select item_id as child_item_id - from cr_items - connect by prior item_id = parent_id - start with item_id = :item_id - } { - incr num_wo_perm [db_string revision_perms " - select count(*) - from cr_revisions - where item_id = :child_item_id - and acs_permission.permission_p(revision_id,:user_id,:privilege) = 'f'"] + db_foreach child_items {} { + incr num_wo_perm [db_string revision_perms {}] } if { $num_wo_perm > 0 } { @@ -169,8 +155,9 @@ } { # don't get title for last element if we are in the # root folder - set start_id [db_string parent_id " - select parent_id from cr_items where item_id = :item_id"] + set start_id [db_string parent_id { + select parent_id from cr_items where item_id = :item_id + }] set final [db_exec_plsql title "begin :1 := file_storage.get_title(:item_id); end;"] @@ -264,7 +251,7 @@ } { Get the parent of a given item. } { - return [db_string get_parent_id ""] + return [db_string get_parent_id {}] } @@ -349,7 +336,7 @@ } { sets the description for the given folder in cr_folders. Perhaps this shoudl be a CR proc? } { - db_dml set_folder_description { *SQL* } + db_dml set_folder_description {} } ad_proc -public fs::object_p { @@ -597,12 +584,12 @@ set file_name "${file_name}.url" set file_name [remove_special_file_system_characters -string $file_name] - set fp [open [file join ${path} ${file_name}] w] + set fp [open [file join $path $file_name] w] puts $fp {[InternetShortcut]} puts $fp URL=$url close $fp - return [file join ${path} ${file_name}] + return [file join $path $file_name] } ad_proc -public fs::publish_versioned_object_to_file_system { @@ -782,7 +769,7 @@ } db_transaction { - if {![db_string item_exists ""]} { + if {![db_string item_exists {}]} { set item_id [content::item::new \ -item_id $item_id \ @@ -880,7 +867,9 @@ set storage_type "file" } if {$item_id ne ""} { - set storage_type [db_string get_storage_type "select storage_type from cr_items where item_id=:item_id"] + set storage_type [db_string get_storage_type { + select storage_type from cr_items where item_id=:item_id + }] } if {$mime_type eq "" } { set mime_type "text/html" @@ -892,7 +881,7 @@ set content_type "file_storage_object" db_transaction { - if {$item_id eq "" || ![db_string item_exists ""]} { + if {$item_id eq "" || ![db_string item_exists {}]} { set item_id [db_exec_plsql create_item ""] if {$creation_user ne ""} { permission::grant -party_id $creation_user -object_id $item_id -privilege admin @@ -949,7 +938,7 @@ set package_id [ad_conn package_id] } if {$storage_type eq ""} { - set storage_type [db_string get_storage_type ""] + set storage_type [db_string get_storage_type {}] } if {$creation_user eq ""} { set creation_user [ad_conn user_id] @@ -959,19 +948,21 @@ } set parent_id [fs::get_parent -item_id $item_id] if {$storage_type eq ""} { - set storage_type [db_string get_storage_type "select storage_type from cr_items where item_id=:item_id"] + set storage_type [db_string get_storage_type { + select storage_type from cr_items where item_id=:item_id + }] } switch -- $storage_type { file { - set revision_id [db_exec_plsql new_file_revision { }] + set revision_id [db_exec_plsql new_file_revision {}] set cr_file [cr_create_content_file_from_string $item_id $revision_id $content_body] # get the size set file_size [cr_file_size $cr_file] # update the file path in the CR and the size on cr_revisions - db_dml update_revision { } + db_dml update_revision {} } lob { # if someone stored file storage content in the database @@ -1037,7 +1028,7 @@ } { # always use the storage type of the existing item if {$storage_type eq ""} { - set storage_type [db_string get_storage_type ""] + set storage_type [db_string get_storage_type {}] } if {$mime_type eq ""} { set mime_type [cr_filename_to_mime_type -create -- $name] @@ -1154,7 +1145,7 @@ Deletes a revision. If it was the last revision, it deletes the file as well. } { - set parent_id [db_exec_plsql delete_version ""] + set parent_id [db_exec_plsql delete_version {}] if {$parent_id > 0} { delete_file -item_id $item_id -parent_id $parent_id @@ -1248,7 +1239,7 @@ set url "[ad_url]" set new_content "" - db_0or1row get_owner_name { } + db_0or1row get_owner_name {} if {$action eq "new_file" || $action eq "new_url" || $action eq "new_version"} { @@ -1303,8 +1294,9 @@ # walk through all folders up to the root folder while {$folder_id != $root_folder} { - set parent_id [db_string parent_id " - select parent_id from cr_items where item_id = :folder_id"] + set parent_id [db_string parent_id { + select parent_id from cr_items where item_id = :folder_id + }] notification::new \ -type_id [notification::type::get_type_id \ -short_name fs_fs_notif] \ @@ -1406,8 +1398,8 @@ and r.revision_id = o.object_id } -column_array file_object_info - set content [db_exec_plsql get_content { - }] + # GN: this query was probably never defined in CVS + #set content [db_exec_plsql get_content {}] if {$file_object_info(storage_type) eq "file"} { set filename [cr_fs_path $file_object_info(storage_area_key)] Index: openacs-4/packages/file-storage/tcl/file-storage-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/tcl/file-storage-procs.xql,v diff -u -N -r1.20 -r1.20.10.1 --- openacs-4/packages/file-storage/tcl/file-storage-procs.xql 14 Nov 2006 16:07:53 -0000 1.20 +++ openacs-4/packages/file-storage/tcl/file-storage-procs.xql 2 Jan 2016 20:13:30 -0000 1.20.10.1 @@ -163,15 +163,6 @@ - - - select 1 - from cr_content_mime_type_map - where mime_type = :mime_type - and content_type = 'image' - - - select storage_type from cr_items where item_id=:item_id @@ -249,4 +240,4 @@ - \ No newline at end of file + Index: openacs-4/packages/file-storage/www/file-add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/file-add.tcl,v diff -u -N -r1.20.2.1 -r1.20.2.2 --- openacs-4/packages/file-storage/www/file-add.tcl 12 Sep 2015 11:06:19 -0000 1.20.2.1 +++ openacs-4/packages/file-storage/www/file-add.tcl 2 Jan 2016 20:13:30 -0000 1.20.2.2 @@ -71,7 +71,7 @@ if {[parameter::get -parameter AllowTextEdit -default 0]} { if {[ad_form_new_p -key file_id]} { - + # To allow the creation of files ad_form -extend -form { {content_body:richtext(richtext),optional @@ -83,7 +83,9 @@ } else { # To make content editable set revision_id [content::item::get_live_revision -item_id $file_id] - set mime_type [db_string get_mime_type "select mime_type from cr_revisions where revision_id = :revision_id"] + set mime_type [db_string get_mime_type { + select mime_type from cr_revisions where revision_id = :revision_id + }] if {$mime_type eq "text/html"} { ad_form -extend -form { {edit_content:richtext(richtext),optional @@ -110,7 +112,7 @@ {title:text(hidden) {value $title}} } } else { - ad_form -extend -form { + ad_form -extend -form { {title:text,optional {label \#file-storage.Title\#} {html {size 30}} } } } @@ -120,9 +122,9 @@ } if [catch {set binary [exec $unpack_binary]} errormsg] { - set unpack_bin_installed 0 + set unpack_bin_installed 0 } else { - set unpack_bin_installed 1 + set unpack_bin_installed 1 } if {([ad_form_new_p -key file_id]) && $unpack_bin_installed } { @@ -131,40 +133,43 @@ } } if { [parameter::get -parameter CategoriesP -package_id $package_id -default 0] } { - if { ([info exists file_id] && $file_id ne "") } { - set categorized_object_id $file_id - } else { - # pre-populate with categories from the folder - set categorized_object_id $folder_id - } + if { ([info exists file_id] && $file_id ne "") } { + set categorized_object_id $file_id + } else { + # pre-populate with categories from the folder + set categorized_object_id $folder_id + } category::ad_form::add_widgets \ - -container_object_id $package_id \ - -categorized_object_id $categorized_object_id \ - -form_name file-add + -container_object_id $package_id \ + -categorized_object_id $categorized_object_id \ + -form_name file-add } -ad_form -extend -form {} -select_query_name {get_file} -new_data { +ad_form -extend -form {} -select_query_name get_file -new_data { - if {(![info exists unpack_p] || $unpack_p eq "")} { - set unpack_p f - } - if { $unpack_p && $unpack_binary ne "" && [file extension [template::util::file::get_property filename $upload_file]] eq ".zip" } { + if {(![info exists unpack_p] || $unpack_p eq "")} { + set unpack_p f + } + if { $unpack_p + && $unpack_binary ne "" + && [file extension [template::util::file::get_property filename $upload_file]] eq ".zip" + } { - set path [ad_tmpnam] - file mkdir $path + set path [ad_tmpnam] + file mkdir $path - catch { exec $unpack_binary -jd $path ${upload_file.tmpfile} } errmsg + catch { exec $unpack_binary -jd $path ${upload_file.tmpfile} } errmsg - # More flexible parameter design could be: - # zip {unzip -jd {out_path} {in_file}} tar {tar xf {in_file} {out_path}} tgz {tar xzf {in_file} {out_path}} + # More flexible parameter design could be: + # zip {unzip -jd {out_path} {in_file}} tar {tar xf {in_file} {out_path}} tgz {tar xzf {in_file} {out_path}} - set upload_files [list] - set upload_tmpfiles [list] + set upload_files [list] + set upload_tmpfiles [list] - foreach file [glob -nocomplain "$path/*"] { - lappend upload_files [file tail $file] + foreach file [glob -nocomplain "$path/*"] { + lappend upload_files [file tail $file] lappend upload_tmpfiles $file } @@ -260,7 +265,7 @@ if {$this_title eq ""} { set this_title $filename } - + fs::add_version \ -name $filename \ -tmp_filename [template::util::file::get_property tmp_filename $upload_file] \ @@ -270,7 +275,7 @@ -title $this_title \ -description $description \ -package_id $package_id - + if { [parameter::get -parameter CategoriesP -package_id $package_id -default 0] } { category::map_object -remove_old -object_id $file_id [category::ad_form::get_categories \ -container_object_id $package_id \ Index: openacs-4/packages/file-storage/www/file-add.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/file-add.xql,v diff -u -N -r1.3 -r1.3.10.1 --- openacs-4/packages/file-storage/www/file-add.xql 8 Aug 2006 21:26:49 -0000 1.3 +++ openacs-4/packages/file-storage/www/file-add.xql 2 Jan 2016 20:13:30 -0000 1.3.10.1 @@ -1,14 +1,6 @@ - - - - select parent_id as folder_id from cr_items where item_id=:file_id - - - - Index: openacs-4/packages/file-storage/www/file-edit-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/file-edit-oracle.xql,v diff -u -N -r1.5 -r1.5.6.1 --- openacs-4/packages/file-storage/www/file-edit-oracle.xql 21 Apr 2009 11:08:23 -0000 1.5 +++ openacs-4/packages/file-storage/www/file-edit-oracle.xql 2 Jan 2016 20:13:30 -0000 1.5.6.1 @@ -2,20 +2,6 @@ oracle8.1.6 - - - - - begin - file_storage.rename_file ( - file_id => :file_id, - title => :title - ); - end; - - - - Index: openacs-4/packages/file-storage/www/file-edit-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/file-edit-postgresql.xql,v diff -u -N -r1.4 -r1.4.6.1 --- openacs-4/packages/file-storage/www/file-edit-postgresql.xql 21 Apr 2009 11:08:23 -0000 1.4 +++ openacs-4/packages/file-storage/www/file-edit-postgresql.xql 2 Jan 2016 20:13:30 -0000 1.4.6.1 @@ -3,18 +3,6 @@ postgresql7.1 - - - - select file_storage__rename_file ( - :file_id, -- file_id - :title -- title - ); - - - - - Index: openacs-4/packages/file-storage/www/file-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/file-edit.tcl,v diff -u -N -r1.11.2.1 -r1.11.2.2 --- openacs-4/packages/file-storage/www/file-edit.tcl 12 Sep 2015 11:06:19 -0000 1.11.2.1 +++ openacs-4/packages/file-storage/www/file-edit.tcl 2 Jan 2016 20:13:30 -0000 1.11.2.2 @@ -26,10 +26,9 @@ set context [fs_context_bar_list -final "[_ file-storage.Rename]" $file_id] # Variable title used by message lookup -db_1row file_info "" +db_1row file_info {} set page_title [_ file-storage.file_edit_page_title] - set title_help [_ file-storage.lt_Please_enter_the_new_] ad_form -export file_id -form { Index: openacs-4/packages/file-storage/www/file.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/file.tcl,v diff -u -N -r1.35.2.1 -r1.35.2.2 --- openacs-4/packages/file-storage/www/file.tcl 12 Sep 2015 11:06:19 -0000 1.35.2.1 +++ openacs-4/packages/file-storage/www/file.tcl 2 Jan 2016 20:13:30 -0000 1.35.2.2 @@ -37,7 +37,7 @@ db_1row file_info "" # get folder id so we can implement a back link -set folder_id [db_string get_folder ""] +set folder_id [db_string get_folder {}] set folder_view_url [export_vars -base index {folder_id}] Index: openacs-4/packages/file-storage/www/folder-delete.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/folder-delete.tcl,v diff -u -N -r1.12.2.1 -r1.12.2.2 --- openacs-4/packages/file-storage/www/folder-delete.tcl 12 Sep 2015 11:06:19 -0000 1.12.2.1 +++ openacs-4/packages/file-storage/www/folder-delete.tcl 2 Jan 2016 20:13:30 -0000 1.12.2.2 @@ -37,10 +37,9 @@ # contents at all.) set blocked_p [ad_decode [children_have_permission_p $folder_id delete] 0 t f] -set folder_name [db_string folder_name ""] +set folder_name [db_string folder_name {}] +set child_count [db_string child_count {}] -set child_count [db_string child_count ""] - # TODO add child_count to message key set context [fs_context_bar_list -final "[_ file-storage.Delete]" $folder_id] @@ -87,9 +86,13 @@ } else { # they still need to confirm - set folder_name [db_string folder_name " - select label from cr_folders where folder_id = :folder_id"] - set child_count [db_string child_count "select count(ci.item_id) from (select item_id from cr_items connect by prior item_id=parent_id start with item_id=:folder_id) ci"] + set folder_name [db_string folder_name { + select label from cr_folders where folder_id = :folder_id + }] + set child_count [db_string child_count { + select count(ci.item_id) from + (select item_id from cr_items connect by prior item_id=parent_id start with item_id=:folder_id) ci + }] set context [fs_context_bar_list -final "[_ file-storage.Delete]" $folder_id] } Index: openacs-4/packages/file-storage/www/folder-zip-add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/folder-zip-add.tcl,v diff -u -N -r1.7.2.1 -r1.7.2.2 --- openacs-4/packages/file-storage/www/folder-zip-add.tcl 12 Sep 2015 11:06:19 -0000 1.7.2.1 +++ openacs-4/packages/file-storage/www/folder-zip-add.tcl 2 Jan 2016 20:13:30 -0000 1.7.2.2 @@ -20,8 +20,11 @@ lock_title_p:onevalue } -validate { file_id_or_folder_id { - if {([info exists file_id] && $file_id ne "") && (![info exists folder_id] || $folder_id eq "")} { - set folder_id [db_string get_folder_id "select parent_id as folder_id from cr_items where item_id=:file_id" -default ""] + if {[info exists file_id] && $file_id ne "" + && (![info exists folder_id] || $folder_id eq "")} { + set folder_id [db_string get_folder_id { + select parent_id as folder_id from cr_items where item_id=:file_id + } -default ""] } if {![fs_folder_p $folder_id]} { ad_complain "The specified parent folder is not valid." Index: openacs-4/packages/file-storage/www/index.vuh =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/index.vuh,v diff -u -N -r1.5 -r1.5.2.1 --- openacs-4/packages/file-storage/www/index.vuh 27 Oct 2014 16:41:33 -0000 1.5 +++ openacs-4/packages/file-storage/www/index.vuh 2 Jan 2016 20:13:30 -0000 1.5.2.1 @@ -1,4 +1,4 @@ -# +# -*- tcl -*- # # Redirect to download files by URL # enables WebDAV as well as just making it easier to download stuff Index: openacs-4/packages/file-storage/www/search.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/search.tcl,v diff -u -N -r1.4.10.1 -r1.4.10.2 --- openacs-4/packages/file-storage/www/search.tcl 12 Sep 2015 11:06:20 -0000 1.4.10.1 +++ openacs-4/packages/file-storage/www/search.tcl 2 Jan 2016 20:13:30 -0000 1.4.10.2 @@ -26,13 +26,7 @@ set query "%${query}%" regsub -all {%+} $query {%} query -db_multirow results results { - select item_id as file_id, - content_item.get_title(item_id) as title - from cr_items - where lower(content_item.get_title(item_id)) like :query - and acs_permission.permission_p(item_id,:user_id,'read') = 't' -} +db_multirow results results {} # get the (lowercased) original back to feed to the template Index: openacs-4/packages/file-storage/www/view/index.vuh =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/view/index.vuh,v diff -u -N -r1.9 -r1.9.2.1 --- openacs-4/packages/file-storage/www/view/index.vuh 27 Oct 2014 16:41:35 -0000 1.9 +++ openacs-4/packages/file-storage/www/view/index.vuh 2 Jan 2016 20:13:30 -0000 1.9.2.1 @@ -1,3 +1,4 @@ +# -*- tcl -*- ################## KLUDGE BY STAS ############### # Try and look up the item in the content repository ################################################# @@ -18,7 +19,7 @@ # Get the IDs set content_root [fs::get_root_folder] -set template_root [db_string template_root ""] +set template_root [db_string template_root {}] set file_id [::content::item::get_id -item_path $the_url \ -root_folder_id $content_root \ -resolve_index "f"]