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 -N -r1.55 -r1.56 --- openacs-4/contrib/packages/simulation/tcl/template-procs.tcl 20 Jan 2004 12:41:03 -0000 1.55 +++ openacs-4/contrib/packages/simulation/tcl/template-procs.tcl 20 Jan 2004 14:11:21 -0000 1.56 @@ -176,13 +176,14 @@ # Update sim_party_sim_map table foreach map_type { enrolled invited auto_enroll } { if { [info exists aux($map_type)] } { - # Clear out old mappings first - db_dml clear_old_mappings { - delete from sim_party_sim_map - where simulation_id = :workflow_id - and type = :map_type + # Clear out old mappings first if we are updating + if { [string equal $operation "update"] } { + db_dml clear_old_mappings { + delete from sim_party_sim_map + where simulation_id = :workflow_id + and type = :map_type + } } - # Map each party foreach party_id $aux($map_type) { db_dml map_party_to_template { @@ -900,7 +901,7 @@ lappend assignees $user_id # Remove user from the not-in-group list - set users_to_cast_not_in_groups [lreplace $users_to_cast_not_in_gruops 0 0] + set users_to_cast_not_in_groups [lreplace $users_to_cast_not_in_groups 0 0] # Remove the user from the users_to_cast list set cast_list_index [lsearch -exact $users_to_cast $user_id] @@ -924,7 +925,6 @@ workflow::case::role::assign \ -case_id $case_id \ -array row \ - -replace } @@ -1290,9 +1290,11 @@ return [db_string user_invited_p { select count(*) - from sim_party_sim_map - where simulation_id = :workflow_id - and party_id = :user_id - and type = 'invited' + from sim_party_sim_map spsm, + party_approved_member_map pamm + where spsm.simulation_id = :workflow_id + and spsm.type = 'invited' + and spsm.party_id = pamm.party_id + and pamm.member_id = :user_id }] } Index: openacs-4/contrib/packages/simulation/www/simulation-master.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/simulation/www/Attic/simulation-master.tcl,v diff -u -N -r1.11 -r1.12 --- openacs-4/contrib/packages/simulation/www/simulation-master.tcl 16 Jan 2004 15:44:52 -0000 1.11 +++ openacs-4/contrib/packages/simulation/www/simulation-master.tcl 20 Jan 2004 14:11:21 -0000 1.12 @@ -62,6 +62,9 @@ # Build a link bar for the subsite # ###################################################################### +if { ![info exists header_stuff] } { + set header_stuff {} +} if { !$citybuild_p && !$simbuild_p && !$siminst_p && !$admin_p } { set subnavbar_link {} @@ -78,10 +81,6 @@ lappend subnavbar_list [list "${base_url}siminst" "SimInst"] } - if { ![info exists header_stuff] } { - set header_stuff {} - } - lappend subnavbar_list [list "${base_url}simplay" "SimPlay"] if { $admin_p } { 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 -N -r1.12 -r1.13 --- openacs-4/contrib/packages/simulation/www/siminst/simulation-edit.tcl 19 Jan 2004 17:10:32 -0000 1.12 +++ openacs-4/contrib/packages/simulation/www/siminst/simulation-edit.tcl 20 Jan 2004 14:11:21 -0000 1.13 @@ -98,8 +98,9 @@ if { [string equal $enroll_type "open"] } { lappend dates_to_check enroll_start enroll_end } + set now_ansi [clock format [clock seconds] -format "%Y-%m-%d"] foreach date_var $dates_to_check { - if { [clock scan [set $date_var]] < [clock seconds] } { + if { [clock scan [set $date_var]] < [clock scan $now_ansi] } { template::form::set_error simulation $date_var "The date needs to be in the future" set error_p 1 } 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 -N -r1.9 -r1.10 --- openacs-4/contrib/packages/simulation/www/siminst/simulation-participants.adp 12 Jan 2004 15:44:46 -0000 1.9 +++ openacs-4/contrib/packages/simulation/www/siminst/simulation-participants.adp 20 Jan 2004 14:11:21 -0000 1.10 @@ -5,7 +5,7 @@ Manage groups

- Auto-Enroll takes effect, and invitations are sent, + Invitations are sent, when this wizard is completed and casting begins.

Index: openacs-4/contrib/packages/simulation/www/simplay/enroll.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/simulation/www/simplay/Attic/enroll.tcl,v diff -u -N -r1.5 -r1.6 --- openacs-4/contrib/packages/simulation/www/simplay/enroll.tcl 19 Jan 2004 17:10:32 -0000 1.5 +++ openacs-4/contrib/packages/simulation/www/simplay/enroll.tcl 20 Jan 2004 14:11:21 -0000 1.6 @@ -43,8 +43,13 @@ } # The user is allowed to enroll, so enroll him -set simulation_edit(enrolled) $user_id -simulation::template::edit -workflow_id $workflow_id -array simulation_edit +# Not using edit proc here as it deletes currently enrolled users +db_dml enroll_user { + insert into sim_party_sim_map + (simulation_id, party_id, type) + values + (:workflow_id, :user_id, 'enrolled') +} # If there are casting decisions open to the user, redirect to the casting page (casting_type group or open) if { [string equal $simulation(casting_type) "auto"] } { Index: openacs-4/packages/simulation/tcl/template-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/tcl/template-procs.tcl,v diff -u -N -r1.55 -r1.56 --- openacs-4/packages/simulation/tcl/template-procs.tcl 20 Jan 2004 12:41:03 -0000 1.55 +++ openacs-4/packages/simulation/tcl/template-procs.tcl 20 Jan 2004 14:11:21 -0000 1.56 @@ -176,13 +176,14 @@ # Update sim_party_sim_map table foreach map_type { enrolled invited auto_enroll } { if { [info exists aux($map_type)] } { - # Clear out old mappings first - db_dml clear_old_mappings { - delete from sim_party_sim_map - where simulation_id = :workflow_id - and type = :map_type + # Clear out old mappings first if we are updating + if { [string equal $operation "update"] } { + db_dml clear_old_mappings { + delete from sim_party_sim_map + where simulation_id = :workflow_id + and type = :map_type + } } - # Map each party foreach party_id $aux($map_type) { db_dml map_party_to_template { @@ -900,7 +901,7 @@ lappend assignees $user_id # Remove user from the not-in-group list - set users_to_cast_not_in_groups [lreplace $users_to_cast_not_in_gruops 0 0] + set users_to_cast_not_in_groups [lreplace $users_to_cast_not_in_groups 0 0] # Remove the user from the users_to_cast list set cast_list_index [lsearch -exact $users_to_cast $user_id] @@ -924,7 +925,6 @@ workflow::case::role::assign \ -case_id $case_id \ -array row \ - -replace } @@ -1290,9 +1290,11 @@ return [db_string user_invited_p { select count(*) - from sim_party_sim_map - where simulation_id = :workflow_id - and party_id = :user_id - and type = 'invited' + from sim_party_sim_map spsm, + party_approved_member_map pamm + where spsm.simulation_id = :workflow_id + and spsm.type = 'invited' + and spsm.party_id = pamm.party_id + and pamm.member_id = :user_id }] } Index: openacs-4/packages/simulation/www/simulation-master.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/simulation-master.tcl,v diff -u -N -r1.11 -r1.12 --- openacs-4/packages/simulation/www/simulation-master.tcl 16 Jan 2004 15:44:52 -0000 1.11 +++ openacs-4/packages/simulation/www/simulation-master.tcl 20 Jan 2004 14:11:21 -0000 1.12 @@ -62,6 +62,9 @@ # Build a link bar for the subsite # ###################################################################### +if { ![info exists header_stuff] } { + set header_stuff {} +} if { !$citybuild_p && !$simbuild_p && !$siminst_p && !$admin_p } { set subnavbar_link {} @@ -78,10 +81,6 @@ lappend subnavbar_list [list "${base_url}siminst" "SimInst"] } - if { ![info exists header_stuff] } { - set header_stuff {} - } - lappend subnavbar_list [list "${base_url}simplay" "SimPlay"] if { $admin_p } { 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 -N -r1.12 -r1.13 --- openacs-4/packages/simulation/www/siminst/simulation-edit.tcl 19 Jan 2004 17:10:32 -0000 1.12 +++ openacs-4/packages/simulation/www/siminst/simulation-edit.tcl 20 Jan 2004 14:11:21 -0000 1.13 @@ -98,8 +98,9 @@ if { [string equal $enroll_type "open"] } { lappend dates_to_check enroll_start enroll_end } + set now_ansi [clock format [clock seconds] -format "%Y-%m-%d"] foreach date_var $dates_to_check { - if { [clock scan [set $date_var]] < [clock seconds] } { + if { [clock scan [set $date_var]] < [clock scan $now_ansi] } { template::form::set_error simulation $date_var "The date needs to be in the future" set error_p 1 } 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 -N -r1.9 -r1.10 --- openacs-4/packages/simulation/www/siminst/simulation-participants.adp 12 Jan 2004 15:44:46 -0000 1.9 +++ openacs-4/packages/simulation/www/siminst/simulation-participants.adp 20 Jan 2004 14:11:21 -0000 1.10 @@ -5,7 +5,7 @@ Manage groups

- Auto-Enroll takes effect, and invitations are sent, + Invitations are sent, when this wizard is completed and casting begins.

Index: openacs-4/packages/simulation/www/simplay/enroll.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/simplay/enroll.tcl,v diff -u -N -r1.5 -r1.6 --- openacs-4/packages/simulation/www/simplay/enroll.tcl 19 Jan 2004 17:10:32 -0000 1.5 +++ openacs-4/packages/simulation/www/simplay/enroll.tcl 20 Jan 2004 14:11:21 -0000 1.6 @@ -43,8 +43,13 @@ } # The user is allowed to enroll, so enroll him -set simulation_edit(enrolled) $user_id -simulation::template::edit -workflow_id $workflow_id -array simulation_edit +# Not using edit proc here as it deletes currently enrolled users +db_dml enroll_user { + insert into sim_party_sim_map + (simulation_id, party_id, type) + values + (:workflow_id, :user_id, 'enrolled') +} # If there are casting decisions open to the user, redirect to the casting page (casting_type group or open) if { [string equal $simulation(casting_type) "auto"] } {