--- loncom/interface/coursecatalog.pm 2008/06/30 04:07:06 1.33 +++ loncom/interface/coursecatalog.pm 2008/07/04 15:40:04 1.34 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler for displaying the course catalog interface # -# $Id: coursecatalog.pm,v 1.33 2008/06/30 04:07:06 raeburn Exp $ +# $Id: coursecatalog.pm,v 1.34 2008/07/04 15:40:04 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -341,13 +341,12 @@ sub cat_header { text=>"Select courses"}); $r->print(&Apache::lonhtmlcommon::breadcrumbs('Select courses')); } - $r->print(''. - ''. - '
'.&mt('Domain:').''. + $r->print(''. + ''. - ''. - $catlinks.'
'.&mt('Domain:').''. &Apache::loncommon::select_dom_form($codedom,'showdom','',1). - ' 
'); + ' 
'. + '
'. + ''.$catlinks.'
'); return; } @@ -383,7 +382,7 @@ sub category_breadcrumbs { if (ref($cats[0]) eq 'ARRAY') { if ((@{$cats[0]} == 1) && ($cats[0][0] eq 'instcode')) { $catlinks .= &mt('Official courses (with institutional codes)'). - ''; + ''; $env{'form.currcat_0'} = 'instcode::0'; } else { $catlinks .= ''; + ''; $env{'form.currcat_0'} = 'instcode::0'; } } else { @@ -860,7 +859,7 @@ sub build_courseinfo_hash { if ( defined($coursehash{'default_enrollment_end_date'}) ) { $endaccess = &Apache::lonlocal::locallocaltime($coursehash{'default_enrollment_end_date'}); if ($coursehash{'default_enrollment_end_date'} == 0) { - $endaccess = "No ending date"; + $endaccess = &mt('No ending date'); } } if ($startaccess) { @@ -869,6 +868,33 @@ sub build_courseinfo_hash { if ($endaccess) { $accessdates .= &mt('To: ').$endaccess.'
'; } + if (($selfenroll_types ne '') && + ($selfenroll_end > 0 && $selfenroll_end > $now)) { + my ($selfenroll_start_access,$selfenroll_end_access); + if (($coursehash{'default_enrollment_start_date'} ne + $coursehash{'internal.selfenroll_start_access'}) || + ($coursehash{'default_enrollment_end_date'} ne + $coursehash{'internal.selfenroll_end_access'})) { + if ( defined($coursehash{'internal.selfenroll_start_access'}) ) { + $selfenroll_start_access = &Apache::lonlocal::locallocaltime($coursehash{'internal.selfenroll_start_access'}); + } + if ( defined($coursehash{'default_enrollment_end_date'}) ) { + $selfenroll_end_access = &Apache::lonlocal::locallocaltime($coursehash{'internal.selfenroll_end_access'}); + if ($coursehash{'internal.selfenroll_end_access'} == 0) { + $selfenroll_end_access = &mt('No ending date'); + } + } + if ($selfenroll_start_access || $selfenroll_end_access) { + $accessdates .= '

'.&mt('Self-enrollers:').'
'; + if ($selfenroll_start_access) { + $accessdates .= &mt('From: ').$selfenroll_start_access.'
'; + } + if ($selfenroll_end_access) { + $accessdates .= &mt('To: ').$selfenroll_end_access.'
'; + } + } + } + } $courseinfo{$course}{'access'} = $accessdates; } if ($xlist_items eq '') {