--- loncom/interface/lonmodifycourse.pm 2009/06/09 13:26:35 1.45 +++ loncom/interface/lonmodifycourse.pm 2009/07/31 03:01:31 1.46 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # handler for DC-only modifiable course settings # -# $Id: lonmodifycourse.pm,v 1.45 2009/06/09 13:26:35 bisitz Exp $ +# $Id: lonmodifycourse.pm,v 1.46 2009/07/31 03:01:31 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -120,17 +120,30 @@ sub print_course_search_page { 'instcodefilter','ownerfilter', 'coursefilter']; my $filter = {}; - my $numtitles; - 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,\$numtitles,'modifycourse')); } @@ -145,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,undef, + \%filter,$numtitles); + &Apache::lonpickcourse::display_matched_courses($r,$type,0,$action,undef,undef,undef, %courses); return; } @@ -1091,7 +1106,7 @@ sub course_settings_descrip { sub hidden_form_elements { my $hidden_elements = - &Apache::lonhtmlcommon::echo_form_input(['gosearch','coursecode', + &Apache::lonhtmlcommon::echo_form_input(['gosearch','updater','coursecode', 'prevphase','numlocalcc','courseowner','login','coursequota','intarg', 'locarg','krbarg','krbver','counter','hidefromcat','usecategory'])."\n". ''; @@ -1114,6 +1129,9 @@ sub handler { &Apache::lonhtmlcommon::clear_breadcrumbs(); my $phase = $env{'form.phase'}; + if ($env{'form.updater'}) { + $phase = ''; + } if ($phase eq '') { &Apache::lonhtmlcommon::add_breadcrumb ({href=>"/adm/modifycourse",