--- loncom/interface/loncoursegroups.pm 2009/03/08 21:49:33 1.96
+++ loncom/interface/loncoursegroups.pm 2014/12/11 01:19:07 1.127
@@ -1,6 +1,6 @@
# The LearningOnline Network with CAPA
#
-# $Id: loncoursegroups.pm,v 1.96 2009/03/08 21:49:33 weissno Exp $
+# $Id: loncoursegroups.pm,v 1.127 2014/12/11 01:19:07 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -31,6 +31,7 @@ use strict;
use Apache::lonnet;
use Apache::loncommon();
use Apache::lonhtmlcommon();
+use Apache::lonhtmlgateway;
use Apache::lonlocal;
use Apache::lonnavmaps();
use Apache::longroup();
@@ -54,7 +55,7 @@ sub handler {
if (! ($env{'request.course.fn'})) {
# Not in a course
$env{'user.error.msg'}=
- "/adm/coursegroups:mdg:0:0:Cannot edit or view course groups";
+ "/adm/coursegroups:mdg:0:0:Cannot edit or view course/community groups";
return HTTP_NOT_ACCEPTABLE;
}
@@ -135,7 +136,7 @@ function changeSort(caller) {
function openGroupRoster(group,status) {
var url = '/adm/grouproster?';
url += 'group='+group+'&status='+status+'&ref=popup';
- var title = 'Group Membership';
+ var title = 'Group_Membership';
var options = 'scrollbars=1,resizable=1,menubar=0';
options += ',width=700,height=600';
rosterbrowser = open(url,title,options,'1');
@@ -170,7 +171,7 @@ sub display_groups {
my %actionlinks = (
modify => ' ' ''.
+ &mt('An error occurred retrieving information about resources in the course.').'
'.
+ &mt('It is recommended that you [_1]re-initialize the course[_2] and then return to this page.','','').
+ '');
+ return;
+ }
if ($manage_permission) {
if ($action ne 'reenable') {
$r->print('
'.$lt{'crng'}.'');
@@ -324,7 +333,9 @@ END
$action eq 'reenable') {
$link .= $group;
} else {
- $link .= $group.'/smppg?ref=grouplist';
+ $link .=
+ &Apache::longroup::get_group_link($cdom,$cnum,$group,$navmap);
+ $link .= (($link=~/\?/)?'&':'?').'ref=grouplist';
if (exists($env{'form.refpage'})) {
$link .= '&refpage='.$env{'form.refpage'};
}
@@ -386,16 +397,32 @@ END
$r->print('
');
my %curr_groups = &Apache::longroup::coursegroups($cdom,$cnum);
if (%curr_groups) {
+ my $navmap=Apache::lonnavmaps::navmap->new();
+ if (!defined($navmap)) {
+ $r->print('
' + .&mt('You are not currently a member of any active '.$gpterm.'s' + .' in this '.lc($crstype).'.') + .'
' + ); } } return; @@ -537,7 +564,7 @@ sub group_administration { if (ref($stored{'autorole'}) eq 'ARRAY') { foreach my $role (@{$stored{'autorole'}}) { - unless ($role eq 'cc') { + unless (($role eq 'cc') || ($role eq 'co')) { $elements{'modify'}{'change_settings'}{'sec_'.$role} = 'selectbox'; } @@ -785,7 +812,7 @@ sub group_administration { } var maxposs = '.sprintf("%.2f",$maxposs).'; if (newquota > maxposs) { - alert("The group portfolio 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.'; @@ -804,7 +831,7 @@ sub group_administration { } } if (warn_zero == 1) { - 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."); + alert("You have indicated that the group portfolio should be enabled, but you have set the repository quota to 0 MB.\nThis will prevent any upload of files.\nPlease set a value or disable the repository feature."); return; } } @@ -1086,7 +1113,7 @@ sub display_control { &add_members_form($r,$cdom,$cnum,$action,$state,$page,$startdate, $enddate,$groupname,$description,$granularity, $quota,$sectioncount,$tools,$functions,$stored, - $states,$navbuttons,$gpterm,$ucgpterm); + $states,$navbuttons,$gpterm,$ucgpterm,$crstype); } elsif ($state eq 'pick_members') { &choose_members_form($r,$cdom,$cnum,$action,$state,$page, $groupname,$description,$granularity,$quota, @@ -1119,31 +1146,36 @@ sub display_control { my %stored = &retrieve_settings($cdom,$cnum,$groupname,$action); if ($state eq 'verify') { &verify_delete($r,$groupname,$state,$action,$page,$states, - \%stored); + \%stored,$crstype); } elsif ($state eq 'result') { - &delete_group($r,$cdom,$cnum,$groupname); + &delete_group($r,$cdom,$cnum,$groupname,$crstype); } } elsif ($action eq 'reenable') { my %stored = &retrieve_settings($cdom,$cnum,$groupname,$action); if ($state eq 'verify') { &verify_reenable($r,$groupname,$state,$action,$page,$states, - \%stored); + \%stored,$crstype); } elsif ($state eq 'result') { - &reenable_group($r,$cdom,$cnum,$groupname); + &reenable_group($r,$cdom,$cnum,$groupname,$crstype); } } } sub verify_delete { - my ($r,$groupname,$formname,$action,$page,$states,$stored) = @_; + my ($r,$groupname,$formname,$action,$page,$states,$stored,$crstype) = @_; $r->print(&Apache::lonhtmlcommon::echo_form_input([])); $r->print(&mt('You have requested deletion of the group [_1].' ,''.$stored->{'description'}.''). '