--- loncom/interface/grouproster.pm 2006/08/17 23:36:05 1.4 +++ loncom/interface/grouproster.pm 2020/09/09 00:18:04 1.10.2.2 @@ -1,5 +1,7 @@ # The LearningOnline Network with CAPA # +# $Id: grouproster.pm,v 1.10.2.2 2020/09/09 00:18:04 raeburn Exp $ +# # Copyright Michigan State University Board of Trustees # # This file is part of the LearningOnline Network with CAPA (LON-CAPA). @@ -31,6 +33,7 @@ use Apache::loncommon; use Apache::lonhtmlcommon; use Apache::lonlocal; use Apache::longroup; +use Apache::lonnavmaps; use LONCAPA; use Apache::Constants qw(:common :http); use lib '/home/httpd/lib/perl/'; @@ -65,14 +68,14 @@ sub handler { # Validating group input. my $badinput; if ((!defined($env{'form.group'})) || ($env{'form.group'} eq '')) { - $r->print(&mt('No group name provided.
')); + $r->print(&mt('No group name provided.').'
'); $badinput = 1; } else { $group = $env{'form.group'}; $group =~ s/\W//g; } if (!$badinput && $group eq '') { - $r->print(&mt('Invalid group name provided.
')); + $r->print(&mt('Invalid group name provided.').'
'); $badinput = 1; } @@ -80,7 +83,7 @@ sub handler { my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; if ($cdom eq '' || $cnum eq '') { - $r->print(&mt('Invalid [_1]
',$crstype)); + $r->print(&mt('Invalid [_1]',$crstype).'
'); $badinput = 1; } @@ -106,7 +109,7 @@ sub handler { my $editgrps = &Apache::lonnet::allowed('mdg',$env{'request.course.id'}); if ((!$can_view) && (!$view_details) && (!$viewgrps) && (!$editgrps)) { - $r->print(&mt('You do not have privileges to view the membership roster in this [_1]',$gpterm)); + $r->print(&mt('You do not have privileges to view the membership roster in this '.$gpterm.'.')); return OK; } my %content = &Apache::longroup::get_group_settings($curr_groups{$group}); @@ -158,14 +161,27 @@ function changeSort(caller) { $output .= '

'.&mt('Group membership status - [_1]',$description). '

'; } else { + my $view_permission = + &Apache::lonnet::allowed('vcg',$env{'request.course.id'}.($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:'')); + my $navmap=Apache::lonnavmaps::navmap->new(); + my $grouppagelink = &Apache::longroup::get_group_link($cdom,$cnum,$group,$navmap,$view_permission,$refarg); + if ($grouppagelink) { + &Apache::lonhtmlcommon::add_breadcrumb + ({href=>$grouppagelink, + text=>&mt('Group').": $description", + title=>&mt("Go to group's home page"), + no_mt=>1},); + } else { + &Apache::lonhtmlcommon::add_breadcrumb + ({text=>&mt('Group').": $description", + no_mt=>1}); + } &Apache::lonhtmlcommon::add_breadcrumb - ({href=>"/adm/$cdom/$cnum/$group/smppg?$refarg", - text=>"$ucgpterm: $description", - title=>"Go to group's home page"}, - {href=>'/adm/grouproster?group='.$group.'&'.$refarg, - text=>"Membership roster", + ({href=>'/adm/grouproster?group='.$group.'&'.$refarg, + text=>"Membership Roster", title=>"Display group membership"},); - $output .= &Apache::lonhtmlcommon::breadcrumbs(&mt('[_1] membership status - [_2]',$gpterm,$description)); + $output .= &Apache::lonhtmlcommon::breadcrumbs(&mt('Group membership status - [_1]',$description), + undef,undef,undef,undef,1); } return $output; } @@ -212,8 +228,7 @@ sub roster_table { if (($viewgrps) || ($editgrps) || (&Apache::lonnet::allowed('vmd',$env{'request.course.id'}.'/'.$group))) { if (keys(%{$memberinfo}) == 0) { - $r->print(&mt('There are no membership data to display for this [_1]', - $gpterm)); + $r->print(&mt('There are no membership data to display for this '.$gpterm.'.')); return; } $r->print('
'.&mt('Membership status: ').'