--- loncom/interface/lonmodifycourse.pm 2009/02/19 22:03:13 1.42 +++ loncom/interface/lonmodifycourse.pm 2009/10/23 16:14:43 1.47 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # handler for DC-only modifiable course settings # -# $Id: lonmodifycourse.pm,v 1.42 2009/02/19 22:03:13 schafran Exp $ +# $Id: lonmodifycourse.pm,v 1.47 2009/10/23 16:14:43 bisitz Exp $ # # Copyright Michigan State University Board of Trustees # @@ -118,20 +118,34 @@ sub print_course_search_page { &print_header($r); my $filterlist = ['descriptfilter', 'instcodefilter','ownerfilter', - 'ownerdomfilter','coursefilter']; + 'coursefilter']; my $filter = {}; - my $type = 'Course'; + my ($numtitles,$type,$cctitle,$dctitle); + $type = $env{'form.type'}; + if (!defined($env{'form.type'})) { + $type = 'Course'; + } my $action = '/adm/modifycourse'; - my $cctitle = &Apache::lonnet::plaintext('cc',$type); - my $dctitle = &Apache::lonnet::plaintext('dc'); - $r->print( - '

'.&mt('Search for a course in the [_1] domain',$domdesc).'

'. - &mt('Actions available after searching for a course:').''); + $cctitle = &Apache::lonnet::plaintext('cc',$type); + $dctitle = &Apache::lonnet::plaintext('dc'); + $r->print(&Apache::lonpickcourse::js_changer()); + if ($type eq 'Course') { + $r->print( + '

'.&mt('Search for a course in the [_1] domain',$domdesc).'

'. + &mt('Actions available after searching for a course:').''); + } else { + $r->print( + '

'.&mt('Search for a community in the [_1] domain',$domdesc).'

'. + &mt('Actions available after searching for a community:').''); + } $r->print(&Apache::lonpickcourse::build_filters($filterlist,$type, - undef,undef,$filter,$action,'modifycourse')); + undef,undef,$filter,$action,\$numtitles,'modifycourse')); } sub print_course_selection_page { @@ -144,18 +158,20 @@ sub print_course_selection_page { 'ownerdomfilter','coursefilter']; my %filter; my $type = $env{'form.type'}; - if ($type eq '') { + if (!defined($type)) { $type = 'Course'; } my $action = '/adm/modifycourse'; my $dctitle = &Apache::lonnet::plaintext('dc'); + my $numtitles; + $r->print(&Apache::lonpickcourse::js_changer()); $r->print(&mt('Revise your search criteria for this domain').' ('.$domdesc.').

'); $r->print(&Apache::lonpickcourse::build_filters($filterlist,$type, - undef,undef,\%filter,$action)); + undef,undef,\%filter,$action,\$numtitles)); $filter{'domainfilter'} = $dom; my %courses = &Apache::lonpickcourse::search_courses($r,$type,0, - \%filter); - &Apache::lonpickcourse::display_matched_courses($r,$type,0,$action, + \%filter,$numtitles); + &Apache::lonpickcourse::display_matched_courses($r,$type,0,$action,undef,undef,undef, %courses); return; } @@ -173,7 +189,7 @@ sub print_modification_menu { ); my @menu = ( - { text => 'Modify quota for group portfolio files', + { text => 'Modify quota for group portfolio', phase => 'setquota', }, { text => 'Display current settings for automated enrollment', @@ -244,7 +260,6 @@ sub print_settings_display { 'back' => "Back to options page", ); - my @bgcolors = ('#eeeeee','#cccccc'); my $cctitle = &Apache::lonnet::plaintext('cc',$type); my $dctitle = &Apache::lonnet::plaintext('dc'); my @modifiable_params = &get_dc_settable(); @@ -270,9 +285,15 @@ sub print_settings_display { &print_header($r,$cdesc); $r->print('

'.$lt{'caes'}.$cdesc.'

-

-'.$lt{'cose'}.' +

+'.$lt{'cose'}.' +

'.$lt{'cour'}.'

@@ -281,7 +302,7 @@ sub print_settings_display { '.$lt{'back'}.'     '.&mt('Modify [_1]-only settings',$dctitle).''."\n". &hidden_form_elements(). -'

'); +'

'); } sub print_setquota { @@ -290,7 +311,7 @@ sub print_setquota { my $cctitle = &Apache::lonnet::plaintext('cc',$type); my $subdiv = &mt('Although a [_1] will assign the disk quota for each individual group, the size of the quota is constrained by the total disk space allocated by the [_2] for portfolio files in a course.',$cctitle,$dctitle); my %lt = &Apache::lonlocal::texthash( - 'cquo' => 'Disk space for storage of group portfolio files', + 'cquo' => 'Disk space for storage of group portfolio', 'gpqu' => 'Course portfolio files disk space', 'each' => 'Each course group can be assigned a quota for portfolio files uploaded to the group.', 'modi' => 'Save', @@ -340,8 +361,8 @@ sub print_catsettings { $excludeon = $excludeoff; $excludeoff = ''; } - $r->print('

'.&mt('Visibility in Course Catalog').'

'. - &mt("Unless excluded, a course is listed in this domain's publicly accessible course catalog, if at least one of the following applies").':