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.1.2.1 -r1.1.2.2
--- openacs-4/packages/file-storage/www/copy-oracle.xql 11 May 2004 00:49:24 -0000 1.1.2.1
+++ openacs-4/packages/file-storage/www/copy-oracle.xql 24 Aug 2004 23:53:31 -0000 1.1.2.2
@@ -25,23 +25,25 @@
- select file_storage.copy_file(
+ begin
+ :1 := file_storage.copy_file(
:object_id,
:folder_id,
:user_id,
- :peer_addr
- )
+ :peer_addr);
+ end;
select
- cf.folder_id, cf.label, ci1.level
- from cr_folders cf, (select item_id, level from
+ cf.folder_id, cf.label, ci1.level_num
+ from cr_folders cf, (select item_id, level as level_num from
cr_items
- connect by prior item_id=parent_id
- start with :root_folder_id
+ where cr_items.item_id not in ($object_id_list)
+ connect by (prior item_id=parent_id and parent_id not in ($object_id_list))
+ start with cr_items.item_id = :root_folder_id
) ci1
where
ci1.item_id=cf.folder_id
@@ -50,7 +52,7 @@
where m.object_id = cf.folder_id
and m.party_id = :user_id
and m.privilege = 'write')
- order by order by ci1.level, cf.label
+ order by ci1.level_num, cf.label
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.1.2.1 -r1.1.2.2
--- openacs-4/packages/file-storage/www/copy-postgresql.xql 11 May 2004 00:49:24 -0000 1.1.2.1
+++ openacs-4/packages/file-storage/www/copy-postgresql.xql 24 Aug 2004 23:53:31 -0000 1.1.2.2
@@ -37,7 +37,7 @@
select
- cf.folder_id, cf.label, tree_level(ci1.tree_sortkey) as level
+ cf.folder_id, cf.label, tree_level(ci1.tree_sortkey) as level_num
from cr_folders cf, cr_items ci1, cr_items ci2
where
ci1.tree_sortkey between ci2.tree_sortkey and
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.1.2.3 -r1.1.2.4
--- openacs-4/packages/file-storage/www/copy.tcl 30 Jul 2004 11:22:15 -0000 1.1.2.3
+++ openacs-4/packages/file-storage/www/copy.tcl 24 Aug 2004 23:53:31 -0000 1.1.2.4
@@ -15,6 +15,8 @@
}
set objects_to_copy $object_id
+set object_id_list [join $object_id ","]
+
set user_id [ad_conn user_id]
set peer_addr [ad_conn peeraddr]
set allowed_count 0
@@ -51,13 +53,8 @@
template::multirow foreach copy_objects {
db_transaction {
db_exec_plsql copy_item {}
- } on_error {
- set folder_name "[_ file-storage.folder]"
- set folder_link "$folder_name"
- ad_return_complaint 1 "[_ file-storage.lt_The_folder_link_you_s]"
- ad_script_abort
- }
}
+ }
ad_returnredirect $return_url
ad_script_abort
@@ -83,7 +80,7 @@
label "\#file-storage.Choose_Destination_Folder\#"
link_url_col copy_url
link_html {title "\#file-storage.Copy_to_folder_title\#"}
- display_template {@folder_tree.label@
}
+ display_template {@folder_tree.label@
}
}
}
set root_folder_id [fs::get_root_folder]
Index: openacs-4/packages/file-storage/www/move-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/Attic/move-oracle.xql,v
diff -u -r1.1.2.3 -r1.1.2.4
--- openacs-4/packages/file-storage/www/move-oracle.xql 11 Jul 2004 11:35:13 -0000 1.1.2.3
+++ openacs-4/packages/file-storage/www/move-oracle.xql 24 Aug 2004 23:53:31 -0000 1.1.2.4
@@ -25,21 +25,25 @@
- select content_item.move(
+ begin
+ content_item.move(
:object_id,
:folder_id
- )
+ );
+ end;
select
- cf.folder_id, cf.label, ci1.level
- from cr_folders cf, (select item_id, level from
+ cf.folder_id, cf.label, ci1.level_num
+ from cr_folders cf, (select item_id, parent_id, level as level_num from
cr_items
- connect by prior item_id=parent_id
- start with :root_folder_id
+ where cr_items.item_id not in ($object_id_list)
+ connect by (prior item_id=parent_id and parent_id not in ($object_id_list))
+ start with cr_items.item_id = :root_folder_id
+
) ci1
where
ci1.item_id=cf.folder_id
@@ -48,7 +52,7 @@
where m.object_id = cf.folder_id
and m.party_id = :user_id
and m.privilege = 'write')
- order by order by ci1.level, cf.label
+ order by level_num, cf.label
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.1.2.3 -r1.1.2.4
--- openacs-4/packages/file-storage/www/move-postgresql.xql 11 Jul 2004 11:35:13 -0000 1.1.2.3
+++ openacs-4/packages/file-storage/www/move-postgresql.xql 24 Aug 2004 23:53:31 -0000 1.1.2.4
@@ -35,7 +35,7 @@
select
- cf.folder_id, cf.label, tree_level(ci1.tree_sortkey) as level
+ cf.folder_id, cf.label, tree_level(ci1.tree_sortkey) as level_num
from cr_folders cf, cr_items ci1, cr_items ci2
where
ci1.tree_sortkey between ci2.tree_sortkey and
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.1.2.6 -r1.1.2.7
--- openacs-4/packages/file-storage/www/move.tcl 22 Jul 2004 17:38:19 -0000 1.1.2.6
+++ openacs-4/packages/file-storage/www/move.tcl 24 Aug 2004 23:53:31 -0000 1.1.2.7
@@ -14,7 +14,10 @@
{show_items:boolean 0}
}
+
set objects_to_move $object_id
+set object_id_list [join $object_id ","]
+
set user_id [ad_conn user_id]
set allowed_count 0
@@ -38,6 +41,7 @@
}
if {[info exists folder_id]} {
+
permission::require_permission \
-party_id $user_id \
-object_id $folder_id \
@@ -49,15 +53,10 @@
# but the existing file-move page checks for WRITE
template::multirow foreach move_objects {
- db_transaction {
- db_exec_plsql move_item {}
- } on_error {
- set folder_name "[_ file-storage.folder]"
- set folder_link "$folder_name"
- ad_return_complaint 1 "[_ file-storage.lt_The_folder_link_you_s]"
- ad_script_abort
- }
- }
+ db_transaction {
+ db_exec_plsql move_item {}
+ }
+ }
ad_returnredirect $return_url
ad_script_abort
@@ -83,12 +82,15 @@
label "\#file-storage.Choose_Destination_Folder\#"
link_url_col move_url
link_html {title "\#file-storage.Move_to_folder_title\#"}
- display_template {@folder_tree.label@
}
+ display_template {@folder_tree.label@
}
}
}
set root_folder_id [fs::get_root_folder]
set object_id $objects_to_move
- db_multirow -extend {move_url} folder_tree get_folder_tree "" {
+ db_multirow -extend {move_url level} folder_tree get_folder_tree "" {
+ # teadams 2003-08-22 - change level to level num to avoid
+ # Oracle issue with key words.
+
set move_url [export_vars -base "move" { object_id:multiple folder_id return_url }]