--- loncom/interface/loncoursegroups.pm 2014/02/11 17:09:30 1.123
+++ loncom/interface/loncoursegroups.pm 2016/02/26 21:44:39 1.128
@@ -1,6 +1,6 @@
# The LearningOnline Network with CAPA
#
-# $Id: loncoursegroups.pm,v 1.123 2014/02/11 17:09:30 bisitz Exp $
+# $Id: loncoursegroups.pm,v 1.128 2016/02/26 21:44:39 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -328,19 +328,23 @@ END
if (!$functionality) {
$functionality = &mt('None available');
}
- my $link = $actionlinks{$action};
+ my $link;
if ($action eq 'modify' || $action eq 'delete' ||
$action eq 'reenable') {
- $link .= $group;
+ $link = $actionlinks{$action}.$group.'">'.$lt{$action}.'';
} else {
- $link .=
- &Apache::longroup::get_group_link($cdom,$cnum,$group,$navmap);
- $link .= (($link=~/\?/)?'&':'?').'ref=grouplist';
- if (exists($env{'form.refpage'})) {
- $link .= '&refpage='.$env{'form.refpage'};
- }
+ $link =
+ &Apache::longroup::get_group_link($cdom,$cnum,$group,$navmap,$view_permission);
+print STDERR "link is ||$link||\n";
+ if ($link) {
+ $link = $actionlinks{$action}.$link;
+ $link .= (($link=~/\?/)?'&':'?').'ref=grouplist';
+ if (exists($env{'form.refpage'})) {
+ $link .= '&refpage='.$env{'form.refpage'};
+ }
+ $link .= '">'.$lt{$action}.'';
+ }
}
- $link .= '">'.$lt{$action}.'';
if ($action eq 'view') {
if ($manage_permission) {
$link .= ' '.$actionlinks{'modify'}.
@@ -394,6 +398,7 @@ END
} else {
my @coursegroups = split(/:/,$env{'request.course.groups'});
if (@coursegroups > 0) {
+ my $numlinks = 0;
$r->print('
');
my %curr_groups = &Apache::longroup::coursegroups($cdom,$cnum);
if (%curr_groups) {
@@ -410,12 +415,36 @@ END
$curr_groups{$group});
my $description = &unescape(
$group_info{description});
- my $link =
- &Apache::longroup::get_group_link($cdom,$cnum,$group,$navmap).
- '&ref=grouplist';
- $r->print(''.$group,'
'.$description.'
');
+ my ($link,$hidden) =
+ &Apache::longroup::get_group_link($cdom,$cnum,$group,$navmap,$view_permission);
+print STDERR "link is ||$link||\n";
+ if ($link) {
+ $link .= '&ref=grouplist';
+ $r->print(''.
+ $description.'
');
+ $numlinks ++;
+ } elsif ($hidden) {
+ my $numtools = 0;
+ my $refarg = '&ref=grouplist';
+ my $output =
+ &Apache::longroup::display_group_links($r,$env{'form.grade_target'},$group,'view',
+ $refarg,\$numtools,$hidden,%group_info);
+ if ($numtools) {
+ $r->print(''.$description.''.
+ '
'.$output.'
');
+ $numlinks ++;
+ }
+ }
}
}
+ if (!$numlinks) {
+ $r->print(
+ '
' + .&mt('You do not currently have access to any '.$gpterm.'s' + .' in this '.lc($crstype).'.') + .'
' + ); + } } else { $r->print( '' @@ -831,7 +860,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; } } @@ -1587,7 +1616,7 @@ sub group_members { future => 0, ); my $totalmembers = 0; - foreach my $member (keys %memberhash) { + foreach my $member (keys(%memberhash)) { $totalmembers ++; my ($end,$start) = split(/:/,$memberhash{$member}); unless ($start == -1) { @@ -1702,7 +1731,7 @@ sub groupsettings_options { if ($remnum) { $halfnum ++; } - my @allfunctions = sort(keys (%{$functions})); + my @allfunctions = sort(keys(%{$functions})); $r->print(&Apache::lonhtmlcommon::row_title($lt{'func'}) .'