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 -r1.1.2.1 --- openacs-4/packages/faq/tcl/faq-procs.tcl 19 May 2004 20:09:43 -0000 1.1 +++ openacs-4/packages/faq/tcl/faq-procs.tcl 16 Nov 2005 11:34:52 -0000 1.1.2.1 @@ -7,7 +7,52 @@ @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 { @@ -24,3 +69,5 @@ } } + + 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 -r1.1.2.1 --- openacs-4/packages/faq/tcl/faq-procs.xql 19 May 2004 20:09:43 -0000 1.1 +++ openacs-4/packages/faq/tcl/faq-procs.xql 16 Nov 2005 11:34:52 -0000 1.1.2.1 @@ -8,6 +8,20 @@ + + + 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); + + +