[LON-CAPA-cvs] cvs: loncom(version_2_11_X) /interface loncoursegroups.pm
raeburn
raeburn at source.lon-capa.org
Mon Aug 5 15:16:51 EDT 2019
raeburn Mon Aug 5 19:16:51 2019 EDT
Modified files: (Branch: version_2_11_X)
/loncom/interface loncoursegroups.pm
Log:
- For 2.11
Backport 1.128 (part).
Index: loncom/interface/loncoursegroups.pm
diff -u loncom/interface/loncoursegroups.pm:1.127.2.1 loncom/interface/loncoursegroups.pm:1.127.2.2
--- loncom/interface/loncoursegroups.pm:1.127.2.1 Sun Mar 19 17:59:15 2017
+++ loncom/interface/loncoursegroups.pm Mon Aug 5 19:16:50 2019
@@ -1,6 +1,6 @@
# The LearningOnline Network with CAPA
#
-# $Id: loncoursegroups.pm,v 1.127.2.1 2017/03/19 17:59:15 raeburn Exp $
+# $Id: loncoursegroups.pm,v 1.127.2.2 2019/08/05 19:16:50 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -335,8 +335,9 @@
$link = '<a href="'.&HTML::Entities::encode($actionlinks{$action}.$group,'<>&"').
'">'.$lt{$action}.'</a>';
} else {
- $link =
- &Apache::longroup::get_group_link($cdom,$cnum,$group,$navmap);
+ $link =
+ &Apache::longroup::get_group_link($cdom,$cnum,$group,$navmap,
+ $view_permission);
if ($link) {
$link = '<a href="'.$link;
$link .= (($link=~/\?/)?'&':'?').'ref=grouplist';
@@ -400,6 +401,7 @@
} else {
my @coursegroups = split(/:/,$env{'request.course.groups'});
if (@coursegroups > 0) {
+ my $numlinks = 0;
$r->print('<br /><br />');
my %curr_groups = &Apache::longroup::coursegroups($cdom,$cnum);
if (%curr_groups) {
@@ -416,12 +418,36 @@
$curr_groups{$group});
my $description = &unescape(
$group_info{description});
- my $link =
- &Apache::longroup::get_group_link($cdom,$cnum,$group,$navmap).
- '&ref=grouplist';
- $r->print('<span style="font-size: larger"><a href="'.$link.'">'.$group,'</a></span><br /><small>'.$description.'</small><br /><br />');
+ my ($link,$hidden) =
+ &Apache::longroup::get_group_link($cdom,$cnum,$group,$navmap,
+ $view_permission);
+ if ($link) {
+ $link .= '&ref=grouplist';
+ $r->print('<span style="font-size: larger"><a href="'.$link.'">'.
+ $description.'</a></span><br /><br />');
+ $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('<span style="font-size: larger">'.$description.'</a></span>'.
+ '<br />'.$output.'<br /><br />');
+ $numlinks ++;
+ }
+ }
}
}
+ if (!$numlinks) {
+ $r->print(
+ '<p class="LC_info">'
+ .&mt('You do not currently have access to any '.$gpterm.'s'
+ .' in this '.lc($crstype).'.')
+ .'</p>'
+ );
+ }
} else {
$r->print(
'<p class="LC_info">'
More information about the LON-CAPA-cvs
mailing list