Index: openacs-4/packages/photo-album/www/photo-move-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/Attic/photo-move-oracle.xql,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/photo-album/www/photo-move-oracle.xql 10 Jun 2003 10:07:11 -0000 1.1
+++ openacs-4/packages/photo-album/www/photo-move-oracle.xql 30 Jun 2003 07:52:26 -0000 1.2
@@ -5,13 +5,14 @@
- select r.title as name, i.item_id
+ select r.title as name, i.item_id
from cr_items i, cr_revisions r
where i.live_revision = r.revision_id
- and i.parent_id = (select parent_id from cr_items where item_id = :old_album_id)
- and acs_permission.permission_p(i.item_id, :user_id, 'read') = 't'
+ and acs_permission.permission_p(i.item_id, :user_id, 'pa_create_photo') = 't'
and i.content_type = 'pa_album'
and i.item_id != :old_album_id
+ connect by prior i.item_id = i.parent_id
+ start with i.item_id = :root_folder_id
Index: openacs-4/packages/photo-album/www/photo-move-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/Attic/photo-move-postgresql.xql,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/photo-album/www/photo-move-postgresql.xql 10 Jun 2003 10:07:11 -0000 1.1
+++ openacs-4/packages/photo-album/www/photo-move-postgresql.xql 30 Jun 2003 07:52:26 -0000 1.2
@@ -5,13 +5,15 @@
- select r.title as name, i.item_id
- from cr_items i, cr_revisions r
+ select r.title as name, i.item_id
+ from cr_items i, cr_revisions r, cr_items i2
where i.live_revision = r.revision_id
- and i.parent_id = (select parent_id from cr_items where item_id = :old_album_id)
- and acs_permission__permission_p(i.item_id, :user_id, 'read') = 't'
+ and acs_permission__permission_p(i.item_id, :user_id, 'pa_create_photo') = 't'
and i.content_type = 'pa_album'
and i.item_id != :old_album_id
+ and i.tree_sortkey between i2.tree_sortkey and tree_right(i2.tree_sortkey)
+ and i2.item_id = :root_folder_id
+ order by i.tree_sortkey
Index: openacs-4/packages/photo-album/www/photo-move.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/Attic/photo-move.tcl,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/photo-album/www/photo-move.tcl 12 Jun 2003 06:55:45 -0000 1.2
+++ openacs-4/packages/photo-album/www/photo-move.tcl 30 Jun 2003 07:52:26 -0000 1.3
@@ -17,6 +17,7 @@
}
set context_list [pa_context_bar_list -final "Move Photo" $photo_id]
set user_id [ad_conn user_id]
+set root_folder_id [pa_get_root_folder]
# to move a photo need write on photo, and old parent album
# and pa_create_photo on new parent album (which is check in the is_valid block)