Index: openacs-4/contrib/packages/simulation/www/siminst/simulation-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/simulation/www/siminst/Attic/simulation-edit.tcl,v diff -u -r1.8 -r1.9 --- openacs-4/contrib/packages/simulation/www/siminst/simulation-edit.tcl 12 Jan 2004 14:46:30 -0000 1.8 +++ openacs-4/contrib/packages/simulation/www/siminst/simulation-edit.tcl 13 Jan 2004 10:17:11 -0000 1.9 @@ -80,6 +80,8 @@ if { [empty_string_p $case_end] } { set case_end [clock format [expr [clock seconds] + 2*$one_week + $default_duration] -format "%Y-%m-%d"] } + # TODO: B: (0.5h) Offer sensible defaults for enroll_start and enroll_end. + # Couldn't get it to work in the on_refresh block. Lars? if { [empty_string_p $enroll_start] } { set enroll_start [clock format [expr [clock seconds] + 1*$one_week] -format "%Y-%m-%d"] } @@ -91,6 +93,14 @@ # Date validation set error_p 0 + # All dates need to be in the future + foreach date_var {send_start_note_date case_start case_end enroll_start enroll_end} { + if { [clock scan [set $date_var]] < [clock seconds] } { + template::form::set_error simulation $date_var "The date needs to be in the future" + set error_p 1 + } + } + if { [clock scan $send_start_note_date] > [clock scan $case_start] } { template::form::set_error simulation send_start_note_date "Send start note date must be before simulation start date" set error_p 1