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.54 -r1.55 --- openacs-4/contrib/packages/simulation/tcl/template-procs.tcl 20 Jan 2004 09:41:26 -0000 1.54 +++ openacs-4/contrib/packages/simulation/tcl/template-procs.tcl 20 Jan 2004 12:41:03 -0000 1.55 @@ -709,8 +709,8 @@ } { # Get the list of all enrolled and uncast users set users_to_cast [db_list users_to_cast { - select distinct spsm.party_id, - from sim_party_sim_map spsm, + select distinct spsm.party_id + from sim_party_sim_map spsm where spsm.simulation_id = :workflow_id and spsm.type = 'enrolled' and not exists (select 1 @@ -725,8 +725,8 @@ # Get the subset of enrolled and uncast users that are not in any of # the role groups set users_to_cast_not_in_groups [db_list users_to_cast_not_in_groups { - select distinct spsm.party_id, - from sim_party_sim_map spsm, + select distinct spsm.party_id + from sim_party_sim_map spsm where spsm.simulation_id = :workflow_id and spsm.type = 'enrolled' and not exists (select 1 @@ -779,8 +779,8 @@ # First do user-role assignments in any existing simulation cases set current_cases [db_list select_current_cases { - select wc.case_id, - from workflow_cases wc, + select wc.case_id + from workflow_cases wc where wc.workflow_id = :workflow_id }] foreach case_id $current_cases { @@ -790,7 +790,7 @@ -role_names_array role_short_name \ -groups_array group_members \ -users_var users_to_cast \ - -users_var_not_in_groups users_to_cast_not_in_groups + -users_not_in_groups_var users_to_cast_not_in_groups } # If there are users left to cast, create new cases for them and repeat the same @@ -814,7 +814,7 @@ -role_names_array role_short_name \ -groups_array group_members \ -users_var users_to_cast \ - -users_var_not_in_groups users_to_cast_not_in_groups + -users_not_in_groups_var users_to_cast_not_in_groups } } @@ -886,9 +886,9 @@ # Remove the user from the group member list set group_members($group_id) [lreplace $group_members($group_id) 0 0] - # Remove the user from the users_to_cast_list - set cast_list_index [lsearch -exact $users_to_cast_list $user_id] - set users_to_cast [lreplace $user_to_cast $cast_list_index $cast_list_index] + # Remove the user from the users_to_cast list + set cast_list_index [lsearch -exact $users_to_cast $user_id] + set users_to_cast [lreplace $users_to_cast $cast_list_index $cast_list_index] } else { # There is no group mapped to the role with a user that hasn't been cast @@ -902,9 +902,9 @@ # Remove user from the not-in-group list set users_to_cast_not_in_groups [lreplace $users_to_cast_not_in_gruops 0 0] - # Remove the user from the users_to_cast_list - set cast_list_index [lsearch -exact $users_to_cast_list $user_id] - set users_to_cast [lreplace $user_to_cast $cast_list_index $cast_list_index] + # Remove the user from the users_to_cast list + set cast_list_index [lsearch -exact $users_to_cast $user_id] + set users_to_cast [lreplace $users_to_cast $cast_list_index $cast_list_index] } else { # No more users to cast, resort to the logged in user (admin) 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.17 -r1.18 --- openacs-4/contrib/packages/simulation/www/siminst/simulation-casting-3.adp 14 Jan 2004 10:18:10 -0000 1.17 +++ openacs-4/contrib/packages/simulation/www/siminst/simulation-casting-3.adp 20 Jan 2004 12:41:03 -0000 1.18 @@ -19,32 +19,6 @@
-In Automatic casting, only - - users from these groups will be assigned to the roles. All user - - from all selected groups will be cast. If all users for one rol - - are cast before all users for another role are cast, you will b - - cast as many times as needed to fill out the cases. (You ca - - change casting assignments here. - -
In Group casting, users can choose which case to join - - Users are still restricted by group/role limits set below (e.g. - - if each case requires three users from group X and two from grou - - Y, the fourth user from group X to try to join will b - - rejected.). - -
In Open casting, users can choose which case and role t - - join, subject to the restrictions below -
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.21 -r1.22 --- openacs-4/contrib/packages/simulation/www/siminst/simulation-casting-3.tcl 14 Jan 2004 15:10:54 -0000 1.21 +++ openacs-4/contrib/packages/simulation/www/siminst/simulation-casting-3.tcl 20 Jan 2004 12:41:03 -0000 1.22 @@ -148,7 +148,10 @@ } } - set uncast_mapped_groups [db_list uncast_mapped_groups_count " + if { [string equal $sim_template(enroll_type) "closed"] || [empty_string_p $sim_template(enroll_type)] } { + # In closed enrollment we require the admin to map all groups to roles + + set uncast_mapped_groups [db_list uncast_mapped_groups_count " select g.group_name from sim_party_sim_map spsm, groups g @@ -162,9 +165,10 @@ and srpm.party_id = spsm.party_id ) "] - if { [llength $uncast_mapped_groups] > 0 } { - template::form::set_error actors parties_$role_id "The following groups are not mapped to any roles: [join $uncast_mapped_groups ", "]." - break + if { [llength $uncast_mapped_groups] > 0 } { + template::form::set_error actors parties_$role_id "The following groups are not mapped to any roles: [join $uncast_mapped_groups ", "]." + break + } } simulation::template::enroll_and_invite_users -workflow_id $workflow_id 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 -r1.54 -r1.55 --- openacs-4/packages/simulation/tcl/template-procs.tcl 20 Jan 2004 09:41:26 -0000 1.54 +++ openacs-4/packages/simulation/tcl/template-procs.tcl 20 Jan 2004 12:41:03 -0000 1.55 @@ -709,8 +709,8 @@ } { # Get the list of all enrolled and uncast users set users_to_cast [db_list users_to_cast { - select distinct spsm.party_id, - from sim_party_sim_map spsm, + select distinct spsm.party_id + from sim_party_sim_map spsm where spsm.simulation_id = :workflow_id and spsm.type = 'enrolled' and not exists (select 1 @@ -725,8 +725,8 @@ # Get the subset of enrolled and uncast users that are not in any of # the role groups set users_to_cast_not_in_groups [db_list users_to_cast_not_in_groups { - select distinct spsm.party_id, - from sim_party_sim_map spsm, + select distinct spsm.party_id + from sim_party_sim_map spsm where spsm.simulation_id = :workflow_id and spsm.type = 'enrolled' and not exists (select 1 @@ -779,8 +779,8 @@ # First do user-role assignments in any existing simulation cases set current_cases [db_list select_current_cases { - select wc.case_id, - from workflow_cases wc, + select wc.case_id + from workflow_cases wc where wc.workflow_id = :workflow_id }] foreach case_id $current_cases { @@ -790,7 +790,7 @@ -role_names_array role_short_name \ -groups_array group_members \ -users_var users_to_cast \ - -users_var_not_in_groups users_to_cast_not_in_groups + -users_not_in_groups_var users_to_cast_not_in_groups } # If there are users left to cast, create new cases for them and repeat the same @@ -814,7 +814,7 @@ -role_names_array role_short_name \ -groups_array group_members \ -users_var users_to_cast \ - -users_var_not_in_groups users_to_cast_not_in_groups + -users_not_in_groups_var users_to_cast_not_in_groups } } @@ -886,9 +886,9 @@ # Remove the user from the group member list set group_members($group_id) [lreplace $group_members($group_id) 0 0] - # Remove the user from the users_to_cast_list - set cast_list_index [lsearch -exact $users_to_cast_list $user_id] - set users_to_cast [lreplace $user_to_cast $cast_list_index $cast_list_index] + # Remove the user from the users_to_cast list + set cast_list_index [lsearch -exact $users_to_cast $user_id] + set users_to_cast [lreplace $users_to_cast $cast_list_index $cast_list_index] } else { # There is no group mapped to the role with a user that hasn't been cast @@ -902,9 +902,9 @@ # Remove user from the not-in-group list set users_to_cast_not_in_groups [lreplace $users_to_cast_not_in_gruops 0 0] - # Remove the user from the users_to_cast_list - set cast_list_index [lsearch -exact $users_to_cast_list $user_id] - set users_to_cast [lreplace $user_to_cast $cast_list_index $cast_list_index] + # Remove the user from the users_to_cast list + set cast_list_index [lsearch -exact $users_to_cast $user_id] + set users_to_cast [lreplace $users_to_cast $cast_list_index $cast_list_index] } else { # No more users to cast, resort to the logged in user (admin) 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.17 -r1.18 --- openacs-4/packages/simulation/www/siminst/simulation-casting-3.adp 14 Jan 2004 10:18:10 -0000 1.17 +++ openacs-4/packages/simulation/www/siminst/simulation-casting-3.adp 20 Jan 2004 12:41:03 -0000 1.18 @@ -19,32 +19,6 @@
-In Automatic casting, only - - users from these groups will be assigned to the roles. All user - - from all selected groups will be cast. If all users for one rol - - are cast before all users for another role are cast, you will b - - cast as many times as needed to fill out the cases. (You ca - - change casting assignments here. - -
In Group casting, users can choose which case to join - - Users are still restricted by group/role limits set below (e.g. - - if each case requires three users from group X and two from grou - - Y, the fourth user from group X to try to join will b - - rejected.). - -
In Open casting, users can choose which case and role t - - join, subject to the restrictions below -
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.21 -r1.22 --- openacs-4/packages/simulation/www/siminst/simulation-casting-3.tcl 14 Jan 2004 15:10:54 -0000 1.21 +++ openacs-4/packages/simulation/www/siminst/simulation-casting-3.tcl 20 Jan 2004 12:41:03 -0000 1.22 @@ -148,7 +148,10 @@ } } - set uncast_mapped_groups [db_list uncast_mapped_groups_count " + if { [string equal $sim_template(enroll_type) "closed"] || [empty_string_p $sim_template(enroll_type)] } { + # In closed enrollment we require the admin to map all groups to roles + + set uncast_mapped_groups [db_list uncast_mapped_groups_count " select g.group_name from sim_party_sim_map spsm, groups g @@ -162,9 +165,10 @@ and srpm.party_id = spsm.party_id ) "] - if { [llength $uncast_mapped_groups] > 0 } { - template::form::set_error actors parties_$role_id "The following groups are not mapped to any roles: [join $uncast_mapped_groups ", "]." - break + if { [llength $uncast_mapped_groups] > 0 } { + template::form::set_error actors parties_$role_id "The following groups are not mapped to any roles: [join $uncast_mapped_groups ", "]." + break + } } simulation::template::enroll_and_invite_users -workflow_id $workflow_id