'
@@ -1727,19 +1763,19 @@ sub groupsettings_options {
} else {
$r->print(&mt('Quota allocated to group portfolio:'));
}
- $r->print(' '.&mt('[_1] Mb','
'));
+ $r->print(' '.&mt('[_1] MB','
'));
if ($action eq 'create') {
$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.'
+ .&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',
+ $r->print(' ('.&mt('The quota is currently [_1] MB',
$$stored{'quota'}).').');
$r->print('
'
- .&mt('The quota can be increased to [_1] Mb, '
+ .&mt('The quota can be increased to [_1] MB, '
.'by adding all unallocated space for '.$gpterm.'s in the '.lc($crstype).'.'
,sprintf("%.2f",$maxposs)));
}
@@ -1786,7 +1822,6 @@ sub membership_options {
} else {
$lt{'asub'} = &mt('A subsequent step will also allow you to specify automatic adding/dropping of group members triggered by specified user role and section [_1]changes[_2] in the course.','
',' ');
}
-
my %status_types = (
active => &mt('Currently has access'),
previous => &mt('Previously had access'),
@@ -1805,7 +1840,6 @@ sub membership_options {
$r->print(&Apache::lonhtmlcommon::topic_bar($image,$lt{'pipa'}).'
'.$lt{'gmem'}.' ');
-
if ($action eq 'create') {
$r->print($lt{'picr'}.'
'.$lt{'ifno'}.'
'.$lt{'asub'});
} else {
@@ -1989,10 +2023,10 @@ sub print_current_settings {
dfac => 'Default access dates',
ygrs => "Your group selections - ",
tfwa => "The following settings will apply to the group:",
- difn => 'Different collaborative tools
for different members:',
stda => 'Start date:',
enda => 'End date:',
);
+ $lt{'difn'} = &mt('Different collaborative tools[_1]for different members:','
');
my $showstart = &Apache::lonlocal::locallocaltime($startdate);
my $showend;
if ($enddate == 0) {
@@ -2042,7 +2076,7 @@ sub print_current_settings {
$r->print('');
}
- my $quota_text=&mt('[_1] Mb',$quota);
+ my $quota_text=&mt('[_1] MB',$quota);
my $granu_text=&mt($granularity);
$r->print(<<"END");
@@ -2104,7 +2138,7 @@ sub pick_new_members {
&check_uncheck_buttons($r,$formname,'member',$lt{'addm'});
if (@{$available} > 0 && $granularity eq 'Yes') {
$r->print('
- '.$lt{'setf'}.'
+ '.$lt{'setf'}.'
@@ -2232,11 +2266,12 @@ sub privilege_specificity {
"for users who receive specific sections/roles in the course ",
'asyo' => "As you have chosen not to include any collaborative tools ".
"in the group, no default optional privileges need to be set.",
- 'plin' => 'Indicate which optional privileges members '.
'will receive by default for a specific tool.',
'oppr' => 'Optional privileges',
'defp' => 'The default privileges new members will receive are:',
);
+ $lt{'plin'} = &mt('Indicate which [_1]optional[_2] privileges members '.
+ 'will receive by default for a specific tool.','',' ');
if ($crstype eq 'Community') {
$lt{'thes'} = &mt('These will be the privileges given to members assigned in the future via automatic group assignment for users who receive specific sections/roles in the community ');
}
@@ -2520,6 +2555,7 @@ sub current_membership {
'actn' => 'Action?',
'name' => 'Name',
'usnm' => 'Username',
+ 'stid' => 'ID',
'doma' => 'Domain',
'stda' => 'Start Date',
'enda' => 'End Date',
@@ -2557,7 +2593,7 @@ sub current_membership {
$r->print('
- '.$lt{'curf'}.'
+ '.$lt{'curf'}.'
@@ -2581,7 +2617,7 @@ END
$lt{'name'}
$lt{'usnm'}
$lt{'doma'}
- ID
+ $lt{'ID'}
$lt{'stda'}
$lt{'enda'}
END
@@ -2705,7 +2741,10 @@ END
}
$r->print(&Apache::loncommon::end_data_table());
} else {
- $r->print(&mt('There are no active, future or previous group members to modify.'));
+ $r->print(
+ ''
+ .&mt('There are no active, future or previous group members to modify.')
+ .'
');
}
return $numcurrent;
}
@@ -2715,7 +2754,7 @@ sub check_uncheck_buttons {
$r->print('
- '.$title.'
+ '.$title.'
@@ -2773,7 +2812,7 @@ sub change_privs_form {
}
}
if (!$exp_or_del) {
- $r->print($lt{'nome'}.' ');
+ $r->print(''.$lt{'nome'}.'
');
}
$r->print(&Apache::lonhtmlcommon::topic_bar(4,&mt('Setting optional privileges for specific group members')));
@@ -2795,7 +2834,7 @@ sub change_privs_form {
sub add_members_form {
my ($r,$cdom,$cnum,$action,$formname,$page,$startdate,$enddate,$groupname,
$description,$granularity,$quota,$sectioncount,$tools,$functions,
- $stored,$states,$navbuttons,$gpterm,$ucgpterm,$crstype)=@_;
+ $stored,$states,$navbuttons,$gpterm,$ucgpterm,$crstype)=@_;
$r->print(' ');
my @available = ();
my @unavailable = ();
@@ -3015,7 +3054,7 @@ sub member_privileges_form {
$r->print(' ');
}
$r->print(
- ''.&mt($$toolprivs{$tool}{$priv}).' '
+ ''.&mt($$toolprivs{$tool}{$priv}).' '
.''
.' '
@@ -3169,7 +3208,7 @@ sub write_group_data {
$quota = 0;
$r->print(''
.&mt('The value you entered for the quota for the group portfolio in this '.$gpterm
- .' contained invalid characters, so it has been set to 0 Mb. You can change this by'
+ .' contained invalid characters, so it has been set to 0 MB. You can change this by'
.' modifying the '.$gpterm.' settings.')
.'
');
}
@@ -3177,7 +3216,7 @@ sub write_group_data {
$quota = $maxposs;
$r->print(''
.&mt('The value you entered for the quota for the group portfolio in this '.$gpterm
- .' exceeded the maximum possible value, so it has been set to [_1] Mb '
+ .' exceeded the maximum possible value, so it has been set to [_1] MB '
.'(the maximum possible value).',sprintf("%.2f",$maxposs))
.'
');
}
@@ -3245,15 +3284,15 @@ sub write_group_data {
$description,$tools,\%groupinfo,
$gpterm,$ucgpterm,$crstype);
if ($result eq 'ok') {
- $r->print(''
- .&mt($ucgpterm.' [_1] was created.',''.$groupname.' ')
- .'
');
+ my $msg = &Apache::lonhtmlcommon::confirm_success(&mt($ucgpterm.' [_1] was created.',''.$groupname.' '));
+ $msg = &Apache::loncommon::confirmwrapper($msg);
+ $r->print($msg);
} else {
- $r->print(''
- .&mt('A problem occurred when creating folders for the new '.$gpterm.' [_1]:'
- ,''.$groupname.' ')
- .' '.$result
- .'
');
+ my $msg = &Apache::lonhtmlcommon::confirm_success(&mt('A problem occurred when creating folders for the new '.$gpterm.' [_1]:'
+ ,''.$groupname.' ')
+ .' '.$result,1);
+ $msg = &Apache::loncommon::confirmwrapper($msg);
+ $r->print($msg);
}
} elsif ($action eq 'modify') {
my (@oldtools,@newtools);
@@ -3299,8 +3338,8 @@ sub write_group_data {
} else {
if ($crstype eq 'Community') {
$error = &mt("An error occurred while setting parameters '.
- 'for Discussion Boards folder: '.
- 'Could not retrieve community information");
+ 'for Discussion Boards folder: '.
+ 'Could not retrieve community information");
} else {
$error = &mt("An error occurred while setting parameters '.
'for Discussion Boards folder: '.
@@ -3324,9 +3363,9 @@ sub write_group_data {
$r->print(''.$error.'
');
}
}
- $r->print(''
- .&mt($ucgpterm.' [_1] was updated.',''.$groupname.' ')
- .'
');
+ my $message = &Apache::lonhtmlcommon::confirm_success(&mt($ucgpterm.' [_1] was updated.',''.$groupname.' '));
+ $message = &Apache::loncommon::confirmwrapper($message);
+ $r->print($message);
}
} else {
my %actiontype = (
@@ -3336,10 +3375,10 @@ sub write_group_data {
&Apache::lonnet::logthis("Failed to store $gpterm $groupname ".
'in '.lc($crstype).': '.$cnum.
' in domain: '.$cdom);
- $r->print(''
- .&mt('An error occurred when [_1] the '.$gpterm.'. '
- .'Please try again.',$actiontype{$action})
- .'
');
+ $r->print(''
+ .&mt('An error occurred when '.$actiontype{$action}.' the '.$gpterm.'. '
+ .'Please try again.')
+ .'
print(&mt('The following users were successfully [_1]',$type));
+ my $msgall ='';
+ foreach my $type (sort(keys(%added))) {
+ my $message;
+ my $tmsg = "The following users were successfully $type";
if (!($type eq 'deleted' || $type eq 'expired')) {
- $r->print(&mt(' with the following privileges'));
+ $tmsg .= ' with the following privileges';
}
- $r->print(': ');
+ $message .= &mt($tmsg.':').' ';
foreach my $user (@{$added{$type}}) {
my $privlist = '';
if (!($type eq 'deleted' || $type eq 'expired')) {
@@ -3525,10 +3566,14 @@ sub process_membership {
}
$privlist =~ s/, $//;
}
- $r->print($$userdata{$user}[$$idx{fullname}].' - '.$user.$privlist.' ');
+ $message .= $$userdata{$user}[$$idx{fullname}].' - '.$user.$privlist.' ';
}
- $r->print(' ');
+ $message .= ' ';
+ $message = &Apache::lonhtmlcommon::confirm_success($message);
+ $msgall .= $message;
}
+ $msgall = &Apache::loncommon::confirmwrapper($msgall);
+ $r->print($msgall);
}
if ($num_fail) {
foreach my $type (sort(keys(%failed))) {
@@ -3541,13 +3586,15 @@ sub process_membership {
}
$r->print(' ');
}
- if (@unchanged > 0) {
- $r->print(&mt('No change occurred for the following users:').' ');
- foreach my $user (sort(@unchanged)) {
- $r->print($$userdata{$user}[$$idx{fullname}].' - '.$user.' ');
- }
- $r->print(' ');
- }
+# Is that really needed?
+#
+# if (@unchanged > 0) {
+# $r->print(&mt('No change occurred for the following users:').' ');
+# foreach my $user (sort(@unchanged)) {
+# $r->print($$userdata{$user}[$$idx{fullname}].' - '.$user.' ');
+# }
+# $r->print(' ');
+# }
if ($roster_result eq 'ok') {
$r->print(''
.&mt($ucgpterm.' membership list updated.')
@@ -3555,8 +3602,8 @@ sub process_membership {
$r->print('
');
if ($crstype eq 'Community') {
$r->print(&mt("Any currently logged in community 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.'
+ .' 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.' '));
} else {
@@ -3711,36 +3758,32 @@ sub standard_roles {
sub modify_menu {
my ($r,$groupname,$page,$gpterm) = @_;
my @menu =
- (
- { text => "Modify default $gpterm settings",
- help => 'Course_Modify_Group',
- state => 'change_settings',
- branch => 'settings',
+ ( { categorytitle =>'Group Actions',
+ items => [
+
+ { linktext => "Modify default $gpterm settings",
+ url => '/adm/coursegroups?action=modify&refpage='.$env{'form.refpage'}.'&groupname='.$groupname.'&state=change_settings&branch=settings',
+ icon => 'grp_settings.png',
+ alttext => "Modify default $gpterm settings",
+ permission => '1',
+ help => 'Course_Modify_Group',
},
- { text => 'Modify access, tools and/or privileges for previous, '.
- 'future, or current members',
+ { linktext => 'Modify access, tools and privileges for members',
+ url => '/adm/coursegroups?action=modify&refpage='.$env{'form.refpage'}.'&groupname='.$groupname.'&state=change_members&branch=members',
+ icon => 'grp_tools.png',
+ alttext => 'Modify access, tools and privileges for members',
+ permission => '1',
help => 'Course_Modify_Group_Membership',
- state => 'change_members',
- branch => 'members',
},
- { text => "Add member(s) to the $gpterm",
+ { linktext => "Add member(s) to the $gpterm",
+ url => '/adm/coursegroups?action=modify&refpage='.$env{'form.refpage'}.'&groupname='.$groupname.'&state=add_members&branch=adds',
+ icon => 'grp_add.png',
+ alttext => "Add member(s) to the $gpterm",
+ permission => '1',
help => 'Course_Group_Add_Members',
- state => 'add_members',
- branch => 'adds',
- },
- );
- my $menu_html = '';
- foreach my $menu_item (@menu) {
- $menu_html .=
- '
';
- $menu_html.= &mt($menu_item->{'text'}).' ';
- if (exists($menu_item->{'help'})) {
- $menu_html.=
- &Apache::loncommon::help_open_topic($menu_item->{'help'});
- }
- $menu_html.='
'.$/;
- }
- $r->print($menu_html);
+ }]}
+ );
+ $r->print(&Apache::lonhtmlcommon::generate_menu(@menu));
return;
}
@@ -4008,7 +4051,7 @@ sub map_updater {
$LONCAPA::map::resources[$newidx] = $itemtitle.':'.$newmapurl.
':false:normal:res';
$LONCAPA::map::order[1+$#LONCAPA::map::order]=$newidx;
- my ($outtext,$errtext) = &LONCAPA::map::storemap($parentmap,1);
+ my ($outtext,$errtext) = &LONCAPA::map::storemap($parentmap,1,1);
if ($errtext) {
$outcome = '
'
.&mt('Error saving updated parent folder.')." ($parentmap): $errtext"
@@ -4089,10 +4132,9 @@ sub create_homepage {
my ($cdom,$cnum,$name,$groupinfo,$tools,$gpterm,$ucgpterm,$now) = @_;
my $functionality = join(',',@{$tools});
my $content = &unescape($$groupinfo{description});
- $content=~s/\s+$//s;
- $content=~s/^\s+//s;
- $content=~s/\ $//s;
- $content=&Apache::lonfeedback::clear_out_html($content,1);
+ chomp($content);
+ my $gateway = Apache::lonhtmlgateway->new();
+ $content = $gateway->process_incoming_html($content,1);
my %pageinfo = (
'aaa_title' => "$ucgpterm: $name",
@@ -4152,43 +4194,40 @@ sub validate_groupname {
}
my %lt = &Apache::lonlocal::texthash (
igna => "Invalid $gpterm name",
- tgne => "The $gpterm name entered ",
grna => "$ucgpterm names and section names used in a ".
"$crstype must be unique.",
- isno => "is not a valid name.",
gnmo => "$ucgpterm names may only contain letters, ".
"numbers or underscores.",
- cnnb => "can not be used as it is the name of ",
- inth => " in this $crstype",
- thgr => "- does not correspond to the name of an ".
- "existing $gpterm",
);
- my $exitmsg = ''.$lt{'igna'}.' '.
- $lt{'tgne'}.' "'.$groupname.'" ';
- my $dupmsg = $lt{'grna'};
- my $earlyout;
+ my $exitmsg = ''.$lt{'igna'}.' ';
+ my $nameshown = &Apache::loncommon::cleanup_html($groupname);
if (($groupname eq '') || ($groupname =~ /\W/)) {
- $earlyout = $exitmsg.$lt{'isno'}.' '.$lt{'gnmo'};
- return $earlyout;
+ return $exitmsg.
+ &mt("The $gpterm name entered '[_1]' is not a valid name.",$nameshown).
+ ' '.$lt{'gnmo'};
+ } elsif ($groupname eq 'syllabus') {
+ return $exitmsg.
+ &mt("The $gpterm name entered '[_1]' is reserved for use by LON-CAPA.",$nameshown);
}
if (exists($sectioncount{$groupname})) {
- return $exitmsg.$lt{'cnnb'}.&mt('a section').$lt{'inth'}.
- ' '.$lt{'grna'};
+ return $exitmsg.
+ &mt("The $gpterm name entered '[_1]' can not be used as it is the name of a section in this $crstype.",$nameshown).
+ ' '.$lt{'grna'};
}
if ($action eq 'create') {
if (exists($curr_groups{$groupname})) {
- return $exitmsg.$lt{'cnnb'}.&mt('an existing [_1]',$gpterm).
- $lt{'inth'}.'. '.$lt{'grna'};
+ return $exitmsg.
+ &mt("The $gpterm name entered '[_1]' can not be used as it is the name of an existing $gpterm in this $crstype.",$nameshown).
+ ' '.$lt{'grna'};
} elsif (exists($deleted_groups{$groupname})) {
- return $exitmsg.$lt{'cnnb'}.&mt('a [_1] which previously existed',$gpterm).
- $lt{'inth'}.'. '.$lt{'grna'};
+ return $exitmsg.
+ &mt("The $gpterm name entered '[_1]' can not be used as it is the name of a $gpterm which previously existed in this $crstype.",$nameshown).
+ ' '.$lt{'grna'};
}
} elsif ($action eq 'modify') {
unless(exists($curr_groups{$groupname})) {
- $earlyout = &mt('[_1] name:',$ucgpterm).' '.$groupname.$lt{'thgr'}.
- $lt{'inth'};
- return $earlyout;
+ return &mt("$ucgpterm name: [_1] does not correspond to the name of an existing $gpterm in this $crstype.",$nameshown);
}
}
return;
@@ -4233,3 +4272,4 @@ sub check_changes {
}
1;
+