Index: openacs-4/contrib/packages/simulation/tcl/simulation-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/simulation/tcl/Attic/simulation-procs.tcl,v diff -u -r1.20 -r1.21 --- openacs-4/contrib/packages/simulation/tcl/simulation-procs.tcl 6 Jan 2004 16:09:33 -0000 1.20 +++ openacs-4/contrib/packages/simulation/tcl/simulation-procs.tcl 6 Jan 2004 18:36:27 -0000 1.21 @@ -178,7 +178,8 @@ @author Peter Marklund } { # Lookup the application group of the subsite - set subsite_group_id [subsite_group_id] + set subsite_group_id [application_group::group_id_from_package_id \ + -package_id [ad_conn subsite_id]] # Get all groups related to (children of) the subsite group (only one level down) set enrollment_clause [ad_decode $enrolled_only_p "0" "" "and exists (select 1 Index: openacs-4/contrib/packages/simulation/tcl/template-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/simulation/tcl/Attic/template-procs.tcl,v diff -u -r1.31 -r1.32 --- openacs-4/contrib/packages/simulation/tcl/template-procs.tcl 6 Jan 2004 16:26:37 -0000 1.31 +++ openacs-4/contrib/packages/simulation/tcl/template-procs.tcl 6 Jan 2004 18:36:27 -0000 1.32 @@ -755,7 +755,9 @@
- You have not yet started casting this simulation. -
-- Once you start casting, you can no longer change the roles mapping or task setup. -
- Begin casting now -TODO: implement invitations. -
TODO: When switching from open enrollment to "by invitation only" and back, the dates are lost -- see if we can avoid that. -
TODO: implement invitations. +
TODO: When switching from open enrollment to "by invitation only" and back, the dates are lost -- see if we can avoid that.
Index: openacs-4/contrib/packages/simulation/www/siminst/simulation-casting-2.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/simulation/www/siminst/Attic/simulation-casting-2.tcl,v
diff -u -r1.17 -r1.18
--- openacs-4/contrib/packages/simulation/www/siminst/simulation-casting-2.tcl 6 Jan 2004 16:26:37 -0000 1.17
+++ openacs-4/contrib/packages/simulation/www/siminst/simulation-casting-2.tcl 6 Jan 2004 18:36:28 -0000 1.18
@@ -6,134 +6,124 @@
simulation::template::get -workflow_id $workflow_id -array sim_template
-if { ![string equal $sim_template(sim_type) "casting_sim"] } {
- set page_title "Begin Casting"
- set begin_casting_url [export_vars -base simulation-casting { workflow_id {return_url {[ad_return_url]}} }]
+set package_id [ad_conn package_id]
-} else {
+subsite::get -array closest_subsite
+set group_admin_url "${closest_subsite(url)}admin/group-types/one?group_type=group"
- set page_title "Cast $sim_template(pretty_name)"
- set package_id [ad_conn package_id]
+# TODO: verify that prepopulated values work correctly
- subsite::get -array closest_subsite
- set group_admin_url "${closest_subsite(url)}admin/group-types/one?group_type=group"
+# TODO: provide more sensible default dates?
+# Notification send could be start date minus some parameter
+set in_a_month_date [clock format [expr [clock seconds] + 3600*24*31] -format "%Y-%m-%d"]
+set in_two_months_date [clock format [expr [clock seconds] + 2*3600*24*31] -format "%Y-%m-%d"]
+set in_two_and_a_half_months_date [clock format [expr [clock seconds] + 3*3600*24*31 - 3600*24*15] -format "%Y-%m-%d"]
+set in_three_months_date [clock format [expr [clock seconds] + 3*3600*24*31] -format "%Y-%m-%d"]
+set in_four_months_date [clock format [expr [clock seconds] + 4*3600*24*31] -format "%Y-%m-%d"]
- # TODO: verify that prepopulated values work correctly
+set eligible_groups [simulation::casting_groups -workflow_id $workflow_id]
- # TODO: provide more sensible default dates?
- # Notification send could be start date minus some parameter
- set in_a_month_date [clock format [expr [clock seconds] + 3600*24*31] -format "%Y-%m-%d"]
- set in_two_months_date [clock format [expr [clock seconds] + 2*3600*24*31] -format "%Y-%m-%d"]
- set in_two_and_a_half_months_date [clock format [expr [clock seconds] + 3*3600*24*31 - 3600*24*15] -format "%Y-%m-%d"]
- set in_three_months_date [clock format [expr [clock seconds] + 3*3600*24*31] -format "%Y-%m-%d"]
- set in_four_months_date [clock format [expr [clock seconds] + 4*3600*24*31] -format "%Y-%m-%d"]
+ad_form -export { workflow_id } -name simulation -form {
+ {enroll_type:text(radio)
+ {label "Enrollment type"}
+ {options {{"By invitation only" closed} {Open open}}}
+ {html {onChange "javascript:FormRefresh('simulation');"}}
+ }
+ {enroll_start:date,to_sql(ansi),from_sql(ansi),optional
+ {label "Enrollment start date"}
+ }
+ {enroll_end:date,to_sql(ansi),from_sql(ansi),optional
+ {label "Enrollment end date"}
+ }
+ {send_start_note_date:date,to_sql(ansi),from_sql(ansi),optional
+ {label "Date to send start notification (mockup only)"}
+ }
+ {case_start:date,to_sql(ansi),from_sql(ansi),optional
+ {label "Simulation start date"}
+ }
+ {case_end:date,to_sql(ansi),from_sql(ansi),optional
+ {label "Simulation end date"}
+ }
+ {casting_type:text(radio)
+ {label "Casting type"}
+ {options {{Automatic auto} {Group group} {Open open}}}
+ }
+ {auto_enroll:integer(checkbox),multiple,optional
+ {label "Enroll all users in these groups"}
+ {options $eligible_groups}
+ {help_text {Use Group Administration to add groups}}
+ }
+ {invite_groups:integer(checkbox),multiple,optional
+ {label "Invite all users in these groups (mockup only)"}
+ {options $eligible_groups}
+ {help_text {Use Group Administration to add groups}}
+ }
+} -on_request {
- set eligible_groups [simulation::casting_groups -workflow_id $workflow_id]
+ foreach elm {
+ enroll_type
+ casting_type
+ enroll_start
+ enroll_end
+ case_start
+ case_end
+ send_start_note_date
+ } {
+ set $elm $sim_template($elm)
+ }
- ad_form -export { workflow_id } -name simulation -form {
- {enroll_type:text(radio)
- {label "Enrollment type"}
- {options {{"By invitation only" closed} {Open open}}}
- {html {onChange "javascript:FormRefresh('simulation');"}}
- }
- {enroll_start:date,to_sql(ansi),from_sql(ansi),optional
- {label "Enrollment start date"}
- }
- {enroll_end:date,to_sql(ansi),from_sql(ansi),optional
- {label "Enrollment end date"}
- }
- {send_start_note_date:date,to_sql(ansi),from_sql(ansi),optional
- {label "Date to send start notification (mockup only)"}
- }
- {case_start:date,to_sql(ansi),from_sql(ansi),optional
- {label "Simulation start date"}
- }
- {case_end:date,to_sql(ansi),from_sql(ansi),optional
- {label "Simulation end date"}
- }
- {casting_type:text(radio)
- {label "Casting type"}
- {options {{Automatic auto} {Group group} {Open open}}}
- }
- {auto_enroll:integer(checkbox),multiple,optional
- {label "Enroll all users in these groups"}
- {options $eligible_groups}
- {help_text {Use Group Administration to add groups}}
- }
- {invite_groups:integer(checkbox),multiple,optional
- {label "Invite all users in these groups (mockup only)"}
- {options $eligible_groups}
- {help_text {Use Group Administration to add groups}}
- }
- } -on_request {
+ set auto_enroll [simulation::template::get_parties -workflow_id $workflow_id -rel_type auto_enroll]
- foreach elm {
- enroll_type
- casting_type
- enroll_start
- enroll_end
- case_start
- case_end
- send_start_note_date
- } {
- set $elm $sim_template($elm)
- }
+ # Default values
+ if { [empty_string_p $enroll_start] } {
+ set enroll_start $in_a_month_date
+ }
+ if { [empty_string_p $enroll_end] } {
+ set enroll_end $in_two_months_date
+ }
+ if { [empty_string_p $send_start_note_date] } {
+ set send_start_note_date $in_two_and_a_half_months_date
+ }
+ if { [empty_string_p $case_start] } {
+ set case_start $in_three_months_date
+ }
+ if { [empty_string_p $case_end] } {
+ set case_end $in_three_months_date
+ }
+ if { [empty_string_p $enroll_type] } {
+ set enroll_type "closed"
+ }
+ if { [empty_string_p $casting_type] } {
+ set casting_type "auto"
+ }
- set auto_enroll [simulation::template::get_parties -workflow_id $workflow_id -rel_type auto_enroll]
+ if { [string equal $enroll_type "closed"] } {
+ element set_properties simulation enroll_start -widget hidden
+ element set_properties simulation enroll_end -widget hidden
+ }
- # Default values
- if { [empty_string_p $enroll_start] } {
- set enroll_start $in_a_month_date
- }
- if { [empty_string_p $enroll_end] } {
- set enroll_end $in_two_months_date
- }
- if { [empty_string_p $send_start_note_date] } {
- set send_start_note_date $in_two_and_a_half_months_date
- }
- if { [empty_string_p $case_start] } {
- set case_start $in_three_months_date
- }
- if { [empty_string_p $case_end] } {
- set case_end $in_three_months_date
- }
- if { [empty_string_p $enroll_type] } {
- set enroll_type "closed"
- }
- if { [empty_string_p $casting_type] } {
- set casting_type "auto"
- }
+} -on_refresh {
- if { [string equal $enroll_type "closed"] } {
- element set_properties simulation enroll_start -widget hidden
- element set_properties simulation enroll_end -widget hidden
- }
+ if { [string equal $enroll_type "closed"] } {
+ element set_properties simulation enroll_start -widget hidden
+ element set_properties simulation enroll_end -widget hidden
+ } else {
+ element set_properties simulation enroll_start -widget date
+ element set_properties simulation enroll_end -widget date
+ }
- } -on_refresh {
-
- if { [string equal $enroll_type "closed"] } {
- element set_properties simulation enroll_start -widget hidden
- element set_properties simulation enroll_end -widget hidden
- } else {
- element set_properties simulation enroll_start -widget date
- element set_properties simulation enroll_end -widget date
- }
-
- } -on_submit {
- foreach elm { enroll_start enroll_end send_start_note_date case_start case_end enroll_type casting_type auto_enroll } {
- set row($elm) [set $elm]
- }
-
- # TODO: add invite_gropus to list of elements above
-
- simulation::template::edit \
- -workflow_id $workflow_id \
- -array row
-
- wizard forward
+} -on_submit {
+ foreach elm { enroll_start enroll_end send_start_note_date case_start case_end enroll_type casting_type auto_enroll } {
+ set row($elm) [set $elm]
}
+
+ # TODO: add invite_gropus to list of elements above
- wizard submit simulation -buttons { back next }
+ simulation::template::edit \
+ -workflow_id $workflow_id \
+ -array row
+
+ wizard forward
}
-set context [list [list "." "SimInst"] $page_title]
+wizard submit simulation -buttons { back next }
Index: openacs-4/contrib/packages/simulation/www/siminst/simulation-casting-3.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/simulation/www/siminst/Attic/simulation-casting-3.tcl,v
diff -u -r1.10 -r1.11
--- openacs-4/contrib/packages/simulation/www/siminst/simulation-casting-3.tcl 6 Jan 2004 16:04:29 -0000 1.10
+++ openacs-4/contrib/packages/simulation/www/siminst/simulation-casting-3.tcl 6 Jan 2004 18:36:28 -0000 1.11
@@ -20,7 +20,7 @@
foreach role_id [workflow::get_roles -workflow_id $workflow_id] {
set role_${role_id}_pretty_name [workflow::role::get_element -role_id $role_id -element pretty_name]
- lappend form [list parties_${role_id}:text(checkbox),multiple \
+ lappend form [list parties_${role_id}:text(checkbox),multiple,optional \
[list help_text "Only users in these groups can be cast in this role"] \
[list label \$role_${role_id}_pretty_name] \
[list options $eligible_groups]
@@ -76,6 +76,8 @@
-parties [set parties_$role_id] \
}
- ad_returnredirect .
- ad_script_abort
+ wizard forward
}
+
+wizard submit actors -buttons { back next }
+
Fisheye: Tag 1.4 refers to a dead (removed) revision in file `openacs-4/contrib/packages/simulation/www/siminst/simulation-edit.adp'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/contrib/packages/simulation/www/siminst/simulation-edit.tcl'.
Fisheye: No comparison available. Pass `N' to diff?
Index: openacs-4/contrib/packages/simulation/www/siminst/simulation-enrollment.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/simulation/www/siminst/Attic/simulation-enrollment.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/contrib/packages/simulation/www/siminst/simulation-enrollment.adp 6 Jan 2004 18:36:28 -0000 1.1
@@ -0,0 +1,3 @@
+
TODO B: When switching from open enrollment to "by invitation only" and back, the dates are lost -- see if we can avoid that.
Index: openacs-4/contrib/packages/simulation/www/siminst/simulation-enrollment.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/simulation/www/siminst/Attic/simulation-enrollment.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/simulation/www/siminst/simulation-enrollment.tcl 6 Jan 2004 18:36:28 -0000 1.1 @@ -0,0 +1,80 @@ +ad_page_contract { + Create a new simulation +} { + workflow_id:integer +} + +simulation::template::get -workflow_id $workflow_id -array sim_template + +set package_id [ad_conn package_id] + +#subsite::get -array closest_subsite +#set group_admin_url [export_vars -base "${closest_subsite(url)}admin/group-types/one" { { group_type group } }] +#set eligible_groups [simulation::casting_groups -workflow_id $workflow_id] + +ad_form -export { workflow_id } -name simulation -form { + {enroll_type:text(radio) + {label "Enrollment type"} + {options {{"By invitation only" closed} {Open open}}} + {html {onChange "javascript:FormRefresh('simulation');"}} + } + {enroll_start:date,to_sql(ansi),from_sql(ansi),optional + {label "Enrollment start date"} + } + {enroll_end:date,to_sql(ansi),from_sql(ansi),optional + {label "Enrollment end date"} + } +} -on_request { + + foreach elm { + enroll_type + enroll_start + enroll_end + } { + set $elm $sim_template($elm) + } + +# set auto_enroll [simulation::template::get_parties -workflow_id $workflow_id -rel_type auto_enroll] + + # Default values + set one_month [expr 3600*24*31] + + # TODO: provide more sensible default dates? + if { [empty_string_p $enroll_start] } { + set enroll_start [clock format [expr [clock seconds] + 1*$one_month] -format "%Y-%m-%d"] + } + if { [empty_string_p $enroll_end] } { + set enroll_end [clock format [expr [clock seconds] + 2*$one_month] -format "%Y-%m-%d"] + } + if { [empty_string_p $enroll_type] } { + set enroll_type "closed" + } + + if { [string equal $enroll_type "closed"] } { + element set_properties simulation enroll_start -widget hidden + element set_properties simulation enroll_end -widget hidden + } + +} -on_refresh { + + if { [string equal $enroll_type "closed"] } { + element set_properties simulation enroll_start -widget hidden + element set_properties simulation enroll_end -widget hidden + } else { + element set_properties simulation enroll_start -widget date + element set_properties simulation enroll_end -widget date + } + +} -on_submit { + foreach elm { enroll_start enroll_end enroll_type } { + set row($elm) [set $elm] + } + + simulation::template::edit \ + -workflow_id $workflow_id \ + -array row + + wizard forward +} + +wizard submit simulation -buttons { back next } Index: openacs-4/contrib/packages/simulation/www/siminst/simulation-participants.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/simulation/www/siminst/Attic/simulation-participants.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/simulation/www/siminst/simulation-participants.adp 6 Jan 2004 18:36:28 -0000 1.1 @@ -0,0 +1,13 @@ + + +- You have not yet started casting this simulation. -
-- Once you start casting, you can no longer change the roles mapping or task setup. -
- Begin casting now -TODO: implement invitations. -
TODO: When switching from open enrollment to "by invitation only" and back, the dates are lost -- see if we can avoid that. -
TODO: implement invitations. +
TODO: When switching from open enrollment to "by invitation only" and back, the dates are lost -- see if we can avoid that.
Index: openacs-4/packages/simulation/www/siminst/simulation-casting-2.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/siminst/Attic/simulation-casting-2.tcl,v
diff -u -r1.17 -r1.18
--- openacs-4/packages/simulation/www/siminst/simulation-casting-2.tcl 6 Jan 2004 16:26:37 -0000 1.17
+++ openacs-4/packages/simulation/www/siminst/simulation-casting-2.tcl 6 Jan 2004 18:36:28 -0000 1.18
@@ -6,134 +6,124 @@
simulation::template::get -workflow_id $workflow_id -array sim_template
-if { ![string equal $sim_template(sim_type) "casting_sim"] } {
- set page_title "Begin Casting"
- set begin_casting_url [export_vars -base simulation-casting { workflow_id {return_url {[ad_return_url]}} }]
+set package_id [ad_conn package_id]
-} else {
+subsite::get -array closest_subsite
+set group_admin_url "${closest_subsite(url)}admin/group-types/one?group_type=group"
- set page_title "Cast $sim_template(pretty_name)"
- set package_id [ad_conn package_id]
+# TODO: verify that prepopulated values work correctly
- subsite::get -array closest_subsite
- set group_admin_url "${closest_subsite(url)}admin/group-types/one?group_type=group"
+# TODO: provide more sensible default dates?
+# Notification send could be start date minus some parameter
+set in_a_month_date [clock format [expr [clock seconds] + 3600*24*31] -format "%Y-%m-%d"]
+set in_two_months_date [clock format [expr [clock seconds] + 2*3600*24*31] -format "%Y-%m-%d"]
+set in_two_and_a_half_months_date [clock format [expr [clock seconds] + 3*3600*24*31 - 3600*24*15] -format "%Y-%m-%d"]
+set in_three_months_date [clock format [expr [clock seconds] + 3*3600*24*31] -format "%Y-%m-%d"]
+set in_four_months_date [clock format [expr [clock seconds] + 4*3600*24*31] -format "%Y-%m-%d"]
- # TODO: verify that prepopulated values work correctly
+set eligible_groups [simulation::casting_groups -workflow_id $workflow_id]
- # TODO: provide more sensible default dates?
- # Notification send could be start date minus some parameter
- set in_a_month_date [clock format [expr [clock seconds] + 3600*24*31] -format "%Y-%m-%d"]
- set in_two_months_date [clock format [expr [clock seconds] + 2*3600*24*31] -format "%Y-%m-%d"]
- set in_two_and_a_half_months_date [clock format [expr [clock seconds] + 3*3600*24*31 - 3600*24*15] -format "%Y-%m-%d"]
- set in_three_months_date [clock format [expr [clock seconds] + 3*3600*24*31] -format "%Y-%m-%d"]
- set in_four_months_date [clock format [expr [clock seconds] + 4*3600*24*31] -format "%Y-%m-%d"]
+ad_form -export { workflow_id } -name simulation -form {
+ {enroll_type:text(radio)
+ {label "Enrollment type"}
+ {options {{"By invitation only" closed} {Open open}}}
+ {html {onChange "javascript:FormRefresh('simulation');"}}
+ }
+ {enroll_start:date,to_sql(ansi),from_sql(ansi),optional
+ {label "Enrollment start date"}
+ }
+ {enroll_end:date,to_sql(ansi),from_sql(ansi),optional
+ {label "Enrollment end date"}
+ }
+ {send_start_note_date:date,to_sql(ansi),from_sql(ansi),optional
+ {label "Date to send start notification (mockup only)"}
+ }
+ {case_start:date,to_sql(ansi),from_sql(ansi),optional
+ {label "Simulation start date"}
+ }
+ {case_end:date,to_sql(ansi),from_sql(ansi),optional
+ {label "Simulation end date"}
+ }
+ {casting_type:text(radio)
+ {label "Casting type"}
+ {options {{Automatic auto} {Group group} {Open open}}}
+ }
+ {auto_enroll:integer(checkbox),multiple,optional
+ {label "Enroll all users in these groups"}
+ {options $eligible_groups}
+ {help_text {Use Group Administration to add groups}}
+ }
+ {invite_groups:integer(checkbox),multiple,optional
+ {label "Invite all users in these groups (mockup only)"}
+ {options $eligible_groups}
+ {help_text {Use Group Administration to add groups}}
+ }
+} -on_request {
- set eligible_groups [simulation::casting_groups -workflow_id $workflow_id]
+ foreach elm {
+ enroll_type
+ casting_type
+ enroll_start
+ enroll_end
+ case_start
+ case_end
+ send_start_note_date
+ } {
+ set $elm $sim_template($elm)
+ }
- ad_form -export { workflow_id } -name simulation -form {
- {enroll_type:text(radio)
- {label "Enrollment type"}
- {options {{"By invitation only" closed} {Open open}}}
- {html {onChange "javascript:FormRefresh('simulation');"}}
- }
- {enroll_start:date,to_sql(ansi),from_sql(ansi),optional
- {label "Enrollment start date"}
- }
- {enroll_end:date,to_sql(ansi),from_sql(ansi),optional
- {label "Enrollment end date"}
- }
- {send_start_note_date:date,to_sql(ansi),from_sql(ansi),optional
- {label "Date to send start notification (mockup only)"}
- }
- {case_start:date,to_sql(ansi),from_sql(ansi),optional
- {label "Simulation start date"}
- }
- {case_end:date,to_sql(ansi),from_sql(ansi),optional
- {label "Simulation end date"}
- }
- {casting_type:text(radio)
- {label "Casting type"}
- {options {{Automatic auto} {Group group} {Open open}}}
- }
- {auto_enroll:integer(checkbox),multiple,optional
- {label "Enroll all users in these groups"}
- {options $eligible_groups}
- {help_text {Use Group Administration to add groups}}
- }
- {invite_groups:integer(checkbox),multiple,optional
- {label "Invite all users in these groups (mockup only)"}
- {options $eligible_groups}
- {help_text {Use Group Administration to add groups}}
- }
- } -on_request {
+ set auto_enroll [simulation::template::get_parties -workflow_id $workflow_id -rel_type auto_enroll]
- foreach elm {
- enroll_type
- casting_type
- enroll_start
- enroll_end
- case_start
- case_end
- send_start_note_date
- } {
- set $elm $sim_template($elm)
- }
+ # Default values
+ if { [empty_string_p $enroll_start] } {
+ set enroll_start $in_a_month_date
+ }
+ if { [empty_string_p $enroll_end] } {
+ set enroll_end $in_two_months_date
+ }
+ if { [empty_string_p $send_start_note_date] } {
+ set send_start_note_date $in_two_and_a_half_months_date
+ }
+ if { [empty_string_p $case_start] } {
+ set case_start $in_three_months_date
+ }
+ if { [empty_string_p $case_end] } {
+ set case_end $in_three_months_date
+ }
+ if { [empty_string_p $enroll_type] } {
+ set enroll_type "closed"
+ }
+ if { [empty_string_p $casting_type] } {
+ set casting_type "auto"
+ }
- set auto_enroll [simulation::template::get_parties -workflow_id $workflow_id -rel_type auto_enroll]
+ if { [string equal $enroll_type "closed"] } {
+ element set_properties simulation enroll_start -widget hidden
+ element set_properties simulation enroll_end -widget hidden
+ }
- # Default values
- if { [empty_string_p $enroll_start] } {
- set enroll_start $in_a_month_date
- }
- if { [empty_string_p $enroll_end] } {
- set enroll_end $in_two_months_date
- }
- if { [empty_string_p $send_start_note_date] } {
- set send_start_note_date $in_two_and_a_half_months_date
- }
- if { [empty_string_p $case_start] } {
- set case_start $in_three_months_date
- }
- if { [empty_string_p $case_end] } {
- set case_end $in_three_months_date
- }
- if { [empty_string_p $enroll_type] } {
- set enroll_type "closed"
- }
- if { [empty_string_p $casting_type] } {
- set casting_type "auto"
- }
+} -on_refresh {
- if { [string equal $enroll_type "closed"] } {
- element set_properties simulation enroll_start -widget hidden
- element set_properties simulation enroll_end -widget hidden
- }
+ if { [string equal $enroll_type "closed"] } {
+ element set_properties simulation enroll_start -widget hidden
+ element set_properties simulation enroll_end -widget hidden
+ } else {
+ element set_properties simulation enroll_start -widget date
+ element set_properties simulation enroll_end -widget date
+ }
- } -on_refresh {
-
- if { [string equal $enroll_type "closed"] } {
- element set_properties simulation enroll_start -widget hidden
- element set_properties simulation enroll_end -widget hidden
- } else {
- element set_properties simulation enroll_start -widget date
- element set_properties simulation enroll_end -widget date
- }
-
- } -on_submit {
- foreach elm { enroll_start enroll_end send_start_note_date case_start case_end enroll_type casting_type auto_enroll } {
- set row($elm) [set $elm]
- }
-
- # TODO: add invite_gropus to list of elements above
-
- simulation::template::edit \
- -workflow_id $workflow_id \
- -array row
-
- wizard forward
+} -on_submit {
+ foreach elm { enroll_start enroll_end send_start_note_date case_start case_end enroll_type casting_type auto_enroll } {
+ set row($elm) [set $elm]
}
+
+ # TODO: add invite_gropus to list of elements above
- wizard submit simulation -buttons { back next }
+ simulation::template::edit \
+ -workflow_id $workflow_id \
+ -array row
+
+ wizard forward
}
-set context [list [list "." "SimInst"] $page_title]
+wizard submit simulation -buttons { back next }
Index: openacs-4/packages/simulation/www/siminst/simulation-casting-3.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/siminst/simulation-casting-3.tcl,v
diff -u -r1.10 -r1.11
--- openacs-4/packages/simulation/www/siminst/simulation-casting-3.tcl 6 Jan 2004 16:04:29 -0000 1.10
+++ openacs-4/packages/simulation/www/siminst/simulation-casting-3.tcl 6 Jan 2004 18:36:28 -0000 1.11
@@ -20,7 +20,7 @@
foreach role_id [workflow::get_roles -workflow_id $workflow_id] {
set role_${role_id}_pretty_name [workflow::role::get_element -role_id $role_id -element pretty_name]
- lappend form [list parties_${role_id}:text(checkbox),multiple \
+ lappend form [list parties_${role_id}:text(checkbox),multiple,optional \
[list help_text "Only users in these groups can be cast in this role"] \
[list label \$role_${role_id}_pretty_name] \
[list options $eligible_groups]
@@ -76,6 +76,8 @@
-parties [set parties_$role_id] \
}
- ad_returnredirect .
- ad_script_abort
+ wizard forward
}
+
+wizard submit actors -buttons { back next }
+
Fisheye: Tag 1.4 refers to a dead (removed) revision in file `openacs-4/packages/simulation/www/siminst/simulation-edit.adp'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/packages/simulation/www/siminst/simulation-edit.tcl'.
Fisheye: No comparison available. Pass `N' to diff?
Index: openacs-4/packages/simulation/www/siminst/simulation-enrollment.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/siminst/Attic/simulation-enrollment.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/simulation/www/siminst/simulation-enrollment.adp 6 Jan 2004 18:36:28 -0000 1.1
@@ -0,0 +1,3 @@
+
TODO B: When switching from open enrollment to "by invitation only" and back, the dates are lost -- see if we can avoid that.
Index: openacs-4/packages/simulation/www/siminst/simulation-enrollment.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/siminst/Attic/simulation-enrollment.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/simulation/www/siminst/simulation-enrollment.tcl 6 Jan 2004 18:36:28 -0000 1.1 @@ -0,0 +1,80 @@ +ad_page_contract { + Create a new simulation +} { + workflow_id:integer +} + +simulation::template::get -workflow_id $workflow_id -array sim_template + +set package_id [ad_conn package_id] + +#subsite::get -array closest_subsite +#set group_admin_url [export_vars -base "${closest_subsite(url)}admin/group-types/one" { { group_type group } }] +#set eligible_groups [simulation::casting_groups -workflow_id $workflow_id] + +ad_form -export { workflow_id } -name simulation -form { + {enroll_type:text(radio) + {label "Enrollment type"} + {options {{"By invitation only" closed} {Open open}}} + {html {onChange "javascript:FormRefresh('simulation');"}} + } + {enroll_start:date,to_sql(ansi),from_sql(ansi),optional + {label "Enrollment start date"} + } + {enroll_end:date,to_sql(ansi),from_sql(ansi),optional + {label "Enrollment end date"} + } +} -on_request { + + foreach elm { + enroll_type + enroll_start + enroll_end + } { + set $elm $sim_template($elm) + } + +# set auto_enroll [simulation::template::get_parties -workflow_id $workflow_id -rel_type auto_enroll] + + # Default values + set one_month [expr 3600*24*31] + + # TODO: provide more sensible default dates? + if { [empty_string_p $enroll_start] } { + set enroll_start [clock format [expr [clock seconds] + 1*$one_month] -format "%Y-%m-%d"] + } + if { [empty_string_p $enroll_end] } { + set enroll_end [clock format [expr [clock seconds] + 2*$one_month] -format "%Y-%m-%d"] + } + if { [empty_string_p $enroll_type] } { + set enroll_type "closed" + } + + if { [string equal $enroll_type "closed"] } { + element set_properties simulation enroll_start -widget hidden + element set_properties simulation enroll_end -widget hidden + } + +} -on_refresh { + + if { [string equal $enroll_type "closed"] } { + element set_properties simulation enroll_start -widget hidden + element set_properties simulation enroll_end -widget hidden + } else { + element set_properties simulation enroll_start -widget date + element set_properties simulation enroll_end -widget date + } + +} -on_submit { + foreach elm { enroll_start enroll_end enroll_type } { + set row($elm) [set $elm] + } + + simulation::template::edit \ + -workflow_id $workflow_id \ + -array row + + wizard forward +} + +wizard submit simulation -buttons { back next } Index: openacs-4/packages/simulation/www/siminst/simulation-participants.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/siminst/simulation-participants.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/simulation/www/siminst/simulation-participants.adp 6 Jan 2004 18:36:28 -0000 1.1 @@ -0,0 +1,13 @@ + + +