--- loncom/interface/coursecatalog.pm 2013/03/01 18:09:16 1.73 +++ loncom/interface/coursecatalog.pm 2013/12/30 01:33:21 1.77 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler for displaying the course catalog interface # -# $Id: coursecatalog.pm,v 1.73 2013/03/01 18:09:16 raeburn Exp $ +# $Id: coursecatalog.pm,v 1.77 2013/12/30 01:33:21 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -66,13 +66,20 @@ sub handler { } my $formname = 'coursecatalog'; if ($env{'form.showdom'} ne '') { + $env{'form.showdom'} = &LONCAPA::clean_domain($env{'form.showdom'}); if (&Apache::lonnet::domain($env{'form.showdom'}) ne '') { $codedom = $env{'form.showdom'}; + } else { + $env{'form.showdom'} = ''; } } my $domdesc = &Apache::lonnet::domain($codedom,'description'); &Apache::lonhtmlcommon::clear_breadcrumbs(); + if ($env{'form.catalog_maxdepth'} ne '') { + $env{'form.catalog_maxdepth'} =~ s{\D}{}g; + } + my %domconfig = &Apache::lonnet::get_dom('configuration',['coursecategories'],$codedom); my (@cats,@trails,%allitems,%idx,@jsarray,%subcathash,$cathash); @@ -631,12 +638,12 @@ sub additional_filters { ' />'.$title.''; if ($type eq 'Previous') { my %milestonetext = &Apache::lonlocal::texthash ( - accessend => 'prior to default end access date', - enrollend => 'prior to end date for auto-enrollment', - date => 'prior to specific date:', + accessend => 'immediately prior to default end access date', + enrollend => 'immediately prior to end date for auto-enrollment', + date => 'immediately prior to specific date:', ); my @statuses = &Apache::loncommon::get_env_multiple('form.showcounts'); - $output .= ''; + $output .= ''; if ($checked) { $output .= &get_wasactive_text(); } @@ -734,9 +741,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; } @@ -944,19 +951,20 @@ sub construct_data_table { $output .= ''.&mt('Self-enroll (if permitted)').''; &Apache::loncommon::end_data_table_header_row(); my (%numbers,%creditsum); - my ($showcredits,$defofficial,$defunofficial); + my ($showcredits,$defofficial,$defunofficial,$deftextbook); my %domdefaults = &Apache::lonnet::get_domain_defaults($domain); unless ($env{'form.currcat_0'} eq 'communities::0') { - if ($domdefaults{'officialcredits'} || $domdefaults{'unofficialcredits'}) { + if ($domdefaults{'officialcredits'} || $domdefaults{'unofficialcredits'} || $domdefaults{'textbookcredits'}) { $showcredits = 1; $defofficial = $domdefaults{'officialcredits'}; - $defunofficial = $domdefaults{'unofficialcredits'}; + $defunofficial = $domdefaults{'unofficialcredits'}; + $deftextbook = $domdefaults{'textbookcredits'}; } } my %courseinfo = &build_courseinfo_hash($courses,$knownuser,$domain,$details, $usersections,\@fields,\%fieldtitles, $wasactiveon,\%numbers,\%creditsum, - $showcredits,$defofficial,$defunofficial); + $showcredits,$defofficial,$defunofficial,$deftextbook); my %Sortby; foreach my $course (sort(keys(%{$courses}))) { if ($env{'form.sortby'} eq 'code') {