'.
&Apache::loncommon::end_data_table_row());
@@ -390,9 +395,7 @@ END
}
}
} else {
- $r->print(&mt('You are not currently a member of any '.
- 'active [_1]s in this [_2]',$gpterm,
- lc($crstype)));
+ $r->print(&mt('You are not currently a member of any active '.$gpterm.'s in this '.lc($crstype).'.'));
}
}
return;
@@ -406,7 +409,6 @@ sub group_administration {
my @types = ();
my @roles = ();
my @sections = ();
- my @buildsections = ();
my %users = ();
my %userdata = ();
my @members = ();
@@ -566,16 +568,11 @@ sub group_administration {
}
if (defined($env{'form.sectionpick'})) {
@sections=&Apache::loncommon::get_env_multiple('form.sectionpick');
- if (grep/^all$/,@sections) {
- @buildsections = sort {$a cmp $b} keys(%sectioncount);
- } else {
- @buildsections = @sections;
- }
}
}
if (($state eq 'pick_members') || ($state eq 'pick_privs') || ($state eq 'change_privs')) {
- &build_members_list($cdom,$cnum,\@types,\@roles,\@buildsections,\%users,
+ &build_members_list($cdom,$cnum,\@types,\@roles,\@sections,\%users,
\%userdata);
}
if ($state eq 'pick_members') {
@@ -788,7 +785,7 @@ sub group_administration {
}
var maxposs = '.sprintf("%.2f",$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 group portfolio quota you entered for this group ("+newquota+" Mb) exceeds the maximum possible ("+maxposs+" Mb). Please enter a smaller number.");
return;
}
var re_quota = '.$float_check.';
@@ -807,7 +804,7 @@ sub group_administration {
}
}
if (warn_zero == 1) {
- alert("You have indicated that the file repository should be enabled, but you have set the respository quota to 0 Mb.\nThis will prevent any upload of files.\nPlease set a value or disable the repository feature.");
+ alert("You have indicated that the group portfolio should be enabled, but you have set the respository quota to 0 Mb.\nThis will prevent any upload of files.\nPlease set a value or disable the repository feature.");
return;
}
}
@@ -918,11 +915,11 @@ function changeSort(caller) {
result => 'Re-enabled'
);
my %navbuttons = &Apache::lonlocal::texthash(
- gtns => 'Go to next step',
- gtps => 'Go to previous step',
+ gtns => 'Next',#'Go to next step',
+ gtps => 'Back',#'Go to previous step',
crgr => 'Create '.$gpterm,
- mose => 'Modify settings',
- gtpp => 'Go to previous page',
+ mose => 'Save',#'Modify settings',
+ gtpp => 'Back',#'Go to previous page',
adme => 'Add members',
);
if ((($action eq 'create') || ($action eq 'modify') || ($action eq 'delete') || ($action eq 'reenable')) &&
@@ -1140,8 +1137,8 @@ sub display_control {
sub verify_delete {
my ($r,$groupname,$formname,$action,$page,$states,$stored) = @_;
$r->print(&Apache::lonhtmlcommon::echo_form_input([]));
- $r->print(&mt("You have requested deletion of the following group: ").''.
- $stored->{'description'}.''.
+ $r->print(&mt('You have requested deletion of the group [_1].'
+ ,''.$stored->{'description'}.'').
'
'.&mt('When a group is deleted the following occurs:').'
'.
'
'.&mt('All group membership is terminated.').'
'.
'
'.&mt('The group ceases to be available either for viewing or for modification of group settings and membership.').'
'.
@@ -1169,6 +1166,7 @@ sub delete_group {
my @deleted;
my @undeleted;
my %usersettings;
+ my $context = 'deletegroup';
foreach my $key (sort(keys(%membership))) {
if ($key =~ /^\Q$groupname\E:([^:]+:[^:]+)$/) {
my $user = $1;
@@ -1178,7 +1176,8 @@ sub delete_group {
$usersettings{$groupname.':'.$user} = $now.':-1:'.$userprivs;
if (&Apache::lonnet::modify_group_roles($cdom,$cnum,
$groupname,$user,
- $now,'-1',$userprivs)
+ $now,'-1',$userprivs,
+ '',$context)
eq 'ok') {
$num_ok ++;
push(@deleted,$user);
@@ -1195,7 +1194,10 @@ sub delete_group {
\%usersettings);
}
if ($num_fail > 0) {
- $r->print(&mt('Group deletion failed because deletion of [_1] out of [_2] members failed.',$num_fail,$num_users));
+ $r->print('
'
+ .&mt('Group deletion failed because deletion of [_1] out of [_2] members failed.'
+ ,$num_fail,$num_users)
+ .'
');
} else {
my ($result,$message) =
@@ -1204,12 +1206,19 @@ sub delete_group {
if ($result eq 'ok') {
my $outcome = &modify_folders($cdom,$cnum,$groupname);
if ($outcome eq '') {
- $r->print(&mt('Group successfully deleted.'));
+ $r->print('
'
+ .&mt('Group successfully deleted.')
+ .'
');
} else {
- $r->print(&mt("Although the group was deleted, an error ([_1]) occurred when removing the group's folder from the 'Course Groups' folder.",$outcome));
+ $r->print('
'
+ .&mt("Although the group was deleted, an error occurred when removing"
+ ." the group's folder from the 'Course Groups' folder: [_1]",$outcome)
+ .'
');
}
}
return;
@@ -1220,13 +1229,15 @@ sub reenable_folder {
my $outcome;
my $crspath = '/uploaded/'.$cdom.'/'.$cnum.'/';
my $allgrpsmap = $crspath.'group_allfolders.sequence';
- my $foldertitle = &mt('Course Folder -').$description;
+ my $foldertitle = &mt('Course Folder -[_1]',$description);
my $mapurl = $crspath.'group_folder_'.
$groupname.'.sequence';
my ($errtext,$fatal)=&LONCAPA::map::mapread($allgrpsmap);
if ($fatal) {
- $outcome=&mt('Error reading contents of parent folder to group').
- " ($allgrpsmap): $errtext".' ';
+ $outcome='
'
+ .&mt('An error occurred when reading contents of parent folder to group:')
+ ." ($allgrpsmap): $errtext"
+ .'
';
} else {
my $idx=&LONCAPA::map::getresidx($mapurl);
$LONCAPA::map::resources[$idx] = $foldertitle.':'.$mapurl.
@@ -1234,8 +1245,10 @@ sub reenable_folder {
$LONCAPA::map::order[1+$#LONCAPA::map::order]=$idx;
my ($outtext,$errtext) = &LONCAPA::map::storemap($allgrpsmap,1);
if ($errtext) {
- $outcome = &mt('Error saving updated parent folder to group').
- "- $allgrpsmap - $errtext".' ';
+ $outcome='
'
+ .&mt('An error occurred when saving updated parent folder to group:'
+ ," $allgrpsmap - $errtext")
+ .'
';
} else {
my ($furl,$ferr) =
&Apache::lonuserstate::readmap($cdom.'/'.$cnum);
@@ -1246,12 +1259,18 @@ sub reenable_folder {
sub modify_folders {
my ($cdom,$cnum,$groupname) = @_;
- my $outcome;
+ my ($outcome,$groupmap,$groupmapres,$map,$id,$src);
my $navmap = Apache::lonnavmaps::navmap->new();
- my $groupmap = '/uploaded/'.$cdom.'/'.$cnum.'/'.'group_folder_'.
+ if (!defined($navmap)) {
+ $outcome = '
'.
+ &mt('Error reading course contents.').' '.
+ &mt('You need to re-initialize the course.').
+ '
';
+ return $outcome;
+ }
+ $groupmap = '/uploaded/'.$cdom.'/'.$cnum.'/'.'group_folder_'.
$groupname.'.sequence';
- my $groupmapres = $navmap->getResourceByUrl($groupmap);
- my ($map,$id,$src);
+ $groupmapres = $navmap->getResourceByUrl($groupmap);
if ($groupmapres) {
($map,$id,$src)=&Apache::lonnet::decode_symb($groupmapres->symb());
}
@@ -1260,8 +1279,10 @@ sub modify_folders {
$map = '/'.$map;
my ($errtext,$fatal) = &LONCAPA::map::mapread($map);
if ($fatal) {
- $outcome=&mt('Error reading contents of parent folder to group').
- " ($map): $errtext".' ';
+ $outcome='
'
+ .&mt('An error occurred when reading contents of parent folder to group:')
+ ." ($map): $errtext"
+ .'
';
} else {
my $idx = 0;
my $grpidx;
@@ -1284,7 +1305,10 @@ sub modify_folders {
$#LONCAPA::map::order--;
my ($outtext,$errtext) = &LONCAPA::map::storemap($map,1);
if ($errtext) {
- $outcome = &mt('Error saving updated parent folder to group'). "- $map - $errtext".' ';
+ $outcome='
'
+ .&mt('An error occurred when saving updated parent folder to group:')
+ ." $map - $errtext"
+ .'
';
} else {
my ($furl,$ferr) =
&Apache::lonuserstate::readmap($cdom.'/'.$cnum);
@@ -1298,8 +1322,8 @@ sub modify_folders {
sub verify_reenable {
my ($r,$groupname,$formname,$action,$page,$states,$stored) = @_;
$r->print(&Apache::lonhtmlcommon::echo_form_input([]));
- $r->print(&mt("You have requested enabling the following previously deleted group: ").''.
- $stored->{'description'}.''.
+ $r->print(&mt('You have requested enabling the previously deleted group [_1].'
+ ,''.$stored->{'description'}.'').
'
'.&mt('When a deleted group is re-enabled the following occurs:').'
'.
'
'.&mt('Group settings and membership at the time the group was deleted are reinstated.').'
'.
'
'.&mt('A group folder is added to the "Course Groups" folder which contains folders for all groups in the course.').'
');
@@ -1320,7 +1344,7 @@ sub reenable_group {
&Apache::longroup::coursegroups($cdom,$cnum,$groupname,
'deleted_groups');
if (keys(%groups) == 0) {
- $r->print(&mt('The group ([_1]) was not re-enabled, because it is not a deleted group. Perhaps it has already been re-enabled?',$groupname));
+ $r->print(&mt('The group [_1] was not re-enabled, because it is not a deleted group.[_2]Perhaps it has already been re-enabled?',''.$groupname.''),' ');
return;
}
my %groupinfo =
@@ -1338,6 +1362,7 @@ sub reenable_group {
my $num_users = 0;
my $num_ok = 0;
my $num_fail = 0;
+ my $context = 'reenablegroup';
my (%usersettings,@enabled,@unenabled);
my ($result,$message) =
&Apache::lonnet::toggle_coursegroup_status($cdom,$cnum,$groupname,
@@ -1357,7 +1382,8 @@ sub reenable_group {
if (&Apache::lonnet::modify_group_roles($cdom,$cnum,
$groupname,$user,
$defend,$defstart,
- $userprivs) eq 'ok') {
+ $userprivs,'',
+$context) eq 'ok') {
$num_ok ++;
push(@enabled,$user);
} else {
@@ -1373,22 +1399,34 @@ sub reenable_group {
&Apache::lonnet::modify_coursegroup_membership($cdom,$cnum,
\%usersettings);
if ($roster_result eq 'ok') {
- $r->print(&mt('Membership reinstated for [_1] users, each with start and end dates for group access set to defaults: [_2] and [_3]',$num_ok,$showstart,$showend).' ');
+ $r->print('
'
+ .&mt('Membership reinstated for [quant,_1,user], each with start and end dates for group access set to defaults: [_2] and [_3]',$num_ok,$showstart,$showend)
+ .'
');
}
} else {
- $r->print(&mt('A problem occurred when trying to reinstate [_1] of the [_2] members of the pre-existing group.',$num_fail,$num_users).' ');
+ $r->print('
'
+ .&mt('A problem occurred when trying to reinstate [_1] of the [_2] members of the pre-existing group.',$num_fail,$num_users)
+ .'
');
}
} else {
- $r->print(&mt('There were no group members to reinstate, as none were removed when the group was deleted.').' ');
+ $r->print('
'
+ .&mt('There were no group members to reinstate, as none were removed when the group was deleted.')
+ .'
');
}
my $outcome = &reenable_folder($cdom,$cnum,$groupname,$description);
if ($outcome eq '') {
- $r->print(&mt('Group successfully re-enabled.'));
+ $r->print('
'
+ .&mt('Group successfully re-enabled.')
+ .'
');
} else {
- $r->print(&mt("Although the group was re-enabled, an error ([_1]) occurred when adding the group's folder to the 'Course Groups' folder.",$outcome));
+ $r->print('
'
+ .&mt("Although the group was re-enabled, an error occurred when adding the group's folder to the 'Course Groups' folder: [_1]",$outcome)
+ .'
');
+ $r->print(&Apache::lonhtmlcommon::row_closure());
+
+ # Disk Quota
+ $r->print(&Apache::lonhtmlcommon::row_title($lt{'dquo'}));
if ($action eq 'create') {
- $r->print(&mt('If you enable the file repository for the [_1], allocate a disk quota.',$gpterm));
+ $r->print(''
+ .&mt('If you enable the group portfolio for the '.$gpterm
+ .', allocate a disk quota.')
+ .''
+ );
} else {
- $r->print(&mt('Quota allocated to file repository:'));
+ $r->print(&mt('Quota allocated to group portfolio:'));
}
- $r->print(' Mb');
+ $r->print(' '.&mt('[_1] Mb',''));
if ($action eq 'create') {
- $r->print(' '.
- &mt('A total of [_1] Mb can be divided amongst all [_2]s in the '.
- '[_3], and [_4] Mb are currently unallocated.',$crsquota,
- $gpterm,lc($crstype),sprintf("%.2f",$freespace)));
+ $r->print(' '
+ .&mt('A total of [_1] Mb can be divided amongst all '.$gpterm.'s in the '
+ .lc($crstype).', and [_2] Mb are currently unallocated.'
+ ,$crsquota,sprintf("%.2f",$freespace))
+ );
} else {
$r->print(' ('.&mt('The quota is currently [_1] Mb',
$$stored{'quota'}).').');
- $r->print(' '.&mt('The quota can be increased to [_1] Mb, '.
- 'by adding all unallocated space for [_2]s in the [_3].',
- sprintf("%.2f",$maxposs),$gpterm,lc($crstype)));
+ $r->print(' '
+ .&mt('The quota can be increased to [_1] Mb, '
+ .'by adding all unallocated space for '.$gpterm.'s in the '.lc($crstype).'.'
+ ,sprintf("%.2f",$maxposs)));
}
- $r->print('
-
-
-
-');
+ $r->print(&Apache::lonhtmlcommon::row_closure(1));
+
+ $r->print(&Apache::lonhtmlcommon::end_pick_box());
+
return;
}
@@ -1715,8 +1767,7 @@ sub membership_options {
my @sections = keys(%{$sectioncount});
- &topic_bar($r,$image,$lt{'pipa'});
- $r->print('
+ $r->print(&Apache::lonhtmlcommon::topic_bar($image,$lt{'pipa'}).'
'.$lt{'gmem'}.' '.$lt{'picr'});
if ($action eq 'create') {
$r->print($lt{'meof'}.' '.$lt{'ifno'}.' '.$lt{'asub'});
@@ -1766,7 +1817,7 @@ sub sections_selection {
}
}
my $output = '
-