--- loncom/interface/loncoursegroups.pm 2017/03/19 17:59:15 1.127.2.1 +++ loncom/interface/loncoursegroups.pm 2023/09/04 19:14:29 1.127.2.3.2.1 @@ -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.3.2.1 2023/09/04 19:14:29 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -36,6 +36,7 @@ use Apache::lonlocal; use Apache::lonnavmaps(); use Apache::longroup(); use Apache::portfolio(); +use Apache::lonuserutils(); use Apache::Constants qw(:common :http); use HTML::Entities; use LONCAPA::map(); @@ -335,8 +336,9 @@ END $link = ''.$lt{$action}.''; } 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 = ''.$group,'
'.$description.'

'); + my ($link,$hidden) = + &Apache::longroup::get_group_link($cdom,$cnum,$group,$navmap, + $view_permission); + 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( '

' @@ -915,7 +942,8 @@ function changeSort(caller) { if ($env{'form.refpage'} eq 'grouplist') { &Apache::lonhtmlcommon::add_breadcrumb ({href=>"/adm/$cdom/$cnum/$env{'form.groupname'}/smppg?ref=grouplist", - text=>"Group: $description",}); + text=>&mt('Group').": $description", + no_mt=>1}); } } @@ -1791,7 +1819,24 @@ sub get_quota_constraints { my ($crsquota,$freespace,$maxposs); $crsquota = $env{'course.'.$env{'request.course.id'}.'.internal.coursequota'}; if ($crsquota eq '') { - $crsquota = 20; + my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; + my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; + my $crstype = &Apache::loncommon::course_type(); + my %domdefs = &Apache::lonnet::get_domain_defaults($cdom); + my %coursehash = ( + 'internal.coursecode' => $env{'course.'.$env{'request.course.id'}.'.internal.coursecode'}, + 'internal.textbook' => $env{'course.'.$env{'request.course.id'}.'.internal.textbook'}, + ); + my %staticdefaults = ( + coursequota => 20, + ); + my $quotatype = &Apache::lonuserutils::get_extended_type($cdom,$cnum,$crstype,\%coursehash); + if ($crsquota eq '') { + $crsquota = $domdefs{$quotatype.'coursequota'}; + if ($crsquota eq '') { + $crsquota = $staticdefaults{'coursequota'}; + } + } } $freespace = $crsquota - &Apache::longroup::sum_quotas(); if ($action eq 'create') {