Index: openacs-4/packages/forums/tcl/forums-callback-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/tcl/forums-callback-procs.tcl,v diff -u -r1.1.2.7 -r1.1.2.8 --- openacs-4/packages/forums/tcl/forums-callback-procs.tcl 16 Nov 2005 11:24:19 -0000 1.1.2.7 +++ openacs-4/packages/forums/tcl/forums-callback-procs.tcl 3 Mar 2006 13:02:56 -0000 1.1.2.8 @@ -91,135 +91,6 @@ return $result } - -ad_proc -public -callback datamanager::move_forum -impl datamanager { - -object_id:required - -selected_community:required -} { - Move a forum to another class or community -} { - -#get the new_package_id -set new_package_id [forum::get_forum_package -community_id $selected_community] - -#update forums_forums table -db_dml update_forums {} -#update acs_objects table (because data redundancy) -db_dml update_forums_acs_objects {} -} - - -ad_proc -public -callback datamanager::delete_forum -impl datamanager { - -object_id:required -} { - Move a forum to the trash -} { - -#get trash_id -set trash_package_id [datamanager::get_trash_package_id] - - -#update forums_forums table -db_dml del_update_forums {} -#update acs_objects table (because data redundancy) -db_dml del_update_forums_acs_objects {} -} - - -ad_proc -public -callback datamanager::copy_forum -impl datamanager { - -object_id:required - -selected_community:required - {-mode: "empty"} -} { - Copy a forum to another class or community -} { -#get forum's data - set forum_id [db_nextval acs_object_id_seq] - set package_id [forum::get_forum_package -community_id $selected_community] - db_1row get_forum_data {} - -#create the new forums - set forum_id [forum::new -forum_id $forum_id \ - -name $name \ - -charter $charter \ - -presentation_type $presentation_type \ - -posting_policy $posting_policy \ - -package_id $package_id \ - ] - -#copy the messages?? - switch $mode { - empty { - set first_messages 0 - set all_messages 0 - } - threads { - set first_messages 1 - set all_messages 0 - } - all { - set first_messages 1 - set all_messages 1 - } - default { - set first_messages 0 - set all_messages 0 - } - } - - if { $first_messages == 1 } { -#copy the first message of the threads - set first_messages_list [db_list_of_lists get_first_messages_list {}] - set first_messages_number [llength $first_messages_list] - - for {set i 0} {$i < $first_messages_number} {incr i} { - #code for copying a messages - set message_id [db_nextval acs_object_id_seq] - set subject [lindex [lindex $first_messages_list $i] 0] - set content [lindex [lindex $first_messages_list $i] 1] - set user_id [lindex [lindex $first_messages_list $i] 2] - set formato [lindex [lindex $first_messages_list $i] 3] - set parent_id [lindex [lindex $first_messages_list $i] 4] - - - set message_id [forum::message::new \ - -forum_id $forum_id \ - -message_id $message_id \ - -parent_id $parent_id\ - -subject $subject\ - -content $content\ - -format $formato\ - -user_id $user_id ] - } - - if { $all_messages == 1 } { -#copy all the messages of the threads - set all_messages_list [db_list_of_lists get_all_messages_list {}] - set all_messages_number [llength $all_messages_list] - - for {set i 0} {$i < $all_messages_number} {incr i} { - - set message_id [db_nextval acs_object_id_seq] - set subject [lindex [lindex $all_messages_list $i] 0] - set content [lindex [lindex $all_messages_list $i] 1] - set user_id [lindex [lindex $all_messages_list $i] 2] - set formato [lindex [lindex $all_messages_list $i] 3] - set parent_id [lindex [lindex $all_messages_list $i] 4] - - set message_id [forum::message::new \ - -forum_id $forum_id \ - -message_id $message_id \ - -parent_id $parent_id\ - -subject $subject\ - -content $content\ - -format $formato\ - -user_id $user_id ] - } - } - } - return $forum_id -} - #Callbacks for application-track ad_proc -callback application-track::getApplicationName -impl forums {} { @@ -285,5 +156,4 @@ } return "OK" - } - + } Index: openacs-4/packages/forums/tcl/forums-callback-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/tcl/forums-callback-procs.xql,v diff -u -r1.1.2.4 -r1.1.2.5 --- openacs-4/packages/forums/tcl/forums-callback-procs.xql 10 Oct 2005 12:59:35 -0000 1.1.2.4 +++ openacs-4/packages/forums/tcl/forums-callback-procs.xql 3 Mar 2006 13:02:56 -0000 1.1.2.5 @@ -33,67 +33,4 @@ - - - update forums_forums - set package_id = :new_package_id - where forum_id = :object_id - - - - - - update forums_forums - set package_id = :trash_package_id - where forum_id = :object_id - - - - - - - - update acs_objects - set package_id = :new_package_id, - context_id = :new_package_id - where object_id = :object_id - - - - - - -update acs_objects -set package_id = :trash_package_id, - context_id = :trash_package_id -where object_id = :object_id - - - - - - SELECT name,charter,presentation_type,posting_policy - FROM forums_forums - WHERE forum_id=:object_id; - - - - - - SELECT subject,content,user_id,format as formato,parent_id - FROM forums_messages - WHERE forum_id=:object_id and parent_id IS NULL; - - - - - - SELECT subject,content,user_id,format as formato,parent_id - FROM forums_messages - WHERE forum_id=:object_id and parent_id IS NOT NULL; - - - - - 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.17.2.5 -r1.17.2.6 --- openacs-4/packages/forums/tcl/forums-procs.tcl 10 Oct 2005 12:59:35 -0000 1.17.2.5 +++ openacs-4/packages/forums/tcl/forums-procs.tcl 3 Mar 2006 13:02:56 -0000 1.17.2.6 @@ -150,15 +150,3 @@ } { db_dml update_forum_disabled_p {} } - -ad_proc forum::get_forum_package { - {-community_id} -} { - if {[info exist community_id] == 0} { - set community_id [dotlrn_community::get_community_id] - } - - db_1row get_forum_package_id {} - - return $package_id -} Index: openacs-4/packages/forums/tcl/forums-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/tcl/forums-procs.xql,v diff -u -r1.5.2.3 -r1.5.2.4 --- openacs-4/packages/forums/tcl/forums-procs.xql 10 Oct 2005 12:59:35 -0000 1.5.2.3 +++ openacs-4/packages/forums/tcl/forums-procs.xql 3 Mar 2006 13:02:56 -0000 1.5.2.4 @@ -56,12 +56,4 @@ - - - SELECT b.object_id as package_id - FROM acs_objects as a,acs_objects as b - WHERE a.context_id=:community_id and a.object_type='apm_package' and a.object_id=b.context_id and b.title='Forums'; - - - Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `openacs-4/packages/forums/tcl/test/forums-callback-procs.tcl'. Fisheye: No comparison available. Pass `N' to diff?