Index: openacs-4/packages/edit-this-page/www/etp-edit-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/edit-this-page/www/Attic/etp-edit-2.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/edit-this-page/www/etp-edit-2.tcl 20 Nov 2001 02:04:50 -0000 1.2 +++ openacs-4/packages/edit-this-page/www/etp-edit-2.tcl 18 Dec 2001 19:28:00 -0000 1.3 @@ -7,6 +7,7 @@ } { name attribute + datevalue:array,date,optional } -properties { page_title:onevalue attribute_title:onevalue @@ -15,12 +16,19 @@ etp::check_write_access -set form [ns_getform] -if { [empty_string_p $form] || [ns_set find $form $attribute] == -1 } { - ad_return_error "This is a bug" "Form must provide value for $attribute" - ad_script_abort +if {[info exists datevalue]} { + set date_string $datevalue(date) + # The date is given in YYYY-MM-DD. Transform to desired format. + set date_format [etp::get_application_param date_format] + set value [db_string transform_date ""] +} else { + set form [ns_getform] + if { [empty_string_p $form] || [ns_set find $form $attribute] == -1 } { + ad_return_error "This is a bug" "Form must provide value for $attribute" + ad_script_abort + } + set value [ns_set get $form $attribute] } -set value [ns_set get $form $attribute] # TODO: validate the html that was given to us