--- loncom/interface/lonuserutils.pm 2012/12/31 15:28:36 1.146
+++ loncom/interface/lonuserutils.pm 2013/02/05 16:22:27 1.148
@@ -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.148 2013/02/05 16:22:27 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.',' ').
+ "
'
+ );
+ $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('
'.$warning.''."\n");
@@ -1568,10 +1580,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') {
@@ -1707,7 +1719,7 @@ sub print_userlist {
} elsif ($context eq 'course') {
$r->print(&mt('There are no course users to display.')."\n");
}
- $r->print('
'."\n") if $msg;
+ $r->print('
'.$msg.'
'."\n") if $msg;
} else {
# Print out the available choices
my $usercount;
@@ -3822,16 +3834,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 +3865,8 @@ sub print_first_users_upload_form {
.&Apache::lonhtmlcommon::end_pick_box();
$str .= '
'
- .''
+ .''
.'
';
$r->print($str);
@@ -4135,7 +4149,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 +4972,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 {