--- loncom/interface/lonuserutils.pm 2010/01/20 18:22:35 1.97.2.5 +++ loncom/interface/lonuserutils.pm 2009/10/30 03:57:35 1.101 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Utility functions for managing LON-CAPA user accounts # -# $Id: lonuserutils.pm,v 1.97.2.5 2010/01/20 18:22:35 raeburn Exp $ +# $Id: lonuserutils.pm,v 1.101 2009/10/30 03:57:35 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -247,10 +247,6 @@ sub domain_roles_select { foreach my $roletype (@roletypes) { # set up the text for this domain $select_menus{$roletype}->{'text'}= $lt{$roletype}; - my $crstype; - if ($roletype eq 'community') { - $crstype = 'Community'; - } # we want a choice of 'default' as the default in the second menu if ($env{'form.roletype'} ne '') { $select_menus{$roletype}->{'default'} = $env{'form.showrole'}; @@ -275,7 +271,7 @@ sub domain_roles_select { &mt('Custom role'); } else { $select_menus{$roletype}->{'select2'}->{$role} = - &Apache::lonnet::plaintext($role,$crstype); + &Apache::lonnet::plaintext($role); } } $select_menus{$roletype}->{'select2'}->{'Any'} = &mt('Any'); @@ -1141,7 +1137,7 @@ sub date_setting_table { } sub make_dates_default { - my ($startdate,$enddate,$context,$crstype = @_; + my ($startdate,$enddate,$context,$crstype) = @_; my $result = ''; if ($context eq 'course') { my ($cnum,$cdom) = &get_course_identity(); @@ -1294,13 +1290,7 @@ sub domain_roles { sub course_roles { my ($context,$checkpriv,$custom,$roletype) = @_; - my $crstype; - if ($roletype eq 'community') { - $crstype = 'Community' ; - } else { - $crstype = 'Course'; - } - my @allroles = &roles_by_context('course',$custom,$crstype); + my @allroles = &roles_by_context('course',$custom,$roletype); my @roles; if ($context eq 'domain') { @roles = @allroles; @@ -1441,46 +1431,26 @@ sub print_userlist { ''); return; } - if (!(($context eq 'domain') && - (($env{'form.roletype'} eq 'course') || ($env{'form.roletype'} eq 'community')))) { + if (!(($context eq 'domain') && ($env{'form.roletype'} eq 'course'))) { $r->print(' '.&list_submit_button(&mt('Update Display')). "\n
\n"); } my ($indexhash,$keylist) = &make_keylist_array(); - my (%userlist,%userinfo,$clearcoursepick); - if (($context eq 'domain') && - ($env{'form.roletype'} eq 'course') || - ($env{'form.roletype'} eq 'community')) { - my ($crstype,$numcodes,$title,$warning); - if ($env{'form.roletype'} eq 'course') { - $crstype = 'Course'; - $numcodes = $totcodes; - $title = &mt('Select Courses'); - $warning = &mt('Warning: data retrieval for multiple courses can take considerable time, as this operation is not currently optimized.'); - } elsif ($env{'form.roletype'} eq 'community') { - $crstype = 'Community'; - $numcodes = 0; - $title = &mt('Select Communities'); - $warning = &mt('Warning: data retrieval for multiple communities can take considerable time, as this operation is not currently optimized.'); - } + my (%userlist,%userinfo); + if ($context eq 'domain' && $env{'form.roletype'} eq 'course') { my $courseform = - &Apache::lonhtmlcommon::course_selection($formname,$numcodes, - $codetitles,$idlist,$idlist_titles,$crstype); + &Apache::lonhtmlcommon::course_selection($formname,$totcodes, + $codetitles,$idlist,$idlist_titles); $r->print(''.&Apache::lonhtmlcommon::start_pick_box()."\n". &Apache::lonhtmlcommon::start_pick_box()."\n". - &Apache::lonhtmlcommon::row_title($title,'LC_oddrow_value')."\n". + &Apache::lonhtmlcommon::row_title(&mt('Select Course(s)'), + 'LC_oddrow_value')."\n". $courseform."\n". &Apache::lonhtmlcommon::row_closure(1). &Apache::lonhtmlcommon::end_pick_box().'
'. - ''. - &list_submit_button(&mt('Update Display')). - "\n".'
'.$warning.''."\n"); - $clearcoursepick = 0; - if (($env{'form.origroletype'} ne '') && - ($env{'form.origroletype'} ne $env{'form.roletype'})) { - $clearcoursepick = 1; - } - if (($env{'form.coursepick'}) && (!$clearcoursepick)) { + ''.&list_submit_button(&mt('Update Display')). + "\n".'
'.&mt('Warning: data retrieval for multiple courses can take considerable time, as this operation is not currently optimized.').''."\n"); + if ($env{'form.coursepick'}) { $r->print('