Index: openacs-4/packages/faq/lib/faq-add-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/faq/lib/faq-add-edit.tcl,v diff -u -r1.1.10.1 -r1.1.10.2 --- openacs-4/packages/faq/lib/faq-add-edit.tcl 16 Feb 2007 18:08:20 -0000 1.1.10.1 +++ openacs-4/packages/faq/lib/faq-add-edit.tcl 21 Mar 2007 05:56:40 -0000 1.1.10.2 @@ -1,31 +1,23 @@ + if { ![exists_and_not_null mode] } { set mode "edit" } ad_form -name faq_add_edit -mode $mode -action "[ad_conn package_url]admin/faq-add-edit" -form { - - faq_id:key - {faq_name:text(text) {label "#faq.Name#"} {html { size 50 }}} - {separate_p:text(select) {label "#faq.QA_on_Separate_Pages#"} { options {{[_ faq.No] f} {[_ faq.Yes] t}} } } - - } -select_query { - select faq_name,separate_p from faqs where faq_id = :faq_id - } -new_data { - set user_id [ad_conn user_id] - set creation_ip [ad_conn host] - set package_id [ad_conn package_id] - set faq_id [db_exec_plsql create_faq {}] - } -edit_data { - db_dml faq_edit { - update faqs - set faq_name = :faq_name, - separate_p = :separate_p - where faq_id = :faq_id - } - } -after_submit { - if { ![exists_and_not_null return_url] } { - set return_url [export_vars -base one-faq { faq_id }] - } - ad_returnredirect $return_url - ad_script_abort - } + faq_id:key + {faq_name:text(text) {label "#faq.Name#"} {html { size 50 }}} + {separate_p:text(select) {label "#faq.QA_on_Separate_Pages#"} { options {{[_ faq.No] f} {[_ faq.Yes] t}} } } +} -select_query_name get_faq -new_data { + set user_id [ad_conn user_id] + set creation_ip [ad_conn host] + set package_id [ad_conn package_id] + set faq_id [db_exec_plsql create_faq {}] +} -edit_data { + db_dml edit_faq {} +} -after_submit { + if { ![exists_and_not_null return_url] } { + set return_url [export_vars -base one-faq { faq_id }] + } + ad_returnredirect $return_url + ad_script_abort +}