--- loncom/interface/lonuserutils.pm 2010/05/22 13:33:09 1.97.2.17 +++ loncom/interface/lonuserutils.pm 2010/09/14 06:02:35 1.122 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Utility functions for managing LON-CAPA user accounts # -# $Id: lonuserutils.pm,v 1.97.2.17 2010/05/22 13:33:09 raeburn Exp $ +# $Id: lonuserutils.pm,v 1.122 2010/09/14 06:02:35 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1447,7 +1447,7 @@ sub print_userlist { return; } if (!(($context eq 'domain') && - (($env{'form.roletype'} eq 'course') || ($env{'form.roletype'} eq 'community')))) { + (($env{'form.roletype'} eq 'course') || ($env{'form.roletype'} eq 'community')))) { $r->print( "\n
\n" .'' @@ -1458,7 +1458,7 @@ sub print_userlist { my ($indexhash,$keylist) = &make_keylist_array(); my (%userlist,%userinfo,$clearcoursepick); if (($context eq 'domain') && - ($env{'form.roletype'} eq 'course') || + ($env{'form.roletype'} eq 'course') || ($env{'form.roletype'} eq 'community')) { my ($crstype,$numcodes,$title,$warning); if ($env{'form.roletype'} eq 'course') { @@ -1472,9 +1472,11 @@ sub print_userlist { $title = &mt('Select Communities'); $warning = &mt('Warning: data retrieval for multiple communities can take considerable time, as this operation is not currently optimized.'); } + my @standardnames = &Apache::loncommon::get_standard_codeitems(); my $courseform = &Apache::lonhtmlcommon::course_selection($formname,$numcodes, - $codetitles,$idlist,$idlist_titles,$crstype); + $codetitles,$idlist,$idlist_titles,$crstype, + \@standardnames); $r->print('
'.&Apache::lonhtmlcommon::start_pick_box()."\n".
&Apache::lonhtmlcommon::start_pick_box()."\n".
&Apache::lonhtmlcommon::row_title($title,'LC_oddrow_value')."\n".
@@ -1692,7 +1694,7 @@ sub role_filter {
$role_select .= '';
$output = '';
+ .' ';
}
return $output;
}
@@ -1923,7 +1925,7 @@ function setCourseCat(formname) {
if (formname.Year.options[formname.Year.selectedIndex].value == -1) {
return;
}
- courseSet('Year');
+ courseSet('$codetitles[0]');
for (var j=0; j '."\n"
+ .&mt('Please upload an UTF8 encoded file to ensure a correct character encoding in your classlist.')."\n"
+ .'
');
}
my ($output,$actionselect,%canchange,%canchangesec);
@@ -2331,7 +2332,7 @@ END
END
if ($actionselect) {
$output .= <<"END";
-
'."\n";
$str .= &Apache::lonhtmlcommon::start_pick_box()
- .&Apache::lonhtmlcommon::row_title(&mt('File'))
- .&Apache::loncommon::upfile_select_html()
+ .&Apache::lonhtmlcommon::row_title(&mt('File'));
+ if (&Apache::lonlocal::current_language() ne 'en') {
+ if ($context eq 'course') {
+ $str .= '
\n".&mt('Processed [quant,_1,user].',$counts{'user'}). "
\n"); if ($counts{'role'} > 0) { @@ -4565,7 +4573,7 @@ sub update_user_list { if ($sec eq '') { $nochg = 1; $keepnosection = 1; - } else { + } else { push(@retained,$sec); } } @@ -4594,12 +4602,12 @@ sub update_user_list { $result = 'ok'; $nothingtodo = 1; } else { - foreach my $newsec (@newsecs) { + foreach my $newsec (@newsecs) { if (!grep(/^\Q$newsec\E$/,@retained)) { if ($role eq 'st') { $result = &Apache::lonnet::modify_student_enrollment($udom,$uname,undef,undef,undef,undef,undef,$newsec,$end,$start,$type,$locktype,$cid,'',$context); if (@newsecs > 1) { - my $showsingle; + my $showsingle; if ($newsec eq '') { $showsingle = &mt('No section'); } else { @@ -4607,10 +4615,10 @@ sub update_user_list { } if ($crstype eq 'Community') { $warn_singlesec = &mt('Although more than one section was indicated, a role was only added for the first section - [_1], as each community member may only be in one section at a time.',''.$showsingle.''); - } else { + } else { $warn_singlesec = &mt('Although more than one section was indicated, a role was only added for the first section - [_1], as each student may only be in one section of a course at a time.',''.$showsingle.''); } - $showsecs = $showsingle; + $showsecs = $showsingle; last; } else { if ($newsec eq '') { @@ -4623,10 +4631,11 @@ sub update_user_list { my $newscope = $scopestem; if ($newsec ne '') { $newscope .= '/'.$newsec; - push(@shownew,$newsec); + push(@shownew,$newsec); } $result = &Apache::lonnet::assignrole($udom,$uname, $newscope,$role,$end,$start); + } } } @@ -4676,13 +4685,13 @@ sub update_user_list { $r->print('