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.5 -r1.6 --- openacs-4/packages/simulation/www/siminst/simulation-casting-2.tcl 15 Dec 2003 14:50:12 -0000 1.5 +++ openacs-4/packages/simulation/www/siminst/simulation-casting-2.tcl 16 Dec 2003 11:34:33 -0000 1.6 @@ -10,12 +10,9 @@ set context [list [list "." "SimInst"] $page_title] set package_id [ad_conn package_id] +subsite::get -array closest_subsite +set group_admin_url "${closest_subsite(url)}admin/group-types/one?group_type=group" -# TODO: only one aplication group per package - need different solution -set group_id [application_group::group_id_from_package_id -package_id $package_id] -set group_name [group::get_element -group_id $group_id -element group_name] -set group_options [list [list $group_name $group_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"] @@ -47,20 +44,28 @@ } {enroll_type:text(radio) {label "Enrollment type"} - {options {{Invite invite} {Open open}}} + {options {{"By invitation only" closed} {Open open}}} {value $sim_template(enroll_type)} } {casting_type:text(radio) {label "Casting type"} {options {{Automatic auto} {Group group} {Open open}}} {value $sim_template(casting_type)} } - {user_group:integer(checkbox),multiple,optional + {enroll_groups:integer(checkbox),multiple,optional + {label "Enroll all users in these groups"} + {options {[simulation::groups_eligible_for_casting]}} + {help_text {Use Group Administration to add groups}} + } + {invite_groups:integer(checkbox),multiple,optional {label "Invite all users in these groups"} - {options $group_options} - #TODO: this link should use a function to find the subsite path - {help_text {Use Group Administration to add groups}} + {options {[simulation::groups_eligible_for_casting]}} + {help_text {Use Group Administration to add groups}} } +} -on_request { + + set enroll_groups [simulation::template::get_parties -workflow_id $workflow_id -rel_type auto-enroll] + } -on_submit { # Convert dates to ANSI format foreach var_name {enroll_start enroll_end notification_date case_start case_end} { @@ -75,7 +80,8 @@ set sim_template(case_end) $case_end_ansi set sim_template(enroll_type) $enroll_type set sim_template(casting_type) $casting_type - set sim_template(parties $user_group + set sim_template(enroll_groups) $enroll_groups + set sim_template(invite_gropus) $invite_groups simulation::template::edit \ -workflow_id $workflow_id \