version 1.52, 2006/07/17 15:07:26
|
version 1.56, 2006/07/21 02:46:51
|
Line 91 sub handler {
|
Line 91 sub handler {
|
|
|
my $action = $env{'form.action'}; |
my $action = $env{'form.action'}; |
my $state = $env{'form.state'}; |
my $state = $env{'form.state'}; |
if ((!defined($action)) || ($action eq 'view')) { |
if ((!defined($action)) || ($action eq 'view') || ($action eq 'modify')) { |
if (!defined($state)) { |
if (!defined($state)) { |
$state = 'view'; |
$state = 'view'; |
} |
} |
} |
} |
if ($action eq 'create' || $action eq 'modify' || $action eq 'view') { |
if ($action eq 'create' || $action eq 'modify' || $action eq 'view') { |
if ($view_permission || $manage_permission) { |
if ($view_permission || $manage_permission) { |
&group_administration($r,$action,$state,$cdom,$cnum, |
if ($state eq 'view') { |
\%functions,\%idx,$view_permission, |
&print_main_menu($r,$cdom,$cnum,\%functions,\%idx, |
$manage_permission,$gpterm,$ucgpterm, |
$view_permission,$manage_permission, |
$crstype); |
$action,$state,$gpterm,$ucgpterm,$crstype); |
|
} else { |
|
&group_administration($r,$action,$state,$cdom,$cnum, |
|
\%functions,\%idx,$view_permission, |
|
$manage_permission,$gpterm,$ucgpterm, |
|
$crstype); |
|
} |
} else { |
} else { |
$r->print(&mt('You do not have [_1] administration '. |
$r->print(&mt('You do not have [_1] administration '. |
'privileges in this [_2]',$gpterm,lc($crstype))); |
'privileges in this [_2]',$gpterm,lc($crstype))); |
Line 117 sub handler {
|
Line 123 sub handler {
|
sub print_main_menu { |
sub print_main_menu { |
my ($r,$cdom,$cnum,$functions,$idx,$view_permission,$manage_permission, |
my ($r,$cdom,$cnum,$functions,$idx,$view_permission,$manage_permission, |
$action,$state,$gpterm,$ucgpterm,$crstype) = @_; |
$action,$state,$gpterm,$ucgpterm,$crstype) = @_; |
my $pagename = "$crstype $ucgpterm".'s'; |
|
my $jscript = qq| |
my $jscript = qq| |
function changeSort(caller) { |
function changeSort(caller) { |
document.$state.sortby.value = caller; |
document.$state.sortby.value = caller; |
document.$state.submit(); |
document.$state.submit(); |
}\n|; |
}\n|; |
$r->print(&header($pagename,$jscript,$action,$state)); |
$r->print(&header('Groups',$jscript,$action,$state)); |
|
if ($env{'form.refpage'} eq 'enrl') { |
|
&Apache::lonhtmlcommon::add_breadcrumb |
|
({href=>"/adm/dropadd", |
|
text=>"Enrollment Manager"}); |
|
} |
&Apache::lonhtmlcommon::add_breadcrumb |
&Apache::lonhtmlcommon::add_breadcrumb |
({href=>"/adm/coursegroups", |
({href=>"/adm/coursegroups", |
text=>"$pagename"}); |
text=>"Groups"}); |
$r->print(&Apache::lonhtmlcommon::breadcrumbs($pagename)); |
$r->print(&Apache::lonhtmlcommon::breadcrumbs('Groups')); |
&display_groups($r,$cdom,$cnum,$functions,$idx,$view_permission, |
&display_groups($r,$cdom,$cnum,$functions,$idx,$view_permission, |
$manage_permission,$action,$state,$gpterm,$ucgpterm, |
$manage_permission,$action,$state,$gpterm,$ucgpterm, |
$crstype); |
$crstype); |
Line 142 sub display_groups {
|
Line 152 sub display_groups {
|
my %grp_info = (); |
my %grp_info = (); |
my %actionlinks = ( |
my %actionlinks = ( |
modify => '<a href="/adm/coursegroups?action=modify&refpage='. |
modify => '<a href="/adm/coursegroups?action=modify&refpage='. |
$env{'form.refpage'}.'&groupname=', |
$env{'form.refpage'}.'&state=pick_task&groupname=', |
view => '<a href="/adm/'.$cdom.'/'.$cnum.'/', |
view => '<a href="/adm/'.$cdom.'/'.$cnum.'/', |
delete => '<a href="/adm/coursegroups?action=delete&refpage='. |
delete => '<a href="/adm/coursegroups?action=delete&refpage='. |
$env{'form.refpage'}.'&groupname=', |
$env{'form.refpage'}.'&groupname=', |
Line 152 sub display_groups {
|
Line 162 sub display_groups {
|
view => 'View', |
view => 'View', |
delete => 'Delete', |
delete => 'Delete', |
act => 'Action', |
act => 'Action', |
gname => "$ucgpterm Name", |
gname => 'Group Name', |
desc => 'Description', |
desc => 'Group Title', |
crea => 'Creator', |
crea => 'Creator', |
crtd => 'Created', |
crtd => 'Created', |
last => 'Last Modified', |
last => 'Last Modified', |
func => 'Functionality', |
func => 'Collaborative Tools', |
quot => 'Quota (Mb)', |
quot => 'Quota (Mb)', |
memb => 'Members', |
memb => 'Members', |
file => 'Files', |
file => 'Files', |
dibd => 'Discussion Boards', |
dibd => 'Discussion Boards', |
dius => 'Disk Use (%)', |
dius => 'Disk Use (%)', |
nogr => 'No '.$gpterm.'s exist.', |
nogr => 'No groups exist.', |
crng => 'Create a new '.$gpterm, |
crng => 'Create a new group', |
alth => 'Although your current role has privileges'. |
alth => 'Although your current role has privileges'. |
' to view any existing '.$gpterm.'s in this'. |
' to view any existing groups in this'. |
lc($crstype).', you do not have privileges'. |
lc($crstype).', you do not have privileges'. |
'to create new '.$gpterm.'s.', |
'to create new groups.', |
); |
); |
if ($view_permission) { |
if ($view_permission) { |
if (!defined($action)) { |
if (!defined($action)) { |
Line 177 sub display_groups {
|
Line 187 sub display_groups {
|
my %curr_groups = &Apache::longroup::coursegroups($cdom,$cnum); |
my %curr_groups = &Apache::longroup::coursegroups($cdom,$cnum); |
if (%curr_groups) { |
if (%curr_groups) { |
if ($manage_permission) { |
if ($manage_permission) { |
$r->print('<br /><a href="/adm/coursegroups?action=create&refpage='.$env{'form.refpage'}.'">'.$lt{'crng'}.'</a>'); |
if (!exists($env{'form.refpage'})) { |
|
$r->print('<br /><a href="/adm/coursegroups?action=create">'.$lt{'crng'}.'</a>'); |
|
} |
} |
} |
$r->print('<br /><br />'); |
$r->print('<br /><br />'); |
$r->print(&Apache::loncommon::start_data_table(). |
$r->print(&Apache::loncommon::start_data_table(). |
Line 274 END
|
Line 286 END
|
$link .= $group; |
$link .= $group; |
} else { |
} else { |
$link .= $group.'/smppg?ref=grouplist'; |
$link .= $group.'/smppg?ref=grouplist'; |
|
if (exists($env{'form.refpage'})) { |
|
$link .= '&refpage='.$env{'form.refpage'}; |
|
} |
} |
} |
$link .= '">'.$lt{$action}.'</a>'; |
$link .= '">'.$lt{$action}.'</a>'; |
if ($action eq 'view') { |
if ($action eq 'view') { |
Line 312 END
|
Line 327 END
|
} else { |
} else { |
$r->print($lt{'nogr'}); |
$r->print($lt{'nogr'}); |
if ($manage_permission) { |
if ($manage_permission) { |
$r->print('<br /><br /><a href="/adm/coursegroups?action=create&refpage='.$env{'form.refpage'}.'">'.$lt{'crng'}.'</a>'); |
if (!exists($env{'form.refpage'})) { |
|
$r->print('<br /><br /><a href="/adm/coursegroups?action=create">'.$lt{'crng'}.'</a>'); |
|
} |
} else { |
} else { |
$r->print('<br /><br />'.$lt{'alth'}); |
$r->print('<br /><br />'.$lt{'alth'}); |
|
|
Line 349 sub group_administration {
|
Line 366 sub group_administration {
|
my @types = (); |
my @types = (); |
my @roles = (); |
my @roles = (); |
my @sections = (); |
my @sections = (); |
|
my @buildsections = (); |
my %users = (); |
my %users = (); |
my %userdata = (); |
my %userdata = (); |
my @members = (); |
my @members = (); |
Line 400 sub group_administration {
|
Line 418 sub group_administration {
|
if ($state eq '') { |
if ($state eq '') { |
if (defined($env{'form.groupname'})) { |
if (defined($env{'form.groupname'})) { |
$state = 'pick_task'; |
$state = 'pick_task'; |
} else { |
|
$state = 'pick_group'; |
|
} |
} |
} else { |
} else { |
%stored = &retrieve_settings($cdom,$cnum,$groupname); |
%stored = &retrieve_settings($cdom,$cnum,$groupname); |
Line 495 sub group_administration {
|
Line 511 sub group_administration {
|
(($action eq 'modify') && (($state eq 'change_settings') || |
(($action eq 'modify') && (($state eq 'change_settings') || |
($state eq 'add_members')))) { |
($state eq 'add_members')))) { |
%sectioncount = &Apache::loncommon::get_sections($cdom,$cnum); |
%sectioncount = &Apache::loncommon::get_sections($cdom,$cnum); |
if (%sectioncount) { |
$elements{'create'}{'pick_name'}{'sectionpick'} = 'selectbox'; |
$elements{'create'}{'pick_name'}{'sectionpick'} = 'selectbox'; |
$elements{'modify'}{'change_mapping'}{'sectionpick'} = 'selectbox'; |
$elements{'modify'}{'change_mapping'}{'sectionpick'} = 'selectbox'; |
$elements{'modify'}{'add_members'}{'sectionpick'} = 'selectbox'; |
$elements{'modify'}{'add_members'}{'sectionpick'} = 'selectbox'; |
|
} |
|
} |
} |
|
|
if (($action eq 'create') || |
if (($action eq 'create') || |
Line 513 sub group_administration {
|
Line 527 sub group_administration {
|
if (defined($env{'form.sectionpick'})) { |
if (defined($env{'form.sectionpick'})) { |
@sections=&Apache::loncommon::get_env_multiple('form.sectionpick'); |
@sections=&Apache::loncommon::get_env_multiple('form.sectionpick'); |
if (grep/^all$/,@sections) { |
if (grep/^all$/,@sections) { |
@sections = sort {$a cmp $b} keys(%sectioncount); |
@buildsections = sort {$a cmp $b} keys(%sectioncount); |
|
} else { |
|
@buildsections = @sections; |
} |
} |
} |
} |
} |
} |
|
|
if (($state eq 'pick_members') || ($state eq 'pick_privs') || ($state eq 'change_privs')) { |
if (($state eq 'pick_members') || ($state eq 'pick_privs') || ($state eq 'change_privs')) { |
&build_members_list($cdom,$cnum,\@types,\@roles,\@sections,\%users, |
&build_members_list($cdom,$cnum,\@types,\@roles,\@buildsections,\%users, |
\%userdata); |
\%userdata); |
} |
} |
if ($state eq 'pick_members') { |
if ($state eq 'pick_members') { |
Line 724 sub group_administration {
|
Line 740 sub group_administration {
|
my $space_trim = '/^\s*|\s*\$/g,""'; |
my $space_trim = '/^\s*|\s*\$/g,""'; |
my $float_check = '/^([0-9]*\.?[0-9]*)$/'; |
my $float_check = '/^([0-9]*\.?[0-9]*)$/'; |
$validate_script = ' |
$validate_script = ' |
var newquota = document.'.$state.'.quota.value; |
var newquota = new String(document.'.$state.'.quota.value); |
newquota.replace('.$space_trim.'); |
newquota.replace('.$space_trim.'); |
if (newquota == "" ) { |
if (newquota == "" ) { |
document.'.$state.'.quota.value = 0; |
document.'.$state.'.quota.value = 0; |
newquota = 0; |
newquota = "0"; |
} |
} |
var maxposs = '.$maxposs.'; |
var maxposs = '.sprintf("%.2f",$maxposs).'; |
if (newquota > maxposs) { |
if (newquota > maxposs) { |
alert("The file repository quota you entered for this group ("+newquota+" Mb) exceeds the maximum possible ("+maxposs+" Mb). Please enter a smaller number."); |
alert("The file repository quota you entered for this group ("+newquota+" Mb) exceeds the maximum possible ("+maxposs+" Mb). Please enter a smaller number."); |
return; |
return; |
Line 781 function changeSort(caller) {
|
Line 797 function changeSort(caller) {
|
my %states = (); |
my %states = (); |
my %branchstates = (); |
my %branchstates = (); |
@{$states{'create'}} = ('pick_name','pick_members','pick_privs','result'); |
@{$states{'create'}} = ('pick_name','pick_members','pick_privs','result'); |
@{$states{'modify'}} = ('pick_group','pick_task'); |
@{$states{'modify'}} = ('pick_task'); |
@{$branchstates{'noprivs'}} = ('result'); |
@{$branchstates{'noprivs'}} = ('result'); |
@{$branchstates{'settings'}} = ('change_settings','chgresult'); |
@{$branchstates{'settings'}} = ('change_settings','chgresult'); |
@{$branchstates{'members'}} = ('change_members','change_privs','memresult'); |
@{$branchstates{'members'}} = ('change_members','change_privs','memresult'); |
Line 805 function changeSort(caller) {
|
Line 821 function changeSort(caller) {
|
} |
} |
|
|
my $loaditems = &onload_action($action,$state); |
my $loaditems = &onload_action($action,$state); |
my $crumbtitle = "$crstype $ucgpterm".'s'; |
$r->print(&header("Groups Manager", |
$r->print(&header("$crumbtitle Manager", |
|
$jscript,$action,$state,$page,$loaditems)); |
$jscript,$action,$state,$page,$loaditems)); |
|
|
if ($env{'form.refpage'} eq 'enrl') { |
if ($env{'form.refpage'} eq 'enrl') { |
Line 814 function changeSort(caller) {
|
Line 829 function changeSort(caller) {
|
({href=>"/adm/dropadd", |
({href=>"/adm/dropadd", |
text=>"Enrollment Manager", |
text=>"Enrollment Manager", |
faq=>9,bug=>'Instructor Interface',}); |
faq=>9,bug=>'Instructor Interface',}); |
} else { |
if ($action eq 'modify') { |
|
&Apache::lonhtmlcommon::add_breadcrumb |
|
({href=>"/adm/coursegroups?refpage=enrl&action=modify", |
|
text=>"Groups", |
|
faq=>9,bug=>'Instructor Interface',}); |
|
} |
|
} else { |
&Apache::lonhtmlcommon::add_breadcrumb |
&Apache::lonhtmlcommon::add_breadcrumb |
({href=>"/adm/coursegroups", |
({href=>"/adm/coursegroups", |
text=>"$crumbtitle", |
text=>"Groups", |
faq=>9,bug=>'Instructor Interface',}); |
faq=>9,bug=>'Instructor Interface',}); |
|
if ($env{'form.refpage'} eq 'grouplist') { |
|
&Apache::lonhtmlcommon::add_breadcrumb |
|
({href=>"/adm/$cdom/$cnum/$env{'form.groupname'}/smppg?ref=grouplist", |
|
text=>"Group: $description",}); |
|
} |
} |
} |
|
|
my %trail = (); |
my %trail = (); |
Line 829 function changeSort(caller) {
|
Line 855 function changeSort(caller) {
|
result => 'Creation Complete', |
result => 'Creation Complete', |
); |
); |
%{$trail{'modify'}} = &Apache::lonlocal::texthash( |
%{$trail{'modify'}} = &Apache::lonlocal::texthash( |
pick_group => $ucgpterm.'s', |
|
pick_task => 'Choose Task', |
pick_task => 'Choose Task', |
change_settings => "$ucgpterm Settings", |
change_settings => "$ucgpterm Settings", |
change_members => 'Modify/Delete Members', |
change_members => 'Modify/Delete Members', |
Line 857 function changeSort(caller) {
|
Line 882 function changeSort(caller) {
|
&Apache::lonhtmlcommon::add_breadcrumb( |
&Apache::lonhtmlcommon::add_breadcrumb( |
{text=>"$trail{$action}{$state}"}); |
{text=>"$trail{$action}{$state}"}); |
$r->print(&Apache::lonhtmlcommon::breadcrumbs |
$r->print(&Apache::lonhtmlcommon::breadcrumbs |
("$crumbtitle Manager")); |
("Groups Manager")); |
&display_control($r,$cdom,$cnum,$action,$state,$page, |
&display_control($r,$cdom,$cnum,$action,$state,$page, |
\%sectioncount,$groupname,$description,$functions, |
\%sectioncount,$groupname,$description,$functions, |
\@tools,$toolprivs,$fixedprivs,$startdate,$enddate, |
\@tools,$toolprivs,$fixedprivs,$startdate,$enddate, |
Line 882 function changeSort(caller) {
|
Line 907 function changeSort(caller) {
|
} elsif (($action eq 'view') && ($view_permission)) { |
} elsif (($action eq 'view') && ($view_permission)) { |
&Apache::lonhtmlcommon::add_breadcrumb( |
&Apache::lonhtmlcommon::add_breadcrumb( |
{text=>"View $gpterm".'s'}); |
{text=>"View $gpterm".'s'}); |
my $crumbtitle = "$crstype $ucgpterm".'s Manager'; |
|
$r->print(&Apache::lonhtmlcommon::breadcrumbs |
$r->print(&Apache::lonhtmlcommon::breadcrumbs |
(&mt($crumbtitle))); |
('Groups Manager')); |
&display_groups($r,$cdom,$cnum,$functions,$idx,$view_permission, |
&display_groups($r,$cdom,$cnum,$functions,$idx,$view_permission, |
$manage_permission,$action,$state,$gpterm,$ucgpterm, |
$manage_permission,$action,$state,$gpterm,$ucgpterm, |
$crstype); |
$crstype); |
Line 988 sub display_control {
|
Line 1012 sub display_control {
|
} |
} |
} elsif ($action eq 'modify') { |
} elsif ($action eq 'modify') { |
my $groupname = $env{'form.groupname'}; |
my $groupname = $env{'form.groupname'}; |
if ($state eq 'pick_group') { |
if ($state eq 'pick_task') { |
&display_groups($r,$cdom,$cnum,$functions,$idx,$view_permission, |
|
$manage_permission,$action,$state,$gpterm, |
|
$ucgpterm,$crstype); |
|
} elsif ($state eq 'pick_task') { |
|
&modify_menu($r,$groupname,$page,$gpterm); |
&modify_menu($r,$groupname,$page,$gpterm); |
} elsif ($state eq 'change_settings') { |
} elsif ($state eq 'change_settings') { |
&general_settings_form($r,$cdom,$cnum,$action,$state,$page, |
&general_settings_form($r,$cdom,$cnum,$action,$state,$page, |
Line 1077 sub onload_action {
|
Line 1097 sub onload_action {
|
} |
} |
if (($action eq 'modify') && |
if (($action eq 'modify') && |
($state eq 'change_settings' || $state eq 'change_members' || |
($state eq 'change_settings' || $state eq 'change_members' || |
$state eq 'change_privs' || $state eq 'add_members' || |
$state eq 'change_privs' || $state eq 'add_members')) { |
$state eq 'pick_members')) { |
|
$loaditems{'onload'} = |
$loaditems{'onload'} = |
'javascript:setFormElements(document.'.$state.')'; |
'javascript:setFormElements(document.'.$state.')'; |
} |
} |
Line 1200 sub groupsettings_options {
|
Line 1219 sub groupsettings_options {
|
my ($r,$functions,$action,$formname,$stored,$image,$gpterm, |
my ($r,$functions,$action,$formname,$stored,$image,$gpterm, |
$ucgpterm,$crstype) = @_; |
$ucgpterm,$crstype) = @_; |
my %lt = &Apache::lonlocal::texthash( |
my %lt = &Apache::lonlocal::texthash( |
'gdat' => "$ucgpterm open and close dates", |
'gdat' => "Group access start and end dates", |
'sten' => "Set a start date/time and end date/time for the $gpterm", |
'gnde' => "Group name, title and available collaborative tools", |
'gfun' => "$ucgpterm functionality", |
'desc' => 'Group Title', |
'gnde' => "$ucgpterm name, description and available functionality", |
'func' => 'Collaborative Tools', |
'desc' => 'Description', |
'gnam' => 'Group Name', |
'func' => 'Functionality', |
'lett' => 'Letters, numbers and underscore only', |
'gnam' => "$ucgpterm Name", |
'doyo' => 'Different subsets of the chosen collaborative tools '. |
'doyo' => "Do you want to assign different functionality ". |
'for different group members?', |
"to different $gpterm members?", |
|
); |
); |
my ($crsquota,$freespace,$maxposs) = &get_quota_constraints($action,$stored); |
my ($crsquota,$freespace,$maxposs) = &get_quota_constraints($action,$stored); |
&topic_bar($r,$image,$lt{'gnde'}); |
&topic_bar($r,$image,$lt{'gnde'}); |
Line 1219 sub groupsettings_options {
|
Line 1237 sub groupsettings_options {
|
<td colspan="5"> |
<td colspan="5"> |
'); |
'); |
if ($action eq 'create') { |
if ($action eq 'create') { |
$r->print('<input type="text" name="groupname" size="25" />'); |
$r->print('<input type="text" name="groupname" size="25" /> ('. |
|
$lt{'lett'}.')'); |
} else { |
} else { |
$r->print('<input type="hidden" name="groupname" value="'. |
$r->print('<input type="hidden" name="groupname" value="'. |
$env{'form.groupname'}.'" />'.$env{'form.groupname'}); |
$env{'form.groupname'}.'" />'.$env{'form.groupname'}); |
Line 1289 END
|
Line 1308 END
|
$r->print('<br />'. |
$r->print('<br />'. |
&mt('A total of [_1] Mb can be divided amongst all [_2]s in the '. |
&mt('A total of [_1] Mb can be divided amongst all [_2]s in the '. |
'[_3], and [_4] Mb are currently unallocated.',$crsquota, |
'[_3], and [_4] Mb are currently unallocated.',$crsquota, |
$gpterm,lc($crstype),$freespace)); |
$gpterm,lc($crstype),sprintf("%.2f",$freespace))); |
} else { |
} else { |
$r->print(' ('.&mt('The quota is currently [_1] Mb', |
$r->print(' ('.&mt('The quota is currently [_1] Mb', |
$$stored{'quota'}).').'); |
$$stored{'quota'}).').'); |
|
|
$r->print('<br />'.&mt('The quota can be increased to [_1] Mb, '. |
$r->print('<br />'.&mt('The quota can be increased to [_1] Mb, '. |
'by adding all unallocated space for [_2]s in the [_3].', |
'by adding all unallocated space for [_2]s in the [_3].', |
$maxposs,$gpterm,lc($crstype))); |
sprintf("%.2f",$maxposs),$gpterm,lc($crstype))); |
} |
} |
$r->print(' |
$r->print(' |
</td> |
</td> |
Line 1326 sub membership_options {
|
Line 1345 sub membership_options {
|
my ($r,$action,$state,$sectioncount,$image,$gpterm,$ucgpterm) = @_; |
my ($r,$action,$state,$sectioncount,$image,$gpterm,$ucgpterm) = @_; |
my $crstype = &Apache::loncommon::course_type(); |
my $crstype = &Apache::loncommon::course_type(); |
my %lt = &Apache::lonlocal::texthash( |
my %lt = &Apache::lonlocal::texthash( |
'pipa' => 'Pick parameters to generate membership list', |
'pipa' => 'Build a list of users for selection of group members', |
'gmem' => "$ucgpterm membership options", |
'gmem' => "Group membership selection list criteria:", |
'picr' => 'Pick the criteria to use to build a list of '. |
'picr' => 'Pick the criteria to use to build a list of '. |
lc($crstype).' users from which you will select ', |
lc($crstype).' users from which you will select ', |
'meof' => "members of the new $gpterm.", |
'meof' => "members of the new group.", |
'admg' => "additional members of the $gpterm.", |
'admg' => "additional members of the group.", |
'ifno' => "If you do not wish to add members when you first ". |
'ifno' => "If you do not wish to add members when you first ". |
"create the $gpterm, do not make any selections.", |
"create the group, there is no need to pick any criteria.", |
'asub' => "A subsequent step will also allow you to specify automatic adding/dropping of $gpterm members triggered by specified role and section changes.", |
'asub' => "A subsequent step will also allow you to specify automatic adding/dropping of group members triggered by specified user role and section <i>changes</i> in the course.", |
'acty' => 'Access types', |
'acty' => 'Access types', |
'coro' => $crstype.' roles', |
'coro' => $crstype.' roles', |
'cose' => $crstype.' sections', |
'cose' => $crstype.' sections', |
Line 1364 sub membership_options {
|
Line 1383 sub membership_options {
|
<table class="LC_status_selector"> |
<table class="LC_status_selector"> |
<tr> |
<tr> |
<th>'.$lt{'acty'}.'</th> |
<th>'.$lt{'acty'}.'</th> |
<th>'.$lt{'coro'}.'</th>'); |
<th>'.$lt{'coro'}.'</th> |
if (@sections >0) { |
<th>'.$lt{'cose'}.'</th> |
$r->print(' |
</tr><tr><td>'); |
<th>'.$lt{'cose'}.'</th>'); |
|
} |
|
$r->print('</tr><tr><td>'); |
|
$r->print(&Apache::lonhtmlcommon::status_select_row(\%status_types)); |
$r->print(&Apache::lonhtmlcommon::status_select_row(\%status_types)); |
$r->print('</td><td>'); |
$r->print('</td><td>'); |
$r->print(&Apache::lonhtmlcommon::role_select_row(\@roles)); |
$r->print(&Apache::lonhtmlcommon::role_select_row(\@roles)); |
Line 1377 sub membership_options {
|
Line 1393 sub membership_options {
|
@sections = sort {$a cmp $b} @sections; |
@sections = sort {$a cmp $b} @sections; |
unshift(@sections,'none'); # Put 'no sections' next |
unshift(@sections,'none'); # Put 'no sections' next |
unshift(@sections,'all'); # Put 'all' at the front of the list |
unshift(@sections,'all'); # Put 'all' at the front of the list |
$r->print('</td><td>'. |
} else { |
§ions_selection(\@sections,'sectionpick').'</td>'); |
@sections = ('all','none'); |
} |
} |
$r->print(' |
$r->print('</td><td>'. |
|
§ions_selection(\@sections,'sectionpick').'</td> |
</tr> |
</tr> |
</table>'); |
</table>'); |
return; |
return; |
Line 1395 sub sections_selection {
|
Line 1412 sub sections_selection {
|
} |
} |
foreach my $sec (@{$sections}) { |
foreach my $sec (@{$sections}) { |
if ($sec eq 'all') { |
if ($sec eq 'all') { |
$section_sel .= ' <option value="'.$sec.'" selected="selected">'.&mt('all sections').'</option>'."\n"; |
$section_sel .= ' <option value="'.$sec.'">'.&mt('all sections').'</option>'."\n"; |
} elsif ($sec eq 'none') { |
} elsif ($sec eq 'none') { |
$section_sel .= ' <option value="'.$sec.'">'.&mt('no section').'</option>'."\n"; |
$section_sel .= ' <option value="'.$sec.'">'.&mt('no section').'</option>'."\n"; |
} else { |
} else { |
Line 1527 sub print_current_settings {
|
Line 1544 sub print_current_settings {
|
$granularity,$quota,$available,$unavailable,$gpterm,$ucgpterm) = @_; |
$granularity,$quota,$available,$unavailable,$gpterm,$ucgpterm) = @_; |
|
|
my %lt = &Apache::lonlocal::texthash( |
my %lt = &Apache::lonlocal::texthash( |
grna => "$ucgpterm Name", |
grna => 'Group Name', |
desc => 'Description', |
desc => 'Group Title', |
grfn => "$ucgpterm Functions", |
grfn => "Collaborative Tools", |
gran => 'Granularity', |
gran => 'Granularity', |
quot => 'File quota', |
quot => 'File quota', |
dfac => 'Default access dates', |
dfac => 'Default access dates', |
ygrs => "Your $gpterm selections", |
ygrs => "Your group selections - ", |
tfwa => "The following settings will apply to the $gpterm:", |
tfwa => "The following settings will apply to the group:", |
difn => 'Different functionality<br />for different members:', |
difn => 'Different collaborative tools<br />for different members:', |
stda => 'Start date', |
stda => 'Start date', |
enda => 'End date:', |
enda => 'End date:', |
); |
); |
Line 1570 sub print_current_settings {
|
Line 1587 sub print_current_settings {
|
<td> |
<td> |
'); |
'); |
if (@{$available} > 0) { |
if (@{$available} > 0) { |
$r->print('<b>Available:</b> |
$r->print(&mt('<b>Available for assignment to members:</b>'). |
<table class="LC_group_priv"><tr>'); |
'<table class="LC_group_priv"><tr>'); |
my $rowcell = int(@{$available}/2) + @{$available}%2; |
my $rowcell = int(@{$available}/2) + @{$available}%2; |
for (my $i=0; $i<@{$available}; $i++) { |
for (my $i=0; $i<@{$available}; $i++) { |
if (@{$available} > 3) { |
if (@{$available} > 3) { |
Line 1588 sub print_current_settings {
|
Line 1605 sub print_current_settings {
|
$r->print('</tr></table><br />'); |
$r->print('</tr></table><br />'); |
} |
} |
if (@{$unavailable} > 0) { |
if (@{$unavailable} > 0) { |
$r->print('<b>Unavailable:</b> |
$r->print(&mt('<b>Unavailable for assignment:</b>'). |
<table class="LC_group_priv"><tr>'); |
'<table class="LC_group_priv"><tr>'); |
my $rowcell = int(@{$unavailable}/2) + @{$unavailable}%2; |
my $rowcell = int(@{$unavailable}/2) + @{$unavailable}%2; |
for (my $j=0; $j<@{$unavailable}; $j++) { |
for (my $j=0; $j<@{$unavailable}; $j++) { |
if (@{$unavailable} > 3) { |
if (@{$unavailable} > 3) { |
Line 1622 sub pick_new_members {
|
Line 1639 sub pick_new_members {
|
my ($r,$action,$formname,$available,$idx,$stored,$img,$users,$userdata, |
my ($r,$action,$formname,$available,$idx,$stored,$img,$users,$userdata, |
$granularity,$origmembers,$gpterm,$ucgpterm) = @_; |
$granularity,$origmembers,$gpterm,$ucgpterm) = @_; |
my %lt = &Apache::lonlocal::texthash( |
my %lt = &Apache::lonlocal::texthash( |
'gpme' => "$ucgpterm membership", |
'gpme' => "Group membership", |
'addm' => 'Add members', |
'addm' => 'Add members', |
'setf' => 'Set functionality', |
'setf' => 'Assign collaborative tools', |
'func' => 'Functionality', |
'func' => 'Tools', |
'nome' => 'No members to add at this time.', |
'nome' => 'No members to add at this time, as there are no users '. |
|
'matching the specified type(s), role(s) and section(s).', |
'nnew' => "There are no users to add as new members, as all users". |
'nnew' => "There are no users to add as new members, as all users". |
" matching the specified type(s), role(s), and/or ". |
" matching the specified type(s), role(s), and ". |
"section(s) are already affiliated with this $gpterm.", |
"section(s) are already affiliated with this group.", |
'yoma' => 'You may need to use the '."'".'modify existing, past or '. |
'yoma' => 'You may need to use the '."'".'modify existing, past or '. |
'future members'."'".' page if you need to re-enable '. |
'future members'."'".' page if you need to re-enable '. |
'or activate access for previous or future members.', |
'or activate access for previous or future members.', |
Line 1765 sub privilege_specificity {
|
Line 1783 sub privilege_specificity {
|
my ($r,$action,$img,$tools,$stored,$toolprivs,$fixedprivs,$available, |
my ($r,$action,$img,$tools,$stored,$toolprivs,$fixedprivs,$available, |
$formname,$gpterm,$ucgpterm) = @_; |
$formname,$gpterm,$ucgpterm) = @_; |
my %lt = &Apache::lonlocal::texthash ( |
my %lt = &Apache::lonlocal::texthash ( |
'uprv' => 'User privileges', |
'uprv' => 'User privileges for collaborative tools', |
'frty' => 'For each type of functionality you have chosen to include, '. |
'frty' => 'For each collaborative tool you have chosen to include, '. |
'there is a set of standard privileges which apply to all '. |
'there is a set of core privileges which all group members '. |
'of those for whom the functionality is enabled.', |
'assigned use of the tool will receive.', |
'thar' => 'There are also additional privileges which can be set for '. |
'thar' => 'For some tools there are also additional optional '. |
'some, or all, members. Please choose one of the following:', |
'privileges which can be set.', |
'fort' => 'For the types of functionality you have chosen to include '. |
'plch' => 'Choose one of the following:', |
'there are no additional privileges which can be set for some '. |
'fort' => 'For the collaborative tools you have chosen to include '. |
'or all members.', |
'only core privileges are available, '. |
'eaty' => 'Each of the types of functionality includes standard '. |
'so there are no optional privileges to assign.', |
'privileges which apply to members with access to that '. |
'eaty' => 'Each collaborative tool includes core '. |
'functionality, and may also include additional privileges '. |
'privileges assigned to all members with access to the '. |
|
'tool. Some tools may also feature additional privileges '. |
'which can be set for specific members.', |
'which can be set for specific members.', |
'cutg' => "Currently the $gpterm is configured ", |
'cutg' => 'Currently the group is configured ', |
'sdif' => "so different $gpterm members can receive different privileges.", |
'sdif' => 'so different members can receive different optional privileges for a particular tool.', |
'sall' => "so all $gpterm members will receive the same privileges.", |
'sall' => 'so all members will receive the same optional privileges for a particular tool.', |
'algm' => "All $gpterm members will receive the same privileges.", |
'algm' => 'All group members will receive the same privileges for any tool assigned to them, including the default set of optional privileges.', |
'smgp' => "Some $gpterm members will receive different privileges from ". |
'smgp' => 'Different group members may receive different privileges from '. |
"others.", |
'others for the tools they have been assigned.', |
'thwi' => "These will be the privileges all $gpterm members receive, ". |
'thwi' => 'These will be the privileges all group members receive for a particular assigned tool, '. |
"if you selected the first option above.", |
'if you selected the first option above.', |
'thes' => "These will be the privileges given to members assigned ". |
'thes' => "These will be the privileges given to members assigned ". |
"in the future, including via automatic $gpterm assignment ". |
"in the future via automatic group assignment ". |
"for specific sections/roles ", |
"for users who receive specific sections/roles in the course ", |
'asyo' => "As you have chosen not to include any functionality in the ". |
'asyo' => "As you have chosen not to include any collaborative tools ". |
"$gpterm, no default user privileges settings need to be set.", |
"in the group, no default optional privileges need to be set.", |
'plin' => 'Please indicate which <b>optional</b> privileges members '. |
'plin' => 'Indicate which <b>optional</b> privileges members '. |
'will receive by default.', |
'will receive by default for a specific tool.', |
'oppr' => 'Optional privileges', |
'oppr' => 'Optional privileges', |
'defp' => 'The default privileges new members will receive are:', |
'defp' => 'The default privileges new members will receive are:', |
); |
); |
Line 1806 sub privilege_specificity {
|
Line 1825 sub privilege_specificity {
|
} |
} |
&topic_bar($r,$img,$lt{'uprv'}); |
&topic_bar($r,$img,$lt{'uprv'}); |
if ((($action eq 'create') && (@{$available} > 0)) || |
if ((($action eq 'create') && (@{$available} > 0)) || |
(($action eq 'modify') && ($formname eq 'change_settings'))) { |
(($action eq 'modify') && ($formname eq 'change_settings'))) { |
my %specific = ( |
my %specific = ( |
'No' => 'checked="checked"', |
'No' => 'checked="checked"', |
'Yes' => '', |
'Yes' => '', |
Line 1814 sub privilege_specificity {
|
Line 1833 sub privilege_specificity {
|
if ($action eq 'create') { |
if ($action eq 'create') { |
$r->print($lt{'frty'}.'<br />'); |
$r->print($lt{'frty'}.'<br />'); |
if ($totaloptionalprivs) { |
if ($totaloptionalprivs) { |
$r->print($lt{'thar'}); |
$r->print($lt{'thar'}.'<br /><br />'.$lt{'plch'}); |
} else { |
} else { |
$r->print($lt{'fort'}); |
$r->print($lt{'fort'}); |
} |
} |
Line 1830 sub privilege_specificity {
|
Line 1849 sub privilege_specificity {
|
} |
} |
if ($totaloptionalprivs) { |
if ($totaloptionalprivs) { |
$r->print(' |
$r->print(' |
<br /><br /> |
<br /> |
<label><nobr><input type="radio" name="specificity" value="No" '.$specific{'No'}.' /> '.$lt{'algm'}.'</nobr></label><br /> |
<label><nobr><input type="radio" name="specificity" value="No" '.$specific{'No'}.' /> '.$lt{'algm'}.'</nobr></label><br /> |
<label><nobr><input type="radio" name="specificity" value="Yes" '.$specific{'Yes'}.' /> '.$lt{'smgp'}.'</nobr></label>'); |
<label><nobr><input type="radio" name="specificity" value="Yes" '.$specific{'Yes'}.' /> '.$lt{'smgp'}.'</nobr></label><br /><br />'); |
} else { |
} else { |
$r->print('<input type="hidden" name="specificity" value="No" />'); |
$r->print('<input type="hidden" name="specificity" value="No" />'); |
} |
} |
if ($totaloptionalprivs) { |
if ($totaloptionalprivs) { |
$r->print($lt{'plin'}); |
$r->print($lt{'plin'}); |
if ($action eq 'create') { |
if ($action eq 'create') { |
$r->print(' '.$lt{'thwi'}); |
$r->print('<br />'.$lt{'thwi'}); |
} |
} |
$r->print('<br />'.$lt{'thes'}); |
$r->print('<br />'.$lt{'thes'}); |
if ($action eq 'create') { |
if ($action eq 'create') { |
Line 1863 sub privilege_specificity {
|
Line 1882 sub privilege_specificity {
|
} else { |
} else { |
if ($action eq 'create') { |
if ($action eq 'create') { |
$r->print($lt{'asyo'}); |
$r->print($lt{'asyo'}); |
|
$r->print('<input type="hidden" name="specificity" value="No" />'); |
} elsif ($action eq 'modify' && $formname eq 'pick_members') { |
} elsif ($action eq 'modify' && $formname eq 'pick_members') { |
my @defprivs; |
my @defprivs; |
if (ref($$stored{'defpriv'}) eq 'ARRAY') { |
if (ref($$stored{'defpriv'}) eq 'ARRAY') { |
Line 1887 sub default_privileges {
|
Line 1907 sub default_privileges {
|
'addp' => 'Additional privileges', |
'addp' => 'Additional privileges', |
'fixp' => 'Fixed privileges', |
'fixp' => 'Fixed privileges', |
'oppr' => 'Optional privileges', |
'oppr' => 'Optional privileges', |
'func' => 'Function', |
'func' => 'Collaborative Tool', |
); |
); |
$r->print(&Apache::lonhtmlcommon::start_pick_box('LC_group_priv_box'). |
$r->print(&Apache::lonhtmlcommon::start_pick_box('LC_group_priv_box'). |
&Apache::lonhtmlcommon::row_title($lt{'func'},undef, |
&Apache::lonhtmlcommon::row_title($lt{'func'},undef, |
Line 1907 sub default_privileges {
|
Line 1927 sub default_privileges {
|
if ($fixed ne '') { |
if ($fixed ne '') { |
$fixed .= '</td><td class="LC_groups_fixed">'; |
$fixed .= '</td><td class="LC_groups_fixed">'; |
} |
} |
$fixed .= '<input type="hidden" name="defpriv" value="'.$priv.'" />'.$$toolprivs{$tool}{$priv}.' '; |
$fixed .= '<input type="hidden" name="defpriv" value="'.$priv.'" /><nobr>'.$$toolprivs{$tool}{$priv}.' '; |
if ($action eq 'modify') { |
if ($action eq 'modify') { |
if (grep(/^$tool$/,@{$available})) { |
if (grep(/^$tool$/,@{$available})) { |
$fixed .= '<small>'.&mt('(on)').'<small> '; |
$fixed .= '<small>'.&mt('(on)').'<small> '; |
Line 1915 sub default_privileges {
|
Line 1935 sub default_privileges {
|
$fixed .= '<small>'.&mt('(off)').'<small> '; |
$fixed .= '<small>'.&mt('(off)').'<small> '; |
} |
} |
} |
} |
|
$fixed .= '</nobr>'; |
} else { |
} else { |
$privcount++; |
$privcount++; |
if ($privcount == 3) { |
if ($privcount == 3) { |
$dynamic .= '</tr> |
$dynamic .= '</tr> |
<tr>'."\n"; |
<tr>'."\n"; |
} |
} |
$dynamic .= '<td><label><input type="checkbox" name="defpriv" value="'.$priv.'" />'.$$toolprivs{$tool}{$priv}.'</label></td>'."\n"; |
$dynamic .= '<td><nobr><label><input type="checkbox" name="defpriv" value="'.$priv.'" />'.$$toolprivs{$tool}{$priv}.'</label></nobr></td>'."\n"; |
} |
} |
} |
} |
if ($privcount == 0) { |
if ($privcount == 0) { |
$dynamic .= '<td>None</td>'."\n"; |
$dynamic .= '<td>None</td>'."\n"; |
} |
} |
if ($privcount < 3) { |
if ($privcount < 3) { |
$dynamic .= '</td> |
$dynamic .= '<td> </td>'."\n"; |
<td> </td>'."\n"; |
|
} elsif ($privcount%2) { |
} elsif ($privcount%2) { |
$dynamic = '<td> </td>'."\n"; |
$dynamic = '<td> </td>'."\n"; |
} |
} |
Line 1956 sub display_defprivs {
|
Line 1976 sub display_defprivs {
|
my $rowColor2 = "#eeeeee"; |
my $rowColor2 = "#eeeeee"; |
my %lt = &Apache::lonlocal::texthash( |
my %lt = &Apache::lonlocal::texthash( |
'priv' => 'Privileges', |
'priv' => 'Privileges', |
'func' => 'Function', |
'func' => 'Collaborative Tool', |
); |
); |
$r->print(&Apache::lonhtmlcommon::start_pick_box()); |
$r->print(&Apache::lonhtmlcommon::start_pick_box()); |
$r->print('<tr>'); |
$r->print('<tr>'); |
Line 2049 sub change_members_form {
|
Line 2069 sub change_members_form {
|
$groupname,$description,$granularity,$quota, |
$groupname,$description,$granularity,$quota, |
\@available,\@unavailable,$gpterm,$ucgpterm); |
\@available,\@unavailable,$gpterm,$ucgpterm); |
&topic_bar($r,2,$lt{'mogm'}); |
&topic_bar($r,2,$lt{'mogm'}); |
¤t_membership($r,$cdom,$cnum,$formname,$groupname,\@available, |
my $numcurrent = ¤t_membership($r,$cdom,$cnum,$formname,$groupname, |
\@unavailable,$fixedprivs,$granularity,$specificity); |
\@available,\@unavailable,$fixedprivs, |
&display_navbuttons($r,$formname,$$states{$action}[$page-1],$prevtext, |
$granularity,$specificity); |
$$states{$action}[$page+1],$nexttext); |
if ($numcurrent > 0) { |
|
&display_navbuttons($r,$formname,$$states{$action}[$page-1],$prevtext, |
|
$$states{$action}[$page+1],$nexttext); |
|
} else { |
|
&display_navbuttons($r,$formname,$$states{$action}[$page-1],$prevtext); |
|
} |
return; |
return; |
} |
} |
|
|
Line 2072 sub current_membership {
|
Line 2097 sub current_membership {
|
'reen' => 'Re-enable', |
'reen' => 'Re-enable', |
'acti' => 'Activate', |
'acti' => 'Activate', |
'dele' => 'Delete', |
'dele' => 'Delete', |
'curf' => 'Current Functionality', |
'curf' => 'Current Tool Set', |
'chpr' => 'Change Privileges' |
'chpr' => 'Change Privileges' |
); |
); |
my ($current,$num_items,$hastools,$addtools) = |
my ($current,$num_items,$hastools,$addtools) = |
&Apache::longroup::group_memberlist($cdom,$cnum,$groupname,$fixedprivs, |
&Apache::longroup::group_memberlist($cdom,$cnum,$groupname,$fixedprivs, |
$available); |
$available); |
if (keys(%{$current}) > 0) { |
my $numcurrent = scalar(keys(%{$current})); |
|
if ($numcurrent > 0) { |
$r->print(' |
$r->print(' |
<table> |
<table> |
<tr>'); |
<tr>'); |
Line 2135 END
|
Line 2161 END
|
$colspan++; |
$colspan++; |
} |
} |
if ($addtools) { |
if ($addtools) { |
$r->print('<th>'.&mt('Additional Functionality').'</th>'); |
$r->print('<th>'.&mt('Additional Tools').'</th>'); |
$colspan++; |
$colspan++; |
} |
} |
$r->print(&Apache::loncommon::end_data_table_header_row()); |
$r->print(&Apache::loncommon::end_data_table_header_row()); |
Line 2248 END
|
Line 2274 END
|
} |
} |
} |
} |
$r->print(&Apache::loncommon::end_data_table()); |
$r->print(&Apache::loncommon::end_data_table()); |
|
} else { |
|
$r->print(&mt('There are no active, future or previous group members to modify.')); |
} |
} |
return; |
return $numcurrent; |
} |
} |
|
|
sub check_uncheck_buttons { |
sub check_uncheck_buttons { |
Line 2318 sub change_privs_form {
|
Line 2346 sub change_privs_form {
|
$r->print($lt{'nome'}.'<br />'); |
$r->print($lt{'nome'}.'<br />'); |
} |
} |
|
|
&topic_bar($r,4,&mt('[_1] member privileges',$ucgpterm)); |
&topic_bar($r,4,&mt('Setting optional privileges for specific group members')); |
|
|
my $numchgs = &member_privileges_form($r,$action,$formname,$tools, |
my $numchgs = &member_privileges_form($r,$action,$formname,$tools, |
$toolprivs,$fixedprivs,$userdata, |
$toolprivs,$fixedprivs,$userdata, |
Line 2374 sub choose_privs_form {
|
Line 2402 sub choose_privs_form {
|
$nexttext = $$navbuttons{'adme'}; |
$nexttext = $$navbuttons{'adme'}; |
} |
} |
|
|
&topic_bar($r,6,&mt('[_1] member privileges',$ucgpterm)); |
&topic_bar($r,6,&mt('Setting optional privileges for specific group members')); |
|
|
&member_privileges_form($r,$action,$formname,$tools,$toolprivs, |
&member_privileges_form($r,$action,$formname,$tools,$toolprivs, |
$fixedprivs,$userdata,$usertools,$idx,undef, |
$fixedprivs,$userdata,$usertools,$idx,undef, |
$states,$stored,$gpterm); |
$states,$stored,$gpterm); |
|
|
if ($action eq 'create') { |
if ($action eq 'create') { |
if (keys(%{$sectioncount}) > 0) { |
my $img1 = 7; |
my $img1 = 7; |
my $img2 = 8; |
my $img2 = 8; |
&mapping_options($r,$action,$formname,$page,$sectioncount, |
&mapping_options($r,$action,$formname,$page,$sectioncount, |
$states,$stored,$navbuttons,$img1,$img2, |
$states,$stored,$navbuttons,$img1,$img2, |
$gpterm,$ucgpterm,$crstype); |
$gpterm,$ucgpterm,$crstype); |
|
} |
|
} |
} |
my $prevtext = $$navbuttons{'gtps'}; |
my $prevtext = $$navbuttons{'gtps'}; |
&display_navbuttons($r,$formname,$$states{$action}[$page-1],$prevtext, |
&display_navbuttons($r,$formname,$$states{$action}[$page-1],$prevtext, |
Line 2458 sub member_privileges_form {
|
Line 2484 sub member_privileges_form {
|
$usertools,$idx,$memchg,$states,$stored,$gpterm) = @_; |
$usertools,$idx,$memchg,$states,$stored,$gpterm) = @_; |
my %lt = &Apache::lonlocal::texthash( |
my %lt = &Apache::lonlocal::texthash( |
'addp' => 'Additional privileges', |
'addp' => 'Additional privileges', |
'fixp' => 'Fixed privileges', |
'fixp' => 'Core privileges', |
'oppr' => 'Optional privileges', |
'oppr' => 'Optional privileges', |
'func' => 'Function', |
'func' => 'Tool', |
'forf' => 'For the functionality you have chosen to include '. |
'forf' => 'For the collaborative tools included for group '. |
'there are no optional privileges to set besides '. |
'members being added or modified, '. |
'the standard privileges.', |
'there are no optional privileges to set '. |
'algr' => "All $gpterm members will receive the same privileges.", |
'for specific members.', |
'asno' => "As no $gpterm members are being added, ". |
'algr' => 'All new group members will receive the same privileges.', 'ifex' => 'If previously expired members are being re-enabled, or '. |
"there are no specific user privileges to set.", |
'if access for future members is being activated now, '. |
'asng' => "As no $gpterm tools will be made available to users, ". |
'previously set privileges will be preserved.', |
"there are no specific user privileges to set.", |
'asno' => 'As no group members are being added, '. |
'nogm' => "No $gpterm member privileges to display or set, ". |
'there are no specific user privileges to set.', |
"as you have not indicated that you will be activating,". |
'asng' => 'As no group tools will be made available to users, '. |
" re-enabling, changing privileges, or adding/removing ". |
'there are no specific user privileges to set.', |
"functionality for any current members ", |
'nogm' => 'No group member privileges to display or set, '. |
|
'as you have not indicated that you will be activating,'. |
|
' re-enabling, changing privileges, or adding/removing '. |
|
'tools for any current members.', |
'full' => 'Fullname', |
'full' => 'Fullname', |
'user' => 'Username', |
'user' => 'Username', |
'doma' => 'Domain', |
'doma' => 'Domain', |
Line 2598 END
|
Line 2627 END
|
} |
} |
} else { |
} else { |
if (keys(%{$usertools}) > 0) { |
if (keys(%{$usertools}) > 0) { |
$r->print($lt{'algr'}.'<br /><br />'); |
$r->print($lt{'algr'}.'<br />'.$lt{'ifex'}.'<br /><br />'); |
&display_defprivs($r,$tools,$toolprivs,\@defprivs); |
&display_defprivs($r,$tools,$toolprivs,\@defprivs); |
} else { |
} else { |
$r->print($lt{'asno'}.'<br />'); |
$r->print($lt{'asno'}.'<br />'); |
Line 2710 sub write_group_data {
|
Line 2739 sub write_group_data {
|
} |
} |
if ($quota > $maxposs) { |
if ($quota > $maxposs) { |
$quota = $maxposs; |
$quota = $maxposs; |
$r->print(&mt('The value you entered for the quota for the file repository in this [_1] exceeded the maximum possible value, so it has been set to [_2] Mb (the maximum possible value).<br />',$gpterm,$maxposs)); |
$r->print(&mt('The value you entered for the quota for the file repository in this [_1] exceeded the maximum possible value, so it has been set to [_2] Mb (the maximum possible value).<br />',$gpterm,sprintf("%.2f",$maxposs))); |
} |
} |
my %groupinfo = ( |
my %groupinfo = ( |
description => $esc_description, |
description => $esc_description, |
Line 2779 sub write_group_data {
|
Line 2808 sub write_group_data {
|
$r->print(&mt('A problem occurred when creating folders for the new [_1]. [_2].<br />',$gpterm,$result)); |
$r->print(&mt('A problem occurred when creating folders for the new [_1]. [_2].<br />',$gpterm,$result)); |
} |
} |
$r->print(&mt('[_1] [_2] was created.<br />',$ucgpterm,$groupname)); |
$r->print(&mt('[_1] [_2] was created.<br />',$ucgpterm,$groupname)); |
} else { |
} elsif ($action eq 'modify') { |
|
my (@oldtools,@newtools); |
|
if (ref($$stored{'tool'}) eq 'ARRAY') { |
|
@oldtools = @{$$stored{'tool'}}; |
|
} |
|
if (ref($tools) eq 'ARRAY') { |
|
@newtools = @{$tools}; |
|
} |
|
if (!grep(/^discussion$/,@oldtools) && |
|
grep(/^discussion$/,@newtools)) { |
|
my $crspath = '/uploaded/'.$cdom.'/'.$cnum.'/'; |
|
my $boardsmap = $crspath.'group_boards_'.$groupname.'.sequence'; |
|
my $navmap = Apache::lonnavmaps::navmap->new(); |
|
my $bbmapres = $navmap->getResourceByUrl($boardsmap); |
|
undef($navmap); |
|
if (!$bbmapres) { |
|
my $grpmap = $crspath.'group_folder_'.$groupname.'.sequence'; |
|
my $disctitle = &mt('Discussion Boards'); |
|
my $outcome = &map_updater($cdom,$cnum,'group_boards_'. |
|
$groupname.'.sequence','bbseq', |
|
$disctitle,$grpmap); |
|
my ($furl,$ferr) = |
|
&Apache::lonuserstate::readmap($cdom.'/'.$cnum); |
|
$navmap = Apache::lonnavmaps::navmap->new(); |
|
# modify parameter |
|
if ($outcome eq 'ok') { |
|
my $parm_result = &parm_setter($navmap,$cdom,$boardsmap, |
|
$groupname); |
|
if ($parm_result) { |
|
$r->print(&mt('Error while setting parameters '. |
|
'for Discussion Boards folder: '. |
|
'[_1]<br />.',$parm_result)); |
|
} else { |
|
$r->print(&mt('Discussion Boards Folder created.<br />')); |
|
} |
|
} else { |
|
$r->print($outcome); |
|
} |
|
undef($navmap); |
|
} |
|
} |
$r->print(&mt('[_1] [_2] was updated.<br />',$ucgpterm,$groupname)); |
$r->print(&mt('[_1] [_2] was updated.<br />',$ucgpterm,$groupname)); |
} |
} |
} else { |
} else { |
Line 2999 sub process_membership {
|
Line 3068 sub process_membership {
|
} |
} |
if ($roster_result eq 'ok') { |
if ($roster_result eq 'ok') { |
$r->print('<br />'.&mt('[_1] membership list updated.',$ucgpterm)); |
$r->print('<br />'.&mt('[_1] membership list updated.',$ucgpterm)); |
$r->print('<p>'.&mt("For full access to all of [_1]'s privileges, users will need to log out and log back in.",$groupname).'</p>'); |
$r->print('<p>'.&mt("Any currently logged in course users affected by the changes you made to group membership or privileges for the [_1] group will need to log out and log back in for their LON-CAPA sessions to reflect these changes.",$groupname).'</p>'); |
} else { |
} else { |
$r->print('<br />'.&mt('An error occurred while updating the [_1] membership list -',$gpterm).$roster_result.'<br />'); |
$r->print('<br />'.&mt('An error occurred while updating the [_1] membership list -',$gpterm).$roster_result.'<br />'); |
} |
} |
Line 3014 sub mapping_options {
|
Line 3083 sub mapping_options {
|
'gmma' => "$ucgpterm membership mapping to specific sections/roles", |
'gmma' => "$ucgpterm membership mapping to specific sections/roles", |
'endi' => "Enable/disable automatic $gpterm enrollment for ". |
'endi' => "Enable/disable automatic $gpterm enrollment for ". |
"users in specified roles and sections", |
"users in specified roles and sections", |
'adds' => "If automatic $gpterm enrollment is enabled, when a user is assigned a ".lc($crstype)."-wide or section-specific role, he/she will automatically be added as a member of the $gpterm, with start and end access dates defined by the default dates set for the $gpterm, unless he/she is already a $gpterm member, with access dates that permit either current or future $gpterm access.", |
'adds' => "If automatic $gpterm enrollment is enabled, when a user is newly assigned a ".lc($crstype)."-wide or section-specific role, he/she will automatically be added as a member of the $gpterm, with start and end access dates defined by the default dates set for the $gpterm, unless he/she is already a $gpterm member, with access dates that permit either current or future $gpterm access.", |
'drops' => "If automatic $gpterm disenrollment is enabled, when a user's role is expired, access to the $gpterm will be terminated unless the user continues to have other ".lc($crstype)."-wide or section-specific active or future roles which receive automatic membership in the $gpterm.", |
'drops' => "If automatic $gpterm disenrollment is enabled, when a user's role is expired, access to the $gpterm will be terminated unless the user continues to have other ".lc($crstype)."-wide or section-specific active or future roles which receive automatic membership in the $gpterm.", |
'pirs' => "Pick roles and sections for automatic $gpterm enrollment", |
'pirs' => "Pick roles and sections for automatic $gpterm enrollment", |
'curr' => 'Currently set to', |
'curr' => 'Currently set to', |
Line 3064 sub mapping_settings {
|
Line 3133 sub mapping_settings {
|
@sections = sort {$a cmp $b} @sections; |
@sections = sort {$a cmp $b} @sections; |
unshift(@sections,'none'); # Put 'no sections' next |
unshift(@sections,'none'); # Put 'no sections' next |
unshift(@sections,'all'); # Put 'all' at the front of the list |
unshift(@sections,'all'); # Put 'all' at the front of the list |
|
} else { |
|
@sections = ('all','none'); |
} |
} |
&topic_bar($r,$image,$$lt{'pirs'}); |
&topic_bar($r,$image,$$lt{'pirs'}); |
my @roles = &standard_roles(); |
my @roles = &standard_roles(); |
Line 3105 sub mapping_settings {
|
Line 3176 sub mapping_settings {
|
} |
} |
$r->print(&Apache::loncommon::start_data_table_row(). |
$r->print(&Apache::loncommon::start_data_table_row(). |
'<td><input type="checkbox" '. |
'<td><input type="checkbox" '. |
'value="'.$role.'" /></td><td>'.$role.'</td>'. |
'value="'.$role.'" /></td><td>'.&mt('Custom role: '). |
$sections_sel. |
'<i>'.$role.'</i></td>'.$sections_sel. |
&Apache::loncommon::end_data_table_row()); |
&Apache::loncommon::end_data_table_row()); |
} |
} |
$r->print(&Apache::loncommon::end_data_table()); |
$r->print(&Apache::loncommon::end_data_table()); |
Line 3181 sub member_privs_entries {
|
Line 3252 sub member_privs_entries {
|
<td>'.$$userdata{$user}[$$idx{fullname}].'</td> |
<td>'.$$userdata{$user}[$$idx{fullname}].'</td> |
<td>'.$uname.'</td> |
<td>'.$uname.'</td> |
<td>'.$udom.'</td> |
<td>'.$udom.'</td> |
<td valign="top"><table><tr><td><b>Function</b></td></tr><tr><td><b>Fixed</b></td></tr><tr><td><b>Optional</b></td></tr></table></td>'); |
<td valign="top"> |
|
<table> |
|
<tr> |
|
<td><b>'. |
|
&mt('Collaborative Tool').'</b></td> |
|
</tr> |
|
<tr> |
|
<td><b>'.&mt('Fixed').'</b></td> |
|
</tr> |
|
<tr> |
|
<td><b>'.&mt('Optional').'</b></td> |
|
</tr> |
|
</table> |
|
</td>'); |
foreach my $tool (@{$showtools}) { |
foreach my $tool (@{$showtools}) { |
if (exists($$usertools{$user}{$tool})) { |
if (exists($$usertools{$user}{$tool})) { |
$r->print('<td valign="top"><table><tr><th colspan="2">'.$tool.'</th></tr>'); |
$r->print('<td valign="top"><table><tr><th colspan="2">'.$tool.'</th></tr>'); |
Line 3277 sub add_group_folder {
|
Line 3361 sub add_group_folder {
|
my $grpfolder = &mt('[_1] Folder -',$ucgpterm,).$description; |
my $grpfolder = &mt('[_1] Folder -',$ucgpterm,).$description; |
$grppage='/adm/'.$cdom.'/'.$cnum.'/'.$groupname.'/smppg'; |
$grppage='/adm/'.$cdom.'/'.$cnum.'/'.$groupname.'/smppg'; |
my $grptitle = &mt('Group homepage').' - '.$description; |
my $grptitle = &mt('Group homepage').' - '.$description; |
my ($seqid,$discussions,$disctitle); |
my ($discussions,$disctitle); |
my $outcome = &map_updater($cdom,$cnum,'group_folder_'.$groupname.'.sequence', |
my $outcome = &map_updater($cdom,$cnum,'group_folder_'.$groupname.'.sequence', |
'grpseq',$grpfolder,$allgrpsmap,$grppage, |
'grpseq',$grpfolder,$allgrpsmap,$grppage, |
$grptitle); |
$grptitle); |
Line 3289 sub add_group_folder {
|
Line 3373 sub add_group_folder {
|
# Link to folder for bulletin boards |
# Link to folder for bulletin boards |
$grpmap = $crspath.'group_folder_'.$groupname.'.sequence'; |
$grpmap = $crspath.'group_folder_'.$groupname.'.sequence'; |
if (grep/^discussion$/,@{$tools}) { |
if (grep/^discussion$/,@{$tools}) { |
$seqid = $now + 1; |
|
$disctitle = &mt('Discussion Boards'); |
$disctitle = &mt('Discussion Boards'); |
my $outcome = &map_updater($cdom,$cnum,'group_boards_'.$groupname. |
my $outcome = &map_updater($cdom,$cnum,'group_boards_'.$groupname. |
'.sequence','bbseq',$disctitle,$grpmap); |
'.sequence','bbseq',$disctitle,$grpmap); |