Index: openacs-4/packages/file-storage/www/file.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/file.adp,v
diff -u -r1.24 -r1.25
--- openacs-4/packages/file-storage/www/file.adp 15 Jun 2007 17:40:29 -0000 1.24
+++ openacs-4/packages/file-storage/www/file.adp 11 Jan 2008 18:20:57 -0000 1.25
@@ -6,23 +6,23 @@
@title;noquote@ - #file-storage.properties#
-
#file-storage.Categories#: @category_links;noquote@
- #file-storage.lt_Comments_on_this_file#
+
#file-storage.lt_Comments_on_this_file#
-
+
+
@gc_link;noquote@
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 -r1.29 -r1.30
--- openacs-4/packages/file-storage/www/file.tcl 15 Jun 2007 17:40:29 -0000 1.29
+++ openacs-4/packages/file-storage/www/file.tcl 11 Jan 2008 18:20:57 -0000 1.30
@@ -6,7 +6,7 @@
@cvs-id $Id$
} {
file_id:integer,notnull
- {show_all_versions_p "t"}
+ {show_all_versions_p "f"}
} -validate {
valid_file -requires {file_id} {
if ![fs_file_p $file_id] {
@@ -36,13 +36,21 @@
set root_folder_id [fs::get_root_folder]
db_1row file_info ""
+# get folder id so we can implement a back link
+set folder_id [db_string get_folder ""]
+
+set folder_view_url [export_vars -base index {folder_id}]
+
# We use the new db_map here
-if {[string equal $show_all_versions_p "t"]} {
+if { $show_all_versions_p } {
set show_versions [db_map show_all_versions]
} else {
set show_versions [db_map show_live_version]
}
+set not_show_all_versions_p [expr {!$show_all_versions_p}]
+set show_versions_url [export_vars -base file {file_id {show_all_versions_p $not_show_all_versions_p}}]
+
set return_url [ad_conn url]?[export_vars file_id]
set categories_p [parameter::get -parameter CategoriesP -package_id [ad_conn package_id] -default 0]
@@ -53,10 +61,10 @@
}
set actions [list "[_ file-storage.Upload_Revision]" file-add?[export_vars [list file_id return_url]] "Upload a new version of this file" \
- "$rename_name" file-edit?[export_vars file_id] "Rename file" \
- "[_ file-storage.Copy_File]" file-copy?[export_vars file_id] "Copy file" \
- "[_ file-storage.Move_File]" move?object_id=$file_id "Move file" \
- "[_ file-storage.Delete_File]" file-delete?[export_vars file_id] "Delete file"]
+ "$rename_name" file-edit?[export_vars file_id] "Rename file" \
+ "[_ file-storage.Copy_File]" [export_vars -base copy {{object_id $file_id} return_url}] "Copy file" \
+ "[_ file-storage.Move_File]" [export_vars -base move {{object_id $file_id} {return_url $folder_view_url}}] "Move file" \
+ "[_ file-storage.Delete_File]" [export_vars -base delete {{object_id $file_id} {return_url $folder_view_url}}] "Delete file"]
if {[string equal $delete_p "t"]} {
lappend actions [_ file-storage.Set_Permissions] [export_vars -base permissions {{object_id $file_id}}] [_ file-storage.lt_Modify_permissions_on]
@@ -119,8 +127,6 @@
set author_link [acs_community_member_link -user_id $author_id -label $author]
}
-set return_url "[ad_conn url]?file_id=$file_id"
-
if { [apm_package_installed_p "general-comments"] && [ad_parameter "GeneralCommentsP" -package_id [ad_conn package_id]] } {
set gc_link [general_comments_create_link $file_id $return_url]
set gc_comments [general_comments_get_comments $file_id $return_url]
@@ -129,11 +135,6 @@
set gc_comments ""
}
-# get folder id so we can implement a back link
-set folder_id [db_string get_folder ""]
-
-set folder_view_url "index?folder_id=$folder_id"
-
if { $categories_p } {
set category_links [fs::category_links -object_id $file_id -folder_id $folder_id]
}
Index: openacs-4/packages/file-storage/www/folder-create.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/folder-create.tcl,v
diff -u -r1.7 -r1.8
--- openacs-4/packages/file-storage/www/folder-create.tcl 15 Jun 2007 17:40:29 -0000 1.7
+++ openacs-4/packages/file-storage/www/folder-create.tcl 11 Jan 2008 18:20:57 -0000 1.8
@@ -12,12 +12,12 @@
} -validate {
file_id_or_folder_id {
if { ![exists_and_not_null folder_id] && ![exists_and_not_null parent_id] } {
- ad_complain "Input error: Must either have a parent_id or a folder_id"
+ ad_complain "Input error: Must either have a parent_id or a folder_id"
}
}
valid_folder -requires {parent_id:integer} {
if ![fs_folder_p $parent_id] {
- ad_complain "[_ file-storage.lt_The_specified_parent_]"
+ ad_complain "[_ file-storage.lt_The_specified_parent_]"
}
}
} -properties {
@@ -50,7 +50,7 @@
ad_form -name "folder-ae" -html { enctype multipart/form-data } -export { parent_id } -form {
folder_id:key
- {folder_name:text,optional {label \#file-storage.Title\#} {html {size 30}} }
+ {folder_name:text {label \#file-storage.Title\#} {html {size 30}} }
{description:text(textarea),optional {label \#file-storage.Description\#} {html "rows 5 cols 35"}}
}
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 -r1.3 -r1.4
--- openacs-4/packages/file-storage/www/folder-zip-add.tcl 15 May 2007 20:14:37 -0000 1.3
+++ openacs-4/packages/file-storage/www/folder-zip-add.tcl 11 Jan 2008 18:20:57 -0000 1.4
@@ -20,19 +20,19 @@
lock_title_p:onevalue
} -validate {
file_id_or_folder_id {
- if {[exists_and_not_null file_id] && ![exists_and_not_null folder_id]} {
- 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."
- }
+ if {[exists_and_not_null file_id] && ![exists_and_not_null folder_id]} {
+ 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."
+ }
}
max_size -requires {upload_file} {
- set n_bytes [file size ${upload_file.tmpfile}]
- set max_bytes [ad_parameter "MaximumFileSize"]
- if { $n_bytes > $max_bytes } {
- ad_complain "Your file is larger than the maximum file size allowed on this system ([util_commify_number $max_bytes] bytes)"
- }
+ set n_bytes [file size ${upload_file.tmpfile}]
+ set max_bytes [ad_parameter "MaximumFileSize"]
+ if { $n_bytes > $max_bytes } {
+ ad_complain "Your file is larger than the maximum file size allowed on this system ([util_commify_number $max_bytes] bytes)"
+ }
}
}
@@ -58,7 +58,7 @@
ad_form -name file_add -html { enctype multipart/form-data } -export { folder_id lock_title_p } -form {
file_id:key
- {upload_file:file,optional {label \#file-storage.Upload_a_file\#} {html "size 30"}}
+ {upload_file:file {label \#file-storage.Upload_a_file\#} {html "size 30"}}
}
if {[exists_and_not_null return_url]} {
@@ -73,7 +73,7 @@
}
} else {
ad_form -extend -name file_add -form {
- {title:text,optional {label \#file-storage.Title\#} {html {size 30}} }
+ {title:text {label \#file-storage.Title\#} {html {size 30}} }
}
}
@@ -119,8 +119,8 @@
}
if { [empty_string_p [lindex $upload_files 0]]} {
- ad_return_complaint 1 "You have to upload a file"
- ad_script_abort
+ ad_return_complaint 1 "You have to upload a file"
+ ad_script_abort
}
set i 0