Index: openacs-4/contrib/packages/simulation/www/siminst/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/simulation/www/siminst/Attic/index.tcl,v diff -u -r1.31 -r1.32 --- openacs-4/contrib/packages/simulation/www/siminst/index.tcl 14 Jan 2004 15:10:54 -0000 1.31 +++ openacs-4/contrib/packages/simulation/www/siminst/index.tcl 22 Jan 2004 15:26:34 -0000 1.32 @@ -51,6 +51,7 @@ delete { sub_class narrow link_url_col delete_url + link_html { onclick "return confirm('Are you sure you want to delete simulation @dev_sims.pretty_name@?');" } display_template { Delete } @@ -155,6 +156,7 @@ delete { sub_class narrow link_url_col delete_url + link_html { onclick "return confirm('Are you sure you want to delete simulation @casting_sims.pretty_name@?');" } display_template { Edit } Index: openacs-4/contrib/packages/simulation/www/siminst/simulation-casting-3.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/simulation/www/siminst/Attic/simulation-casting-3.adp,v diff -u -r1.18 -r1.19 --- openacs-4/contrib/packages/simulation/www/siminst/simulation-casting-3.adp 20 Jan 2004 12:41:03 -0000 1.18 +++ openacs-4/contrib/packages/simulation/www/siminst/simulation-casting-3.adp 22 Jan 2004 15:26:34 -0000 1.19 @@ -19,12 +19,16 @@
You cannot submit this form until you have submitted all forms on the previous tabs.
+ +
Warning: this simulation is already in casting. Clicking the finish button may have unwanted consequences such as sending notifications twice to users.
+
+

TODO: B: (1h) Show total number of users per case. Javascript. Lars?

- TODO: A: Some data needs to be read only if you return to the wizard after you've clicked the finish button. Test this. + TODO: B: Some data needs to be read only if you return to the wizard after you've clicked the finish button. Test this.

Index: openacs-4/contrib/packages/simulation/www/siminst/simulation-delete.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/simulation/www/siminst/Attic/simulation-delete.adp,v diff -u -r1.4 -r1.5 --- openacs-4/contrib/packages/simulation/www/siminst/simulation-delete.adp 13 Jan 2004 10:54:01 -0000 1.4 +++ openacs-4/contrib/packages/simulation/www/siminst/simulation-delete.adp 22 Jan 2004 15:26:34 -0000 1.5 @@ -1,7 +1,3 @@ @page_title;noquote@ @context;noquote@ - -

Confirmation page for cascading delete of simulation and all cases

- -

TODO: Make confirmation page real.

Index: openacs-4/contrib/packages/simulation/www/siminst/simulation-delete.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/simulation/www/siminst/Attic/simulation-delete.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/contrib/packages/simulation/www/siminst/simulation-delete.tcl 13 Jan 2004 10:54:01 -0000 1.2 +++ openacs-4/contrib/packages/simulation/www/siminst/simulation-delete.tcl 22 Jan 2004 15:26:34 -0000 1.3 @@ -1,10 +1,13 @@ ad_page_contract { Delete a simulation +} { + workflow_id:integer } set page_title "Delete simulation" set context [list $page_title] set package_id [ad_conn package_id] -# TODO: Cascading delete of the simulation +simulation::template::delete -workflow_id $workflow_id +ad_returnredirect . 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.13 -r1.14 --- openacs-4/contrib/packages/simulation/www/siminst/simulation-edit.tcl 20 Jan 2004 14:11:21 -0000 1.13 +++ openacs-4/contrib/packages/simulation/www/siminst/simulation-edit.tcl 22 Jan 2004 15:26:34 -0000 1.14 @@ -63,13 +63,14 @@ # Default values set one_week [expr 3600*24*7] + set default_duration $one_week if { ![empty_string_p $sim_template(suggested_duration)] } { - # TODO: (0.5h) use suggested_duaration_seconds instead here. Need to edit template-procs.xql - #set default_duration $sim_template(suggested_duration_seconds) - set default_duration $one_week - } else { - set default_duration $one_week - } + # FIXME: resorted to this hack as I couldn't figure out how to convert the interval to seconds + # in PG + if { [regexp {([0-9]+).*days} $sim_template(suggested_duration) match day_duration] } { + set default_duration [expr $day_duration*24*3600] + } + } if { [empty_string_p $send_start_note_date] } { set send_start_note_date [clock format [expr [clock seconds] + 1*$one_week] -format "%Y-%m-%d"] @@ -80,7 +81,7 @@ 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. + # TODO: B: (0.5h) Lars 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"] Index: openacs-4/packages/simulation/www/siminst/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/siminst/index.tcl,v diff -u -r1.31 -r1.32 --- openacs-4/packages/simulation/www/siminst/index.tcl 14 Jan 2004 15:10:54 -0000 1.31 +++ openacs-4/packages/simulation/www/siminst/index.tcl 22 Jan 2004 15:26:34 -0000 1.32 @@ -51,6 +51,7 @@ delete { sub_class narrow link_url_col delete_url + link_html { onclick "return confirm('Are you sure you want to delete simulation @dev_sims.pretty_name@?');" } display_template { Delete } @@ -155,6 +156,7 @@ delete { sub_class narrow link_url_col delete_url + link_html { onclick "return confirm('Are you sure you want to delete simulation @casting_sims.pretty_name@?');" } display_template { Edit } Index: openacs-4/packages/simulation/www/siminst/simulation-casting-3.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/siminst/simulation-casting-3.adp,v diff -u -r1.18 -r1.19 --- openacs-4/packages/simulation/www/siminst/simulation-casting-3.adp 20 Jan 2004 12:41:03 -0000 1.18 +++ openacs-4/packages/simulation/www/siminst/simulation-casting-3.adp 22 Jan 2004 15:26:34 -0000 1.19 @@ -19,12 +19,16 @@
You cannot submit this form until you have submitted all forms on the previous tabs.
+ +
Warning: this simulation is already in casting. Clicking the finish button may have unwanted consequences such as sending notifications twice to users.
+
+

TODO: B: (1h) Show total number of users per case. Javascript. Lars?

- TODO: A: Some data needs to be read only if you return to the wizard after you've clicked the finish button. Test this. + TODO: B: Some data needs to be read only if you return to the wizard after you've clicked the finish button. Test this.

Index: openacs-4/packages/simulation/www/siminst/simulation-delete.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/siminst/simulation-delete.adp,v diff -u -r1.4 -r1.5 --- openacs-4/packages/simulation/www/siminst/simulation-delete.adp 13 Jan 2004 10:54:01 -0000 1.4 +++ openacs-4/packages/simulation/www/siminst/simulation-delete.adp 22 Jan 2004 15:26:34 -0000 1.5 @@ -1,7 +1,3 @@ @page_title;noquote@ @context;noquote@ - -

Confirmation page for cascading delete of simulation and all cases

- -

TODO: Make confirmation page real.

Index: openacs-4/packages/simulation/www/siminst/simulation-delete.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/siminst/simulation-delete.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/simulation/www/siminst/simulation-delete.tcl 13 Jan 2004 10:54:01 -0000 1.2 +++ openacs-4/packages/simulation/www/siminst/simulation-delete.tcl 22 Jan 2004 15:26:34 -0000 1.3 @@ -1,10 +1,13 @@ ad_page_contract { Delete a simulation +} { + workflow_id:integer } set page_title "Delete simulation" set context [list $page_title] set package_id [ad_conn package_id] -# TODO: Cascading delete of the simulation +simulation::template::delete -workflow_id $workflow_id +ad_returnredirect . Index: openacs-4/packages/simulation/www/siminst/simulation-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/siminst/simulation-edit.tcl,v diff -u -r1.13 -r1.14 --- openacs-4/packages/simulation/www/siminst/simulation-edit.tcl 20 Jan 2004 14:11:21 -0000 1.13 +++ openacs-4/packages/simulation/www/siminst/simulation-edit.tcl 22 Jan 2004 15:26:34 -0000 1.14 @@ -63,13 +63,14 @@ # Default values set one_week [expr 3600*24*7] + set default_duration $one_week if { ![empty_string_p $sim_template(suggested_duration)] } { - # TODO: (0.5h) use suggested_duaration_seconds instead here. Need to edit template-procs.xql - #set default_duration $sim_template(suggested_duration_seconds) - set default_duration $one_week - } else { - set default_duration $one_week - } + # FIXME: resorted to this hack as I couldn't figure out how to convert the interval to seconds + # in PG + if { [regexp {([0-9]+).*days} $sim_template(suggested_duration) match day_duration] } { + set default_duration [expr $day_duration*24*3600] + } + } if { [empty_string_p $send_start_note_date] } { set send_start_note_date [clock format [expr [clock seconds] + 1*$one_week] -format "%Y-%m-%d"] @@ -80,7 +81,7 @@ 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. + # TODO: B: (0.5h) Lars 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"]