[LON-CAPA-cvs] cvs: loncom /interface lonuserutils.pm slotrequest.pm /localize/localize de.pm

bisitz bisitz at source.lon-capa.org
Wed Jan 23 12:48:42 EST 2013


bisitz		Wed Jan 23 17:48:42 2013 EDT

  Modified files:              
    /loncom/interface	lonuserutils.pm slotrequest.pm 
    /loncom/localize/localize	de.pm 
  Log:
  Improvements and corrections related to uploading users [lonuserutils.pm] and uploading slot definitions [slotrequest.pm]
  
  - Internationalization, Wording:
      - Exclcude HTML from mt arguments
      - Re-use existing phrases
      - Consistent wording
      - Added missing mt calls [slotrequest.pm]
      - Corrected mt parameters (first param. is 1, not 2) [lonuserutils.pm, de.pm]
      - Better fitting headline: "Upload..." [slotrequest.pm]
      - Added/adjusted related phrases [de.pm]
  
  - Improved and consistent screen layout:
      - Consistent layout (order of elements, style, spacing, floating, ...)
      - Better fitting headline level
      - Improved floating of screen elements and help links
      - Added check for specified file (though redirection to next screen occurs nevertheless) [lonuserutils.pm]
      - Additional warning, if no records are found in the specified file 
      - Added links to existing help files 
      - Moved option "Ignore First Line" and button "Reverse Association" to function box
      - Removed some <hr /> and <br />
  
  - Other improvements:
      - XHTML: Proper inclusion of JavaScript [slotrequest.pm]
      - Corrected unbalanced tags:
            - Removed additional table closure [slotrequest.pm]
            - Removed additional div closure [lonuserutils.pm]
            (- form closure still missing in lonuserutils.pm)
      - Simplified code for "No slots" message and added info style [slotrequest.pm]
  
  
  
-------------- next part --------------
Index: loncom/interface/lonuserutils.pm
diff -u loncom/interface/lonuserutils.pm:1.146 loncom/interface/lonuserutils.pm:1.147
--- loncom/interface/lonuserutils.pm:1.146	Mon Dec 31 15:28:36 2012
+++ loncom/interface/lonuserutils.pm	Wed Jan 23 17:48:37 2013
@@ -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 @@
                                 $env{'request.role.domain'},$context,
                                 $groupslist,$crstype);
     my $checked=(($env{'form.noFirstLine'})?' checked="checked"':'');
-    $r->print('<p>'
-             .&mt('Total number of records found in file: [_1]'
-                 ,'<b>'.$distotal.'</b>')
-             ."</p>\n");
-    $r->print('<div class="LC_left_float"><h3>'.
-              &mt('Identify fields in uploaded list')."</h3>\n");
-    $r->print(&mt('Enter as many fields as you can.<br /> The system will inform you and bring you back to this page, <br /> if the data selected are insufficient to add users.')."<br />\n");
+    $r->print(
+        '<h3>'.&mt('Identify fields in uploaded list')."</h3>\n".
+        '<p class="LC_info">'.
+        &mt('Total number of records found in file: [_1]'
+           ,'<b>'.$distotal.'</b>').
+        "</p>\n"
+    );
+    if ($distotal == 0) {
+        $r->print('<p class="LC_warning">'.&mt('None found').'</p>');
+    }
+    $r->print(
+        '<p>'.
+        &mt('Enter as many fields as you can.').'<br />'.
+        &mt('The system will inform you and bring you back to this page,[_1]if the data selected are insufficient to add users.','<br />').
+        "</p>\n"
+    );
     $r->print(&hidden_input('action','upload').
               &hidden_input('state','got_file').
               &hidden_input('associate','').
@@ -349,17 +358,23 @@
               &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').'" '.
+    $r->print(
+        '<div class="LC_left_float">'.
+        '<fieldset><legend>'.&mt('Functions').'</legend>'.
+        '<label><input type="checkbox" name="noFirstLine"'.$checked.' />'.
+              &mt('Ignore First Line').'</label>'.
+        ' <input type="button" value="'.&mt('Reverse Association').'" '.
               'name="Reverse Association" '.
-              'onclick="javascript:this.form.associate.value=\'Reverse Association\';submit(this.form);" />');
-    $r->print("<br /><br />\n".
-              '<script type="text/javascript" language="Javascript">'."\n".
-              '// <![CDATA['."\n".
-              $javascript."\n".$javascript_validations."\n".
-              '// ]]>'."\n".
-              '</script>');
+              'onclick="javascript:this.form.associate.value=\'Reverse Association\';submit(this.form);" />'.
+        '</fieldset></div><br clear="all" />'
+    );
+    $r->print(
+        '<script type="text/javascript" language="Javascript">'."\n".
+        '// <![CDATA['."\n".
+        $javascript."\n".$javascript_validations."\n".
+        '// ]]>'."\n".
+        '</script>'
+    );
 }
 
 ###############################################################
@@ -603,7 +618,7 @@
             $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 @@
             $keyfields=join(',',sort(keys(%sone)));
         }
     }
-    $r->print('</div>');
     &print_upload_manager_footer($r,$i,$keyfields,$defdom,$today,$halfyear,
                                  $context,$permission,$crstype);
 }
@@ -1568,10 +1582,10 @@
             $clearcoursepick = 1;
         }
         if (($env{'form.coursepick'}) && (!$clearcoursepick)) {
-            $r->print('<hr />'.&mt('Searching').' ...<br /> <br />');
+            $r->print('<hr />'.&mt('Searching ...').'<br /> <br />');
         }
     } else {
-        $r->print('<hr /><div id="searching">'.&mt('Searching').' ...</div>');
+        $r->print('<hr /><div id="searching">'.&mt('Searching ...').'</div>');
     }
     $r->rflush();
     if ($context eq 'course') {
@@ -3822,16 +3836,17 @@
     $str .= '<input type="hidden" name="action" value="upload" />';
     $str .= '<input type="hidden" name="state"  value="got_file" />';
 
+    $str .= &Apache::grades::checkforfile_js();
+
     $str .= '<h2>'.&mt('Upload a file containing information about users').'</h2>'."\n";
 
     # Excel and CSV Help
-    $str .= '<div class="LC_left_float">'
+    $str .= '<div class="LC_columnSection">'
            .&Apache::loncommon::help_open_topic("Course_Create_Class_List",
                 &mt("How do I create a users list from a spreadsheet"))
-           .'</div><div class="LC_left_float">'."\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"))
-           .'</div><br clear="all" />'."\n";
+           ."</div>\n";
     $str .= &Apache::lonhtmlcommon::start_pick_box()
            .&Apache::lonhtmlcommon::row_title(&mt('File'));
     if (&Apache::lonlocal::current_language() ne 'en') {
@@ -3852,7 +3867,8 @@
            .&Apache::lonhtmlcommon::end_pick_box();
 
     $str .= '<p>'
-           .'<input type="submit" name="fileupload" value="'.&mt('Next').'" />'
+           .'<input type="submit" name="fileupload" value="'.&mt('Next').'"'
+           .' onclick="javascript:checkUpload(this.form);" />'
            .'</p>';
 
     $r->print($str);
@@ -4135,7 +4151,7 @@
                     if ($entries{$fields{'domain'}} 
                         ne &LONCAPA::clean_domain($entries{$fields{'domain'}})) {
                         $r->print('<br />'. '<b>'.$entries{$fields{'domain'}}.
-                                  '</b>: '.&mt('Unacceptable domain for user [_2] [_3] [_4] [_5]',$fname,$mname,$lname,$gen));
+                                  '</b>: '.&mt('Unacceptable domain for user [_1] [_2] [_3] [_4]',$fname,$mname,$lname,$gen));
                         next;
                     }
                     my $username = $entries{$fields{'username'}};
@@ -4958,7 +4974,7 @@
     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 {
Index: loncom/interface/slotrequest.pm
diff -u loncom/interface/slotrequest.pm:1.116 loncom/interface/slotrequest.pm:1.117
--- loncom/interface/slotrequest.pm:1.116	Mon Aug 27 14:33:15 2012
+++ loncom/interface/slotrequest.pm	Wed Jan 23 17:48:37 2013
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler for requesting to have slots added to a students record
 #
-# $Id: slotrequest.pm,v 1.116 2012/08/27 14:33:15 raeburn Exp $
+# $Id: slotrequest.pm,v 1.117 2013/01/23 17:48:37 bisitz Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1059,7 +1059,8 @@
     my $available;
     if ($mgr eq 'F') {
     # FIXME: This line should be deleted once Slots uses breadcrumbs
-    $r->print(&Apache::loncommon::help_open_topic('Slot About', 'Help on slots'));
+    $r->print('<br />'.&Apache::loncommon::help_open_topic(
+        'Slot About', &mt('Help on slots')));
 
 	$r->print('<div>');
 	$r->print('<form method="post" action="/adm/slotrequest">
@@ -1075,11 +1076,11 @@
     }
 
     if (!keys(%slots)) {
-        if ($crstype eq 'Community') {
-            $r->print('<div>'.&mt('No slots have been created in this community.').'</div>');
-        } else {
-            $r->print('<div>'.&mt('No slots have been created in this course.').'</div>');
-        }
+        $r->print(
+            '<p class="LC_info">'
+           .&mt('No slots have been created in this '.lc($crstype).'.')
+           .'</p>'
+        );
         return;
     }
     
@@ -2200,7 +2201,7 @@
     my ($r)=@_;    
     $r->print(
         &Apache::grades::checkforfile_js()
-       .'<h3>'.&mt('Specify a file containing the slot definitions.').'</h3>'
+       .'<h2>'.&mt('Upload a file containing the slot definitions').'</h2>'
        .'<form method="post" enctype="multipart/form-data"'
        .' action="/adm/slotrequest" name="slotupload">'
        .'<input type="hidden" name="command" value="csvuploadmap" />'
@@ -2234,16 +2235,40 @@
 
     my $checked=(($env{'form.noFirstLine'})?' checked="checked"':'');
     my $ignore=&mt('Ignore First Line');
-	my $help_field = &Apache::loncommon::help_open_topic('Slot SelectingField');
+    my $buttontext = &mt('Reverse Association');
+
+    $r->print(
+        '<form method="post" enctype="multipart/form-data" action="/adm/slotrequest" name="slotupload">'
+       .'<h2>'.&mt('Identify fields in uploaded list').'</h2>'
+       .'<div class="LC_columnSection">'
+       .&Apache::loncommon::help_open_topic(
+            'Slot About',&mt('Help on slots'))
+       .' '.&Apache::loncommon::help_open_topic(
+            'Slot SelectingField',&mt('Help on selecting Fields'))
+       ."</div>\n"
+       .'<p class="LC_info">'
+       .&mt('Total number of records found in file: [_1]','<b>'.$distotal.'</b>')
+       ."</p>\n"
+    );
+    if ($distotal == 0) {
+        $r->print('<p class="LC_warning">'.&mt('None found').'</p>');
+    }
+    $r->print(
+        '<p>'
+       .&mt('Enter as many fields as you can.').'<br />'
+       .&mt('The system will inform you and bring you back to this page,[_1]if the data selected is insufficient to create the slots.','<br />')
+       .'</p>'
+    );
+    $r->print(
+        '<div class="LC_left_float">'
+       .'<fieldset><legend>'.&mt('Functions').'</legend>'
+       .'<label><input type="checkbox" name="noFirstLine"'.$checked.' />'.$ignore.'</label>'
+       .' <input type="button" value="'.$buttontext
+           .'" onclick="javascript:this.form.associate.value=\'Reverse Association\';submit(this.form);" />'
+       .'</fieldset></div><br clear="all" />'
+    );
 
     $r->print(<<ENDPICK);
-<form method="post" enctype="multipart/form-data" action="/adm/slotrequest" name="slotupload">
-<h3>Identify fields $help_field</h3>	
-Total number of records found in file: $distotal <hr />
-Enter as many fields as you can. The system will inform you and bring you back
-to this page if the data selected is insufficient to create the slots.<hr />
-<input type="button" value="Reverse Association" onclick="javascript:this.form.associate.value='Reverse Association';submit(this.form);" />
-<label><input type="checkbox" name="noFirstLine"$checked />$ignore</label>
 <input type="hidden" name="associate"  value="" />
 <input type="hidden" name="datatoken"  value="$datatoken" />
 <input type="hidden" name="fileupload" value="$env{'form.fileupload'}" />
@@ -2251,9 +2276,10 @@
 <input type="hidden" name="upfile_associate" 
                                        value="$env{'form.upfile_associate'}" />
 <input type="hidden" name="command"    value="csvuploadassign" />
-<hr />
 <script type="text/javascript" language="Javascript">
+// <![CDATA[
 $javascript
+// ]]>
 </script>
 ENDPICK
     return '';
@@ -2264,7 +2290,6 @@
     my ($request,$i,$keyfields) =@_;
     my $buttontext = &mt('Create Slots');
     $request->print(<<ENDPICK);
-</table>
 <input type="hidden" name="nfields" value="$i" />
 <input type="hidden" name="keyfields" value="$keyfields" />
 <input type="button" onclick="javascript:verify(this.form)" value="$buttontext" /><br />
Index: loncom/localize/localize/de.pm
diff -u loncom/localize/localize/de.pm:1.489 loncom/localize/localize/de.pm:1.490
--- loncom/localize/localize/de.pm:1.489	Wed Jan 23 11:24:38 2013
+++ loncom/localize/localize/de.pm	Wed Jan 23 17:48:41 2013
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # German Localization Lexicon
 #
-# $Id: de.pm,v 1.489 2013/01/23 11:24:38 bisitz Exp $
+# $Id: de.pm,v 1.490 2013/01/23 17:48:41 bisitz Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -3233,9 +3233,6 @@
    'Student/Employee ID'
 => 'Studierenden-/Mitarbeiter-ID',
 
-   'Identify fields'
-=> 'Identifiziere Felder',
-
    'If active, the new role will be available when the students next log in to LON-CAPA.'
 => 'Falls aktiv, dann wird die neue Rolle verfügbar sein, wenn sich die Studierenden das nächste Mal in LON-CAPA einloggen.',
 
@@ -4074,11 +4071,14 @@
    'Enrolling Student'
 => 'Student/in wird in den Kurs aufgenommen',
 
-   'Enter as many fields as you can. The system will inform you and bring you back to this page if the data selected is insufficient to enroll students in your class.'
-=> 'Füllen Sie so viele Felder wie möglich aus. Das System wird Sie informieren und zu dieser Seite zurückbringen, falls die Daten nicht ausreichen, Studierende in Ihren Kurs aufzunehmen.',
+   'Enter as many fields as you can.'
+=> 'Füllen Sie so viele Felder wie möglich aus.',
+
+   'The system will inform you and bring you back to this page,[_1]if the data selected are insufficient to add users.'
+=> 'Das System wird Sie informieren und zu dieser Seite zurückbringen,[_1]falls die ausgewählten Daten nicht ausreichen, Benutzer in Ihren Kurs aufzunehmen.',
 
-   'Enter as many fields as you can.<br /> The system will inform you and bring you back to this page, <br /> if the data selected are insufficient to add users.'
-=> 'Füllen Sie so viele Felder wie möglich aus.<br /> Das System wird Sie informieren und zu dieser Seite zurückbringen,<br /> falls die Daten nicht ausreichen, Benutzer in Ihren Kurs aufzunehmen.',
+   'The system will inform you and bring you back to this page,[_1]if the data selected is insufficient to create the slots.'
+=> 'Das System wird Sie informieren und zu dieser Seite zurückbringen,[_1]falls die ausgewählten Daten nicht ausreichen, die Slots zu erstellen.',
 
    'Enter terms or phrases separated by AND, OR, or NOT then press SEARCH below'
 => 'Geben Sie Suchbegriffe oder -Sätze ein. Sie können AND, OR und NOT als Such-Operatoren verwenden. Klicken Sie anschließend unten auf SUCHEN.',
@@ -12981,7 +12981,7 @@
 => 'Rolle: ',
 
    'Identify fields in uploaded list'
-=> 'Angabe der Felder in der hochgeladenen Liste',
+=> 'Zuweisung der Felder in der hochgeladenen Liste',
 
    'Default domain'
 => 'Voreingestellte Domäne',
@@ -15949,6 +15949,9 @@
    'Help on slots'
 => 'Hilfe zu Slots',
 
+   'Help on selecting Fields'
+=> 'Hilfe zur Auswahl der Felder',
+
    'New user accounts in [_1]'
 => 'Neue Benutzeraccounts in [_1]',
 
@@ -24233,8 +24236,8 @@
    'Slot: [_1] has unknown status.'
 => 'Slot [_1] hat unbekannten Status',
 
-   'Specify a file containing the slot definitions.'
-=> 'Angabe einer Datei mit Slot-Definitionen',
+   'Upload a file containing the slot definitions'
+=> 'Hochladen einer Datei mit Slot-Definitionen',
 
    'Status of messages about dropped reservation'
 => 'Status der Nachrichten über verworfene Reservierung',


More information about the LON-CAPA-cvs mailing list