--- loncom/interface/lonmodifycourse.pm 2009/01/12 01:37:57 1.41 +++ 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.41 2009/01/12 01:37:57 raeburn Exp $ +# $Id: lonmodifycourse.pm,v 1.46 2009/07/31 03:01:31 raeburn 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,10 +311,10 @@ 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' => 'Modify quota', + 'modi' => 'Save', 'back' => "Back to options page", ); my %settings = &Apache::lonnet::get('environment',['internal.coursequota'],$cdom,$cnum); @@ -387,7 +408,7 @@ sub print_course_modification_page { 'name' => "Name", 'unme' => "Username:Domain", 'stus' => "Status", - '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.", 'cose' => "Course settings for LON-CAPA courses that control automated student enrollment based on classlist data available from your institution's student information system fall into two groups: (a) settings that can be modified by a Course Coordinator using the ", @@ -409,7 +430,6 @@ all settings except course code, course 'deus' => "The default authentication method, and default authentication parameter (domain, initial password or argument) are used when automatic enrollment of students in a course requires addition of new user accounts in your domain, and the class list file contains empty entries for the <authtype> and <autharg> properties for the new student. If you choose 'internally authenticated', and leave the initial password field empty, the automated enrollment process will create a randomized password for each new student account that it adds to your LON-CAPA domain.", 'gobt' => "Save", ); - my @bgcolors = ('#eeeeee','#cccccc'); my @coursepersonnel = &Apache::lonnet::getkeys('nohist_userroles',$cdom,$cnum); my @local_ccs = (); @@ -635,8 +655,13 @@ sub modify_course { } if ( $newattr{'authtype'}=~ /^krb/) { if ($newattr{'autharg'} eq '') { - $warning = qq(). - &mt("As you did not include the default Kerberos domain to be used for authentication in this class, the institutional data used by the automated enrollment process must include the Kerberos domain for each new student").qq(

); + $warning = '

' + .&mt('As you did not include the default Kerberos domain' + .' to be used for authentication in this class, the' + .' institutional data used by the automated' + .' enrollment process must include the Kerberos' + .' domain for each new student.') + .'

'; } } @@ -783,7 +808,7 @@ sub modify_quota { ); $r->print('
-

'.&mt('Disk space for storage of group portfolio files for [_1]',$cdesc). +

'.&mt('Disk space for storage of group portfolio for [_1]',$cdesc). '

'); my %oldsettings = &Apache::lonnet::get('environment',['internal.coursequota'],$cdom,$cnum); my $defaultquota = 20; @@ -792,7 +817,7 @@ sub modify_quota { if ($newquota =~ /^\s*(\d+\.?\d*|\.\d+)\s*$/) { $newquota = $1; if ($oldsettings{'internal.coursequota'} eq $env{'form.coursequota'}) { - $r->print(&mt('The disk space allocated for group portfolio files remains unchanged as ').$env{'form.coursequota'}.' Mb'); + $r->print(&mt('The disk space allocated for group portfolio remains unchanged as ').$env{'form.coursequota'}.' Mb'); } else { my %cenv = ( 'internal.coursequota' => $env{'form.coursequota'}, @@ -801,11 +826,11 @@ sub modify_quota { $cnum); if (($oldsettings{'internal.coursequota'} eq '') && ($env{'form.coursequota'} == $defaultquota)) { - $r->print(&mt('The disk space allocated for group portfolio files in this course is the default quota for this domain:').' '.$defaultquota.' Mb'); + $r->print(&mt('The disk space allocated for group portfolio in this course is the default quota for this domain:').' '.$defaultquota.' Mb'); } else { if ($putreply eq 'ok') { my %updatedsettings = &Apache::lonnet::get('environment',['internal.coursequota'],$cdom,$cnum); - $r->print(&mt('The disk space allocated for group portfolio files is now:').' '.$updatedsettings{'internal.coursequota'}.' Mb.'); + $r->print(&mt('The disk space allocated for group portfolio is now:').' '.$updatedsettings{'internal.coursequota'}.' Mb.'); my $usage = &Apache::longroup::sum_quotas($cdom.'_'.$cnum); if ($usage >= $updatedsettings{'internal.coursequota'}) { my $newoverquota; @@ -1081,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". ''; @@ -1104,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",