Index: openacs-4/packages/photo-album/tcl/photo-album-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/tcl/photo-album-procs.tcl,v diff -u -r1.14 -r1.15 --- openacs-4/packages/photo-album/tcl/photo-album-procs.tcl 19 Mar 2005 17:35:43 -0000 1.14 +++ openacs-4/packages/photo-album/tcl/photo-album-procs.tcl 13 Jun 2005 16:31:11 -0000 1.15 @@ -1258,4 +1258,35 @@ } return [site_node::get_element -node_id $node_id -element url] -} \ No newline at end of file +} + + +namespace eval photo_album::merge { + ad_proc -callback MergeShowUserInfo -impl photo_album { + -user_id:required + } { + Show the items of user_id + } { + set result [list "photo_album items of $user_id"] + set user_items [db_list_of_lists sel_collections { *SQL* }] + lappend result $user_items + return $result + } + + ad_proc -callback MergePackageUser -impl photo_album { + -from_user_id:required + -to_user_id:required + } { + Merge the photo_album items of two users. + } { + set msg "Merging photo album" + set result [list $msg] + ns_log Notice $msg + + db_transaction { + db_dml upd_collections { *SQL* } + lappend result "Photo album merge is done" + } + return $result + } +} Index: openacs-4/packages/photo-album/tcl/photo-album-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/tcl/photo-album-procs.xql,v diff -u -r1.4 -r1.5 --- openacs-4/packages/photo-album/tcl/photo-album-procs.xql 26 Jul 2004 13:07:42 -0000 1.4 +++ openacs-4/packages/photo-album/tcl/photo-album-procs.xql 13 Jun 2005 16:31:11 -0000 1.5 @@ -50,4 +50,20 @@ + + + update pa_collections + set owner_id = :to_user_id + where owner_id = :from_user_id + + + + + + select collection_id, title + from pa_collections + where owner_id = :user_id + + +