--- loncom/interface/lonuserutils.pm 2012/12/31 15:28:36 1.146 +++ loncom/interface/lonuserutils.pm 2013/01/23 17:48:37 1.147 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Utility functions for managing LON-CAPA user accounts # -# $Id: lonuserutils.pm,v 1.146 2012/12/31 15:28:36 raeburn Exp $ +# $Id: lonuserutils.pm,v 1.147 2013/01/23 17:48:37 bisitz Exp $ # # Copyright Michigan State University Board of Trustees # @@ -335,13 +335,22 @@ sub print_upload_manager_header { $env{'request.role.domain'},$context, $groupslist,$crstype); my $checked=(($env{'form.noFirstLine'})?' checked="checked"':''); - $r->print('

' - .&mt('Total number of records found in file: [_1]' - ,''.$distotal.'') - ."

\n"); - $r->print('

'. - &mt('Identify fields in uploaded list')."

\n"); - $r->print(&mt('Enter as many fields as you can.
The system will inform you and bring you back to this page,
if the data selected are insufficient to add users.')."
\n"); + $r->print( + '

'.&mt('Identify fields in uploaded list')."

\n". + '

'. + &mt('Total number of records found in file: [_1]' + ,''.$distotal.''). + "

\n" + ); + if ($distotal == 0) { + $r->print('

'.&mt('None found').'

'); + } + $r->print( + '

'. + &mt('Enter as many fields as you can.').'
'. + &mt('The system will inform you and bring you back to this page,[_1]if the data selected are insufficient to add users.','
'). + "

\n" + ); $r->print(&hidden_input('action','upload'). &hidden_input('state','got_file'). &hidden_input('associate',''). @@ -349,17 +358,23 @@ sub print_upload_manager_header { &hidden_input('fileupload',$env{'form.fileupload'}). &hidden_input('upfiletype',$env{'form.upfiletype'}). &hidden_input('upfile_associate',$env{'form.upfile_associate'})); - $r->print('

'); - $r->print('
print( + '
'. + '
'.&mt('Functions').''. + ''. + ' '); - $r->print("

\n". - ''); + 'onclick="javascript:this.form.associate.value=\'Reverse Association\';submit(this.form);" />'. + '

' + ); + $r->print( + '' + ); } ############################################################### @@ -603,7 +618,7 @@ sub upload_manager_javascript_forward_as $numbuttons ++; } if (!$can_assign->{'int'}) { - my $warning = &mt('You may not specify an initial password for each user, as this is only available when new users use LON-CAPA internal authentication.\n'). + my $warning = &mt('You may not specify an initial password for each user, as this is only available when new users use LON-CAPA internal authentication.').'\n' &mt('Your current role does not have rights to create users with that authentication type.'); $auth_update = <<"END"; // Currently the initial password field is only supported for internal auth @@ -1082,7 +1097,6 @@ sub print_upload_manager_form { $keyfields=join(',',sort(keys(%sone))); } } - $r->print('
'); &print_upload_manager_footer($r,$i,$keyfields,$defdom,$today,$halfyear, $context,$permission,$crstype); } @@ -1568,10 +1582,10 @@ sub print_userlist { $clearcoursepick = 1; } if (($env{'form.coursepick'}) && (!$clearcoursepick)) { - $r->print('
'.&mt('Searching').' ...
 
'); + $r->print('
'.&mt('Searching ...').'
 
'); } } else { - $r->print('
'.&mt('Searching').' ...
'); + $r->print('
'.&mt('Searching ...').'
'); } $r->rflush(); if ($context eq 'course') { @@ -3822,16 +3836,17 @@ sub print_first_users_upload_form { $str .= ''; $str .= ''; + $str .= &Apache::grades::checkforfile_js(); + $str .= '

'.&mt('Upload a file containing information about users').'

'."\n"; # Excel and CSV Help - $str .= '
' + $str .= '
' .&Apache::loncommon::help_open_topic("Course_Create_Class_List", &mt("How do I create a users list from a spreadsheet")) - .'
'."\n" - .&Apache::loncommon::help_open_topic("Course_Convert_To_CSV", + .' '.&Apache::loncommon::help_open_topic("Course_Convert_To_CSV", &mt("How do I create a CSV file from a spreadsheet")) - .'

'."\n"; + ."
\n"; $str .= &Apache::lonhtmlcommon::start_pick_box() .&Apache::lonhtmlcommon::row_title(&mt('File')); if (&Apache::lonlocal::current_language() ne 'en') { @@ -3852,7 +3867,8 @@ sub print_first_users_upload_form { .&Apache::lonhtmlcommon::end_pick_box(); $str .= '

' - .'' + .'' .'

'; $r->print($str); @@ -4135,7 +4151,7 @@ sub upfile_drop_add { if ($entries{$fields{'domain'}} ne &LONCAPA::clean_domain($entries{$fields{'domain'}})) { $r->print('
'. ''.$entries{$fields{'domain'}}. - ': '.&mt('Unacceptable domain for user [_2] [_3] [_4] [_5]',$fname,$mname,$lname,$gen)); + ': '.&mt('Unacceptable domain for user [_1] [_2] [_3] [_4]',$fname,$mname,$lname,$gen)); next; } my $username = $entries{$fields{'username'}}; @@ -4958,7 +4974,7 @@ sub dates_feedback { my $dates; if ($start < $now) { if ($end == 0) { - $dates .= &mt('role(s) active now; no end date'); + $dates = &mt('role(s) active now; no end date'); } elsif ($end > $now) { $dates = &mt('role(s) active now; ends [_1].',&Apache::lonlocal::locallocaltime($end)); } else {