[LON-CAPA-cvs] cvs: loncom /interface lonuserutils.pm
bisitz
lon-capa-cvs-allow@mail.lon-capa.org
Wed, 15 Oct 2008 14:12:41 -0000
bisitz Wed Oct 15 10:12:41 2008 EDT
Modified files:
/loncom/interface lonuserutils.pm
Log:
Optimized upload classlist/userlist:
- Optimized &mt() calls (got rid of HTML tags in translations and included value as a parameter into translation instead of a concatination)
First page:
- Changed confusing button text (CCs misunderstood it: They thought, that a click on the button "Upload a list of users" would directly upload the file.)
- Changed order of options to a more logical one (1. headline, 2. file, 3. type, 4. help links, 5. ignore first line, 4. button)
Second page:
- Separate lines for button "Reverse Association" and option "Ignore First Line"
- Moved time consuming note _above_ the button which initiates the time consuming actions and added info style
Index: loncom/interface/lonuserutils.pm
diff -u loncom/interface/lonuserutils.pm:1.72 loncom/interface/lonuserutils.pm:1.73
--- loncom/interface/lonuserutils.pm:1.72 Wed Oct 15 09:00:24 2008
+++ loncom/interface/lonuserutils.pm Wed Oct 15 10:12:41 2008
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Utility functions for managing LON-CAPA user accounts
#
-# $Id: lonuserutils.pm,v 1.72 2008/10/15 13:00:24 bisitz Exp $
+# $Id: lonuserutils.pm,v 1.73 2008/10/15 14:12:41 bisitz Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -329,7 +329,7 @@
$env{'request.role.domain'},$context,
$groupslist);
my $checked=(($env{'form.noFirstLine'})?' checked="checked" ':'');
- $r->print(&mt('Total number of records found in file: <b>[_1]</b>.',$distotal).
+ $r->print(&mt('Total number of records found in file: [_1]','<b>'.$distotal.'</b>').
"<br />\n");
$r->print('<div class="LC_left_float"><h3>'.
&mt('Identify fields in uploaded list')."</h3>\n");
@@ -341,11 +341,11 @@
&hidden_input('fileupload',$env{'form.fileupload'}).
&hidden_input('upfiletype',$env{'form.upfiletype'}).
&hidden_input('upfile_associate',$env{'form.upfile_associate'}));
+ $r->print('<br /><label><input type="checkbox" name="noFirstLine"'.$checked.'/>'.
+ &mt('Ignore First Line').'</label><br />');
$r->print('<br /><input type="button" value="'.&mt('Reverse Association').'" '.
'name="Reverse Association" '.
'onClick="javascript:this.form.associate.value=\'Reverse Association\';submit(this.form);" />');
- $r->print('<label><input type="checkbox" name="noFirstLine"'.$checked.'/>'.
- &mt('Ignore First Line').'</label>');
$r->print("<br /><br />\n".
'<script type="text/javascript" language="Javascript">'."\n".
$javascript."\n".$javascript_validations.'</script>');
@@ -743,7 +743,7 @@
$Str .= '<p>'.&mt('Change authentication for existing users in domain "[_1]" to these settings?',$defdom).' <span class="LC_nobreak"><label><input type="radio" name="changeauth" value="No" checked="checked" />'.&mt('No').'</label> <label><input type="radio" name="changeauth" value="Yes" />'.&mt('Yes').'</label></span></p>';
} else {
$Str .= "<p>\n".
- &mt('Note: this will not take effect if the user already exists').
+ &mt('Note: This will not take effect if the user already exists.').
&Apache::loncommon::help_open_topic('Auth_Options').
"</p>\n";
}
@@ -797,13 +797,17 @@
if ($context eq 'course' || $context eq 'domain') {
$Str .= &forceid_change($context);
}
- $Str .= '</div><div class="LC_clear_float_footer"><br /><input type="button"'.
- 'onClick="javascript:verify(this.form,this.form.csec)" '.
- 'value="'.&mt('Update Users').'" />'."<br />\n";
- if ($context eq 'course') {
- $Str .= &mt('Note: for large courses, this operation may be time consuming');
- }
$Str .= '</div>';
+ $Str .= '<div class="LC_clear_float_footer">';
+ if ($context eq 'course') {
+ $Str .= '<div class="LC_info">'
+ .&mt('Note: For large courses, this operation may be time consuming.')
+ .'</div>';
+ }
+ $Str .= '<input type="button"'
+ .'onClick="javascript:verify(this.form,this.form.csec)" '
+ .'value="'.&mt('Update Users').'" />'."\n"
+ .'</div>';
$r->print($Str);
return;
}
@@ -3036,7 +3040,7 @@
}
if ($context eq 'course') {
if ($mode eq 'csv' || $mode eq 'excel') {
- $description = &mt('Course - ').$env{'course.'.$env{'request.course.id'}.'.description'}.': ';
+ $description = &mt('Course - [_1]:',$env{'course.'.$env{'request.course.id'}.'.description'}).' ';
}
if ($statusmode eq 'Expired') {
$description .= &mt('Users in course with expired [_1] roles',$showfilter);
@@ -3095,8 +3099,11 @@
}
} elsif ($context eq 'author') {
$description =
- &mt('Author space for <span class="LC_cusr_emph">[_1]</span>',
- &Apache::loncommon::plainname($env{'user.name'},$env{'user.domain'})).': ';
+ &mt('Author space for [_1]'
+ ,'<span class="LC_cusr_emph">'
+ .&Apache::loncommon::plainname($env{'user.name'},$env{'user.domain'})
+ .'</span>')
+ .': ';
if ($statusmode eq 'Expired') {
$description .= &mt('Co-authors with expired [_1] roles',$showfilter);
} elsif ($statusmode eq 'Future') {
@@ -3112,7 +3119,7 @@
}
} elsif ($context eq 'domain') {
my $domdesc = &Apache::lonnet::domain($env{'request.role.domain'},'description');
- $description = &mt('Domain - ').$domdesc.': ';
+ $description = &mt('Domain - [_1]:',$domdesc).' ';
if ($env{'form.roletype'} eq 'domain') {
if ($statusmode eq 'Expired') {
$description .= &mt('Users in domain with expired [_1] roles',$showfilter);
@@ -3367,17 +3374,18 @@
$str .= '<input type="hidden" name="state" value="got_file" />';
$str .= "<h3>".&mt('Upload a file containing information about users')."</h3>\n";
$str .= &Apache::loncommon::upfile_select_html();
- $str .= "<p>\n";
- $str .= '<input type="submit" name="fileupload" value="'.
- &mt('Upload file of users').'">'."\n";
- $str .= '<label><input type="checkbox" name="noFirstLine" /> '.
- &mt('Ignore First Line')."</label></p>\n";
+ $str .= '<p>';
$str .= &Apache::loncommon::help_open_topic("Course_Create_Class_List",
&mt("How do I create a users list from a spreadsheet")).
"<br />\n";
$str .= &Apache::loncommon::help_open_topic("Course_Convert_To_CSV",
- &mt("How do I create a CSV file from a spreadsheet")).
- "<br />\n";
+ &mt("How do I create a CSV file from a spreadsheet"));
+ $str .= "</p>\n";
+ $str .= "<p>\n";
+ $str .= '<label><input type="checkbox" name="noFirstLine" /> '.
+ &mt('Ignore First Line')."</label></p>\n";
+ $str .= '<input type="submit" name="fileupload" value="'.
+ &mt('Go to next step').'">'."<br />\n";
$str .= &Apache::loncommon::end_page();
$r->print($str);
return;