Index: openacs-4/contrib/packages/classified-ads/www/admin/ad-one.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/classified-ads/www/admin/ad-one.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/contrib/packages/classified-ads/www/admin/ad-one.tcl 24 Jul 2003 20:20:10 -0000 1.4 +++ openacs-4/contrib/packages/classified-ads/www/admin/ad-one.tcl 25 Jul 2003 02:39:57 -0000 1.5 @@ -42,31 +42,31 @@ } -if {[template::form is_request ad]} { - ns_log notice "RBM: Executed on_request. Action = $action." - classified-ads::ads::get -ad_id $ad_id -revision_id $revision_id -array adinfo +classified-ads::ads::get -ad_id $ad_id -revision_id $revision_id -array adinfo - # Get extra custom widgets, if any +# Get extra custom widgets, if any - classified-ads::widgets::get_widget_params \ +classified-ads::widgets::get_widget_params \ -content_type "ca_ad" \ -form_id ad \ -keyword_id $adinfo(keyword_id) +if {[template::form is_request ad]} { + # + # If this is not a submission, get the values we have stored for + # custom fields. + # + set form_values [classified-ads::get_attribute_values -item_id $ad_id -item_id_element ad_id] classified-ads::widgets::set_widget_values -form_id ad -form_values $form_values template::element::set_value ad title $adinfo(title) template::element::set_value ad description $adinfo(description) template::element::set_value ad data $adinfo(data) +} - ns_log notice "RBM: on_request: isbn exists? [template::element::exists ad isbn] , [info exists isbn]" -} - ad_form -extend -name ad -edit_data { - ns_log notice "RBM: Executed edit_data. Action = $action" - ns_log notice "RBM: isbn_exists? [template::element::exists ad isbn], OK? [info exists isbn]. description exists? [template::element::exists ad description]" set ad_id [classified-ads::ads::edit \ -item_id_element ad_id \ -form_id ad] @@ -77,7 +77,6 @@ ad_script_abort } -edit_request { - ns_log notice "RBM: Executed edit_request. Action = $action. isbn_exists? [template::element::exists ad isbn] OK? [info exists isbn]" if { [string equal $action "delete"] } { # # If the delete button was pressed @@ -91,6 +90,7 @@ #rp_internal_redirect ad-delete ad_script_abort } -} + +} ad_return_template