Index: openacs-4/packages/notifications/tcl/notification-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/notifications/tcl/notification-procs.tcl,v diff -u -r1.10 -r1.11 --- openacs-4/packages/notifications/tcl/notification-procs.tcl 29 Jun 2004 10:18:42 -0000 1.10 +++ openacs-4/packages/notifications/tcl/notification-procs.tcl 13 Jun 2005 16:30:08 -0000 1.11 @@ -345,3 +345,34 @@ db_dml insert_notification_user_map {} } } + +namespace eval notification::merge { + ad_proc -callback MergeShowUserInfo -impl notifications { + -user_id:required + } { + Show the notifications of user_id + } { + set result [list "Notifications of $user_id"] + set user_notifications [db_list_of_lists user_notification { *SQL* }] + lappend result $user_notifications + return $result + } + + ad_proc -callback MergePackageUser -impl notifications { + -from_user_id:required + -to_user_id:required + } { + Merge the notifications of two users. + } { + set msg "Merging notifications" + set result [list $msg] + ns_log Notice $msg + + db_transaction { + db_dml upd_notifications { *SQL* } + db_dml upd_map { *SQL* } + lappend result "Notifications merge is done" + } + return $result + } +} Index: openacs-4/packages/notifications/tcl/notification-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/notifications/tcl/notification-procs.xql,v diff -u -r1.8 -r1.9 --- openacs-4/packages/notifications/tcl/notification-procs.xql 13 Jan 2005 13:58:33 -0000 1.8 +++ openacs-4/packages/notifications/tcl/notification-procs.xql 13 Jun 2005 16:30:08 -0000 1.9 @@ -81,4 +81,28 @@ + + + select notification_id, notif_subject + from notifications + where notif_user = :user_id + + + + + + update notifications + set notif_user = :to_user_id + where notif_user = :from_user_id + + + + + + update notification_user_map + set user_id = :to_user_id + where user_id = :from_user_id + + +