For Date type, entering \"0\" here will set the default value to the current time of each new item. For other dates, use the format \"YYYY-MM-DD\"
+
Index: openacs-4/packages/ecommerce/www/admin/products/edit-2.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/products/edit-2.tcl,v
diff -u -r1.6 -r1.6.2.1
--- openacs-4/packages/ecommerce/www/admin/products/edit-2.tcl 9 Mar 2004 00:59:51 -0000 1.6
+++ openacs-4/packages/ecommerce/www/admin/products/edit-2.tcl 31 Oct 2004 10:12:59 -0000 1.6.2.1
@@ -126,10 +126,10 @@
#page_validation {
#ec_date_widget_validate available_date
#} {
- #set date_field_identifiers [db_list custom_date_fields_select "select field_identifier from ec_custom_product_fields where column_type='date' and active_p='t'"]
- #foreach field_identifier $date_field_identifiers {
- #array set date {year ec_custom_fields($field_identifier.year) month ec_custom_fields($field_identifier.month) ec_custom_fields($field_identifier.day)}
- # ec_date_widget_validate date
+# set date_field_identifiers [db_list custom_date_fields_select "select field_identifier from ec_custom_product_fields where column_type='date' and active_p='t'"]
+ # foreach field_identifier $date_field_identifiers {
+ # array set date {year ec_custom_fields($field_identifier.year) month ec_custom_fields($field_identifier.month) ec_custom_fields($field_identifier.day)}
+ # ec_date_widget_validate date
#}
#}
@@ -404,6 +404,24 @@
from ec_custom_product_fields
where active_p = 't'
} {
+ if { [string equal $column_type "date"] || [string equal $column_type "timestamp"] } {
+
+ #CM This is a mess but it seems to work. Basically need to put together the date from the pieces
+
+ #set up a date array to work with.
+ array set date "year $ec_custom_fields($field_identifier.year) month $ec_custom_fields($field_identifier.month) day $ec_custom_fields($field_identifier.day)"
+
+ #Validate the date - This really should get caught somewhere or put up in the validate section of page contract.
+
+ ec_date_widget_validate date
+
+ #Run the proc that usually runs as part of page contract
+ ad_page_contract_filter_proc_date name date
+
+ #Now set the custom field to the ansi date that is set by the above.
+ set ec_custom_fields($field_identifier) $date(date)
+
+ }
if { [info exists ec_custom_fields($field_identifier)] } {
doc_body_append "