';
if ($checked) {
$output .= &get_wasactive_text();
}
@@ -707,6 +913,22 @@ sub user_is_dc {
return;
}
+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;
+}
+
sub get_statustitles {
my ($caller) = @_;
my @status_order = ('Active','Future','Previous');
@@ -734,9 +956,9 @@ sub get_statustitles {
sub get_wasactive_text {
my $wasacctext = ' -- ';
if ($env{'form.currcat_0'} eq 'communities::0') {
- $wasacctext .= &mt('where members had access ...');
+ $wasacctext .= &mt('where member access status was current ...');
} else {
- $wasacctext .= &mt('where students had access ...');
+ $wasacctext .= &mt('where student access status was current ...');
}
return $wasacctext;
}
@@ -788,6 +1010,8 @@ sub search_courselist {
}
if ($env{'form.currcat_0'} eq 'communities::0') {
$typefilter = 'Community';
+ } elsif ($env{'form.currcat_0'} eq 'placement::0') {
+ $typefilter = 'Placement';
} else {
$typefilter = '.';
}
@@ -800,12 +1024,13 @@ sub search_courselist {
}
sub print_course_listing {
- my ($domain,$numtitles,$trails,$allitems,$subcats,$codetitles) = @_;
+ my ($domain,$numtitles,$trails,$allitems,$subcats,$codetitles,$canviewall) = @_;
my $output;
my %courses;
my $knownuser = &user_is_known();
+ my $canviewall = &canview_all();
my $details = $env{'form.coursenum'};
- if (&user_is_dc($domain)) {
+ if (&user_is_dc($domain) || $canviewall) {
if ($env{'form.showdetails'}) {
$details = 1;
}
@@ -815,11 +1040,15 @@ sub print_course_listing {
$env{'form.coursenum'},
undef,undef,'.',1);
if (keys(%courses) == 0) {
+ $output = '';
if ($env{'form.currcat_0'} eq 'communities::0') {
$output .= &mt('The courseID provided does not match a community in this domain.');
- } else {
+ } elsif ($env{'form.currcat_0'} eq 'placement::0') {
+ $output .= &mt('The courseID provided does not match a placement test in this domain.');
+ } else {
$output .= &mt('The courseID provided does not match a course in this domain.');
}
+ $output .= '
';
return $output;
}
} else {
@@ -829,30 +1058,26 @@ sub print_course_listing {
%courses = &search_courselist($domain,$subcats);
}
if (keys(%courses) == 0) {
+ $output = '';
if ($env{'form.currcat_0'} eq 'communities::0') {
- $output =
- '
'
- .&mt('No communities match the criteria you selected.')
- .'
';
+ $output .= &mt('No communities match the criteria you selected.');
+ } elsif ($env{'form.currcat_0'} eq 'placement::0') {
+ $output .= &mt('No placement tests match the criteria you selected.');
} else {
- $output =
- ''
- .&mt('No courses match the criteria you selected.')
- .'
';
+ $output .= &mt('No courses match the criteria you selected.');
}
+ $output .= '';
return $output;
}
- if (($knownuser) && (!$env{'form.showdetails'}) && (!&user_is_dc($domain))) {
+ if (($knownuser) && (!$env{'form.showdetails'}) && (!&user_is_dc($domain)) && (!$canviewall)) {
$output = ''.&mt('Note for students:').' '
.&mt('If you are officially enrolled in a course but the course is not listed in your LON-CAPA courses, click the "Show more details" link for the specific course and check the default access dates and/or automated enrollment settings.')
.'
';
}
}
my $now = time;
- my %domconfig =
- &Apache::lonnet::get_dom('configuration',['usercreation'],$domain);
$output .= &construct_data_table($knownuser,$domain,\%courses,$details,undef,
- $now,\%domconfig,$trails,$allitems);
+ $now,$trails,$allitems,$canviewall);
$output .= "\n".'