Index: openacs-4/contrib/packages/classified-ads/www/admin/ad-new.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/classified-ads/www/admin/ad-new.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/contrib/packages/classified-ads/www/admin/ad-new.tcl 30 Jul 2003 04:56:41 -0000 1.6 +++ openacs-4/contrib/packages/classified-ads/www/admin/ad-new.tcl 31 Jul 2003 09:31:01 -0000 1.7 @@ -47,6 +47,23 @@ {html {cols 60 rows 3 wrap soft}} } {data:text(textarea),optional {label "Content"} {html {cols 60 rows 10 wrap soft}} } +} -on_request { + # Get extra custom widgets, if any + + classified-ads::widgets::get_widget_params \ + -content_type "ca_ad" \ + -form_id ad \ + -keyword_id $keyword_id + + # + # 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 + } -new_data { set ad_id [classified-ads::ads::new \ -item_id_element ad_id \ @@ -59,13 +76,7 @@ ad_script_abort } -# Get extra custom widgets, if any -classified-ads::widgets::get_widget_params \ - -content_type "ca_ad" \ - -form_id ad \ - -keyword_id $keyword_id - set context [list [list "ads" "Ads"] $title] ad_return_template