'.&print_course_listing($codedom).' ');
- }
+ }
}
$r->print(&Apache::loncommon::end_page());
return OK;
@@ -236,6 +236,13 @@ function setCourseId(caller) {
''."\n".''."\n".
''
);
+ if (&user_is_dc($codedom)) {
+ my $showdetails_status;
+ if ($env{'form.showdetails'}) {
+ $showdetails_status = 'checked="checked" ';
+ }
+ $r->print('
'.&mt('Show full details for each course (DC only)').'
');
+ }
$r->print('');
if ($numtitles > 4) {
$r->print('
'.$codetitles[$numtitles-1].' '."\n".
@@ -252,6 +259,18 @@ function setCourseId(caller) {
return;
}
+sub user_is_dc {
+ my ($codedom) = @_;
+ if (exists($env{'user.role.dc./'.$codedom.'/'})) {
+ my $livedc = 1;
+ my $now = time;
+ my ($start,$end)=split(/\./,$env{'user.role.dc./'.$codedom.'/'});
+ if ($start && $start>$now) { $livedc = 0; }
+ if ($end && $end <$now) { $livedc = 0; }
+ return $livedc;
+ }
+ return;
+}
sub recurse_options {
my ($currkey,$currlist,$level,$cat,$cat_options,$data,$by_year,$by_sem,$by_dept) = @_;
@@ -366,6 +385,12 @@ sub print_course_listing {
my $output;
my %courses;
my $knownuser = &user_is_known();
+ my $details = $env{'form.coursenum'};
+ if (&user_is_dc($domain)) {
+ if ($env{'form.showdetails'}) {
+ $details = 1;
+ }
+ }
if ($env{'form.coursenum'} ne '') {
%courses = &Apache::lonnet::courseiddump($domain,'.',1,'.','.',
$env{'form.coursenum'},
@@ -380,19 +405,19 @@ sub print_course_listing {
$output = &mt('No courses match the criteria you selected.');
return $output;
}
- if ($knownuser) {
+ if ($knownuser && !$env{'form.showdetails'}) {
$output = &mt('Note for students: 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.