Index: openacs-4/packages/faq/tcl/faq-callback-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/faq/tcl/faq-callback-procs.tcl,v diff -u -r1.1.2.6 -r1.1.2.7 --- openacs-4/packages/faq/tcl/faq-callback-procs.tcl 16 Nov 2005 11:47:27 -0000 1.1.2.6 +++ openacs-4/packages/faq/tcl/faq-callback-procs.tcl 3 Mar 2006 12:43:39 -0000 1.1.2.7 @@ -4,91 +4,7 @@ @creation_date 2005-07-08 } -ad_proc -public -callback datamanager::move_faq -impl datamanager { - -object_id:required - -selected_community:required -} { - Move a faq to another class or community -} { - db_1row get_faqs_package {} - - db_transaction { - db_dml update_faqs_q_and_a {} - db_dml update_faqs {} - } on_error { - ad_return_error "Database error" "A database error occured:
$errmsg
" - } -} - - -ad_proc -public -callback datamanager::delete_faq -impl datamanager { - -object_id:required - -selected_community:required -} { - Move a faq to the trash -} { -set trash_id [datamanager::get_trash_id] -set trash_package_id [datamanager::get_trash_package_id] - db_transaction { - db_dml del_update_faqs_q_and_a {} - db_dml del_update_faqs {} - } on_error { - ad_return_error "Database error" "A database error occured:
$errmsg
" - } -} - - -ad_proc -public -callback datamanager::copy_faq -impl datamanager { - -object_id:required - -selected_community:required -} { - Copy a faq to another class or community. Q&A are also copied -} { - -#get data about the faq - set package_id [faq::get_package_id -community_id $selected_community] - db_1row get_faq_name {} - - set user_id [ad_conn user_id] - set creation_ip [ad_conn host] - set faq_id [faq::faq_new -package_id $package_id -faq_name $faq_name -separate_p $separate_p] - - - -#get list of Q&A (ids) - set q_a_list [db_list_of_lists get_q_a_list {}] - - set q_a_number [llength $q_a_list] - -#for each Q&A, one entry - for {set i 0} {$i < $q_a_number} {incr i} { - - set one_question [lindex [lindex $q_a_list $i] 0] - set one_answer [lindex [lindex $q_a_list $i] 1] - set entry_id [db_nextval acs_object_id_seq] - set sort_key $entry_id - - db_transaction { - db_exec_plsql create_q_and_a { - begin - :1 := faq.new_q_and_a ( - entry_id => :entry_id, - context_id => :faq_id, - faq_id=> :faq_id, - question => :one_question, - answer => :one_answer, - sort_key => :sort_key, - creation_user => :user_id, - creation_ip => :creation_ip - ); - end; - } - } - } - return $faq_id -} - #Callbacks for application-track ad_proc -callback application-track::getApplicationName -impl faqs {} { @@ -149,4 +65,4 @@ return "OK" } - \ No newline at end of file + Fisheye: Tag 1.1.2.5 refers to a dead (removed) revision in file `openacs-4/packages/faq/tcl/faq-callback-procs.xql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/faq/tcl/faq-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/faq/tcl/faq-procs.tcl,v diff -u -r1.1.2.1 -r1.1.2.2 --- openacs-4/packages/faq/tcl/faq-procs.tcl 16 Nov 2005 11:34:52 -0000 1.1.2.1 +++ openacs-4/packages/faq/tcl/faq-procs.tcl 3 Mar 2006 12:43:39 -0000 1.1.2.2 @@ -7,52 +7,7 @@ @Modifyed by Gerardo Morales } -namespace eval faq { - ad_proc -public get_package_id { - -community_id - } { - if {[info exist community_id]} { } else { set community_id [ad_conn community_id] } - db_1row get_faqs_package {} - return $package_id - - } - - - ad_proc -public faq_new { - -package_id - {-separate_p "f"} - -faq_name:required - } { - if {[info exist package_id]} { } else { set package_id [ad_conn package_id] } - set faq_id [db_nextval acs_object_id_seq] - set user_id [ad_conn user_id] - set creation_ip [ad_conn host] - - db_transaction { - db_exec_plsql create_faq { - begin - :1 := faq.new_faq ( - faq_id => :faq_id, - faq_name => :faq_name, - separate_p => :separate_p, - creation_user => :user_id, - creation_ip => :creation_ip, - context_id => :package_id - ); - end; - } - } - - return $faq_id - - } - - -} - - - namespace eval faq::notification { ad_proc -public get_url { @@ -69,5 +24,3 @@ } } - - Index: openacs-4/packages/faq/tcl/faq-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/faq/tcl/faq-procs.xql,v diff -u -r1.1.2.1 -r1.1.2.2 --- openacs-4/packages/faq/tcl/faq-procs.xql 16 Nov 2005 11:34:52 -0000 1.1.2.1 +++ openacs-4/packages/faq/tcl/faq-procs.xql 3 Mar 2006 12:43:39 -0000 1.1.2.2 @@ -8,20 +8,6 @@ - - - SELECT package_id - FROM dotlrn_community_applets - WHERE community_id = :community_id and applet_id = (select applet_id from dotlrn_applets where applet_key = 'dotlrn_faq') - - - - - - select faq__new_faq (:faq_id, :faq_name,:separate_p,'faq', now(), :user_id,:creation_ip,:package_id); - - - Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `openacs-4/packages/faq/tcl/test/faq-callback-procs.tcl'. Fisheye: No comparison available. Pass `N' to diff?