Index: openacs-4/packages/forums/tcl/forums-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/tcl/forums-procs.tcl,v diff -u -r1.18 -r1.19 --- openacs-4/packages/forums/tcl/forums-procs.tcl 26 May 2005 10:54:45 -0000 1.18 +++ openacs-4/packages/forums/tcl/forums-procs.tcl 13 Jun 2005 16:38:34 -0000 1.19 @@ -10,6 +10,56 @@ namespace eval forum {} +namespace eval forum::merge { + ad_proc -callback MergeShowUserInfo -impl forums { + -user_id:required + } { + Merge the *forums* of two users. + The from_user_id is the user_id of the user + that will be deleted and all the *forums* + of this user will be mapped to the to_user_id. + + } { + set msg "Forums items of $user_id" + ns_log Notice $msg + set result [list $msg] + + set last_poster [db_list_of_lists sel_poster {*SQL*} ] + set msg "Last Poster of $last_poster" + lappend result $msg + + set poster [db_list_of_lists sel_user_id {*SQL*} ] + set msg "Poster of $poster" + lappend result $msg + + return $result + } + + ad_proc -callback MergePackageUser -impl forums { + -from_user_id:required + -to_user_id:required + } { + Merge the *forums* of two users. + The from_user_id is the user_id of the user + that will be deleted and all the *forums* + of this user will be mapped to the to_user_id. + + } { + set msg "Merging forums" + ns_log Notice $msg + set result [list $msg] + + db_dml upd_poster { *SQL* } + db_dml upd_user_id { *SQL* } + + lappend result "Merge of forums is done" + + return $result + } +} + + + ad_proc -public forum::new { {-forum_id ""} {-name:required}