--- loncom/interface/coursecatalog.pm 2016/04/04 01:09:47 1.89 +++ loncom/interface/coursecatalog.pm 2016/10/05 13:36:53 1.90 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler for displaying the course catalog interface # -# $Id: coursecatalog.pm,v 1.89 2016/04/04 01:09:47 raeburn Exp $ +# $Id: coursecatalog.pm,v 1.90 2016/10/05 13:36:53 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -80,7 +80,7 @@ sub handler { my %domconfig = &Apache::lonnet::get_dom('configuration',['coursecategories'],$codedom); my $knownuser = &user_is_known(); - my $canviewall = &canview_all(); + my $canviewall = &canview_all($knownuser,$codedom); my ($cathash,$cattype); if (ref($domconfig{'coursecategories'}) eq 'HASH') { @@ -754,7 +754,6 @@ sub additional_filters { $showhidden_status = 'checked="checked" '; } my @currstatuses = &Apache::loncommon::get_env_multiple('form.showcounts'); - my $dc_title = &Apache::lonnet::plaintext('dc'); my ($details_text,$hidden_text,$statusdisplay,$cellborder); my $wasactivedisplay = 'none'; if ($env{'form.showdetails'}) { @@ -768,14 +767,14 @@ sub additional_filters { $cellborder = 'border-left: 0px'; } if ($env{'form.currcat_0'} eq 'communities::0') { - $details_text = &mt('Show full details for each community ([_1] only)',$dc_title); - $hidden_text = &mt('Include communities set to be hidden from catalog ([_1] only)',$dc_title); + $details_text = &mt('Show full details for each community (domain staff only)'); + $hidden_text = &mt('Include communities set to be hidden from catalog (domain staff only)'); } elsif ($env{'form.currcat_0'} eq 'placement::0') { - $details_text = &mt('Show full details for each placement test ([_1] only)',$dc_title); - $hidden_text = &mt('Include placement tests set to be hidden from catalog ([_1] only)',$dc_title); + $details_text = &mt('Show full details for each placement test (domain staff only)'); + $hidden_text = &mt('Include placement tests set to be hidden from catalog (domain staff only)'); } else { - $details_text = &mt('Show full details for each course ([_1] only)',$dc_title); - $hidden_text = &mt('Include courses set to be hidden from catalog ([_1] only)',$dc_title); + $details_text = &mt('Show full details for each course (domain staff only)'); + $hidden_text = &mt('Include courses set to be hidden from catalog (domain staff only)'); } if ($is_dc) { $output .= ''. @@ -890,12 +889,17 @@ sub user_is_dc { } sub canview_all { + my ($knownuser,$codedom) = @_; my $canviewall = 0; my $page = 'coursecatalog'; if (&LONCAPA::lonauthcgi::can_view($page)) { $canviewall = 1; } elsif (&LONCAPA::lonauthcgi::check_ipbased_access($page)) { $canviewall= 1; + } elsif (($knownuser) && ($codedom ne '')) { + if (&Apache::lonnet::allowed('dcd',$codedom)) { + $canviewall = 1; + } } return $canviewall; }