[LON-CAPA-cvs] cvs: loncom /interface loncreateuser.pm

sakharuk lon-capa-cvs@mail.lon-capa.org
Wed, 10 Dec 2003 20:38:09 -0000


This is a MIME encoded message

--sakharuk1071088689
Content-Type: text/plain

sakharuk		Wed Dec 10 15:38:09 2003 EDT

  Modified files:              
    /loncom/interface	loncreateuser.pm 
  Log:
  Added another part of localization.
  
  
--sakharuk1071088689
Content-Type: text/plain
Content-Disposition: attachment; filename="sakharuk-20031210153809.txt"

Index: loncom/interface/loncreateuser.pm
diff -u loncom/interface/loncreateuser.pm:1.71 loncom/interface/loncreateuser.pm:1.72
--- loncom/interface/loncreateuser.pm:1.71	Wed Dec 10 14:34:53 2003
+++ loncom/interface/loncreateuser.pm	Wed Dec 10 15:38:09 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Create a user
 #
-# $Id: loncreateuser.pm,v 1.71 2003/12/10 19:34:53 sakharuk Exp $
+# $Id: loncreateuser.pm,v 1.72 2003/12/10 20:38:09 sakharuk Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -137,6 +137,7 @@
                     'dom'  => "Domain",
                     'usrr' => "User Roles",
                     'ecrp' => "Edit Custom Role Privileges",
+                    'nr'   => "Name of Role",
                     'cre'  => "Custom Role Editor"
 				       );
     $r->print(<<"ENDDOCUMENT");
@@ -159,7 +160,7 @@
 <form action="/adm/createuser" method="post" name="docustom">
 <input type="hidden" name="phase" value="selected_custom_edit">
 <h2>$lt{'ecrp'}</h2>
-Name of Role: $choice <input type="text" size="15" name="newrolename" /><br />
+$lt{'nr'}: $choice <input type="text" size="15" name="newrolename" /><br />
 <input name="customeditor" type="submit" value="$lt{'cre'}" />
 </body>
 </html>
@@ -245,31 +246,44 @@
             '<option value="default" selected>default</option>'."\n".
                 &Apache::loncommon::home_server_option_list($ccdomain);
         
+    my %lt=&Apache::lonlocal::texthash(
+                    'cnu'  => "Create New User",
+                    'nu'   => "New User",
+                    'id'   => "in domain",
+                    'pd'   => "Personal Data",
+                    'fn'   => "First Name",
+                    'mn'   => "Middle Name",
+                    'ln'   => "Last Name",
+                    'gen'  => "Generation",
+                    'idsn' => "ID/Student Number",
+                    'hs'   => "Home Server",
+                    'lg'   => "Login Data"
+				       );
 	$r->print(<<ENDNEWUSER);
 $dochead
-<h1>Create New User</h1>
+<h1>$lt{'cnu'}</h1>
 $forminfo
-<h2>New user "$ccuname" in domain $ccdomain</h2>
+<h2>$lt{'nu'} "$ccuname" $lt{'id'} $ccdomain</h2>
 <script type="text/javascript" language="Javascript">
 $loginscript
 </script>
 <input type='hidden' name='makeuser' value='1' />
-<h3>Personal Data</h3>
+<h3>$lt{'pd'}</h3>
 <p>
 <table>
-<tr><td>First Name  </td>
+<tr><td>$lt{'fn'}  </td>
     <td><input type='text' name='cfirst'  size='15' /></td></tr>
-<tr><td>Middle Name </td> 
+<tr><td>$lt{'mn'} </td> 
     <td><input type='text' name='cmiddle' size='15' /></td></tr>
-<tr><td>Last Name   </td>
+<tr><td>$lt{'ln'}   </td>
     <td><input type='text' name='clast'   size='15' /></td></tr>
-<tr><td>Generation  </td>
+<tr><td>$lt{'gen'}  </td>
     <td><input type='text' name='cgen'    size='5'  /></td></tr>
 </table>
-ID/Student Number <input type='text' name='cstid'   size='15' /></p>
-Home Server: <select name="hserver" size="1"> $home_server_list </select>
+$lt{'idsn'} <input type='text' name='cstid'   size='15' /></p>
+${'hs'}: <select name="hserver" size="1"> $home_server_list </select>
 <hr />
-<h3>Login Data</h3>
+<h3>$lt{'lg'}</h3>
 <p>$generalrule </p>
 <p>$authformkrb </p>
 <p>$authformint </p>
@@ -277,11 +291,20 @@
 <p>$authformloc </p>
 ENDNEWUSER
     } else { # user already exists
+    my %lt=&Apache::lonlocal::texthash(
+                    'cup'  => "Change User Privileges",
+                    'usr'  => "User",                    
+                    'id'   => "in domain",
+                    'fn'   => "first name",
+                    'mn'   => "middle name",
+                    'ln'   => "last name",
+                    'gen'  => "generation"
+				       );
 	$r->print(<<ENDCHANGEUSER);
 $dochead
-<h1>Change User Privileges</h1>
+<h1>$lt{'cup'}</h1>
 $forminfo
-<h2>User "$ccuname" in domain "$ccdomain"</h2>
+<h2>$lt{'usr'} "$ccuname" $lt{'id'} "$ccdomain"</h2>
 ENDCHANGEUSER
         # Get the users information
         my %userenv = &Apache::lonnet::get('environment',
@@ -292,7 +315,7 @@
 <hr />
 <table border="2">
 <tr>
-<th>first name</th><th>middle name</th><th>last name</th><th>generation</th>
+<th>$lt{'fn'}</th><th>$lt{'mn'}</th><th>$lt{'ln'}</th><th>$lt{'gen'}</th>
 </tr>
 <tr>
 END
@@ -305,7 +328,7 @@
                $r->print('<td>'.$userenv{$_}.'</td>');
            }
         }
-        $r->print(<<END);
+      $r->print(<<END);
 </tr>
 </table>
 END
@@ -313,11 +336,20 @@
         my ($tmp) = keys(%rolesdump);
         unless ($tmp =~ /^(con_lost|error)/i) {
            my $now=time;
+	   my %lt=&Apache::lonlocal::texthash(
+		    'rer'  => "Revoke Existing Roles",
+                    'rev'  => "Revoke",                    
+                    'del'  => "Delete",
+                    'rol'  => "Role",
+                    'ext'  => "Extent",
+                    'sta'  => "Start",
+                    'end'  => "End"
+				       );
            $r->print(<<END);
 <hr />
-<h3>Revoke Existing Roles</h3>
+<h3>$lt{'rer'}</h3>
 <table border=2>
-<tr><th>Revoke</th><th>Delete</th><th>Role</th><th>Extent</th><th>Start</th><th>End</th>
+<tr><th>$lt{'rev'}</th><th>$lt{'del'}</th><th>$lt{'rol'}</th><th>$lt{'ext'}</th><th>$lt{'sta'}</th><th>$lt{'end'}</th>
 END
 	   foreach my $area (sort { my $a1=join('_',(split('_',$a))[1,0]);
 				    my $b1=join('_',(split('_',$b))[1,0]);
@@ -342,11 +374,11 @@
                        &Apache::lonnet::coursedescription($1.'_'.$2);
 		   my $carea;
 		   if (defined($coursedata{'description'})) {
-		       $carea='Course: '.$coursedata{'description'}.
-                           '<br />Domain: '.$coursedom.('&nbsp;'x8).
+		       $carea=&mt('Course').': '.$coursedata{'description'}.
+                           '<br />'.&mt('Domain').': '.$coursedom.('&nbsp;'x8).
      &Apache::loncommon::syllabuswrapper('Syllabus',$coursedir,$coursedom);
 		   } else {
-		       $carea='Unavailable course: '.$area;
+		       $carea=&mt('Unavailable course').': '.$area;
 		   }
                    $inccourses{$1.'_'.$2}=1;
                    if ((&Apache::lonnet::allowed('c'.$role_code,$1.'/'.$2)) ||
@@ -408,7 +440,7 @@
                    if ($active) {
                       $row.='&nbsp;';
 		   } else {
-                      $row.='expired or revoked';
+                      $row.=&mt('expired or revoked');
 		   }
                }
 	       $row.='</td><td>';
@@ -521,7 +553,7 @@
             }
         }  ## End of "check for bad authentication type" logic
     } ## End of new user/old user logic
-    $r->print('<hr /><h3>Add Roles</h3>');
+    $r->print('<hr /><h3>'.&mt('Add Roles').'</h3>');
 #
 # Co-Author
 # 
@@ -530,20 +562,31 @@
         # No sense in assigning co-author role to yourself
 	my $cuname=$ENV{'user.name'};
         my $cudom=$ENV{'request.role.domain'};
+	   my %lt=&Apache::lonlocal::texthash(
+		    'cs'   => "Construction Space",
+                    'act'  => "Activate",                    
+                    'rol'  => "Role",
+                    'ext'  => "Extent",
+                    'sta'  => "Start",
+                    'end'  => "End".
+                    'cau'  => "Co-Author",
+                    'ssd'  => "Set Start Date",
+                    'sed'  => "Set End Date"
+				       );
        $r->print(<<ENDCOAUTH);
-<h4>Construction Space</h4>
-<table border=2><tr><th>Activate</th><th>Role</th><th>Extent</th>
-<th>Start</th><th>End</th></tr>
+<h4>$lt{'cs'}</h4>
+<table border=2><tr><th>${'act'}</th><th>${'rol'}</th><th>${'ext'}</th>
+<th>$lt{'sta'}</th><th>$lt{'end'}</th></tr>
 <tr>
 <td><input type=checkbox name="act_$cudom\_$cuname\_ca"></td>
-<td>Co-Author</td>
+<td>$lt{'cau'}</td>
 <td>$cudom\_$cuname</td>
 <td><input type=hidden name="start_$cudom\_$cuname\_ca" value=''>
 <a href=
-"javascript:pjump('date_start','Start Date Co-Author',document.cu.start_$cudom\_$cuname\_ca.value,'start_$cudom\_$cuname\_ca','cu.pres','dateset')">Set Start Date</a></td>
+"javascript:pjump('date_start','Start Date Co-Author',document.cu.start_$cudom\_$cuname\_ca.value,'start_$cudom\_$cuname\_ca','cu.pres','dateset')">$lt{'ssd'}</a></td>
 <td><input type=hidden name="end_$cudom\_$cuname\_ca" value=''>
 <a href=
-"javascript:pjump('date_end','End Date Co-Author',document.cu.end_$cudom\_$cuname\_ca.value,'end_$cudom\_$cuname\_ca','cu.pres','dateset')">Set End Date</a></td>
+"javascript:pjump('date_end','End Date Co-Author',document.cu.end_$cudom\_$cuname\_ca.value,'end_$cudom\_$cuname\_ca','cu.pres','dateset')">$lt{'sed'}</a></td>
 </tr>
 </table>
 ENDCOAUTH
@@ -551,7 +594,7 @@
 #
 # Domain level
 #
-    $r->print('<h4>Domain Level</h4>'.
+    $r->print('<h4>'.&mt('Domain Level').'</h4>'.
     '<table border=2><tr><th>Activate</th><th>Role</th><th>Extent</th>'.
     '<th>Start</th><th>End</th></tr>');
     foreach ( sort( keys(%incdomains))) {
@@ -559,6 +602,10 @@
         foreach ('dc','li','dg','au','sc') {
             if (&Apache::lonnet::allowed('c'.$_,$thisdomain)) {
                my $plrole=&Apache::lonnet::plaintext($_);
+	       my %lt=&Apache::lonlocal::texthash(
+                    'ssd'  => "Set Start Date",
+                    'sed'  => "Set End Date"
+				       );
                $r->print(<<ENDDROW);
 <tr>
 <td><input type=checkbox name="act_$thisdomain\_$_"></td>
@@ -566,10 +613,10 @@
 <td>$thisdomain</td>
 <td><input type=hidden name="start_$thisdomain\_$_" value=''>
 <a href=
-"javascript:pjump('date_start','Start Date $plrole',document.cu.start_$thisdomain\_$_.value,'start_$thisdomain\_$_','cu.pres','dateset')">Set Start Date</a></td>
+"javascript:pjump('date_start','Start Date $plrole',document.cu.start_$thisdomain\_$_.value,'start_$thisdomain\_$_','cu.pres','dateset')">$lt{'ssd'}</a></td>
 <td><input type=hidden name="end_$thisdomain\_$_" value=''>
 <a href=
-"javascript:pjump('date_end','End Date $plrole',document.cu.end_$thisdomain\_$_.value,'end_$thisdomain\_$_','cu.pres','dateset')">Set End Date</a></td>
+"javascript:pjump('date_end','End Date $plrole',document.cu.end_$thisdomain\_$_.value,'end_$thisdomain\_$_','cu.pres','dateset')">$lt{'sed'}</a></td>
 </tr>
 ENDDROW
             }
@@ -580,7 +627,7 @@
 # Course level
 #
     $r->print(&course_level_table(%inccourses));
-    $r->print("<hr /><input type=submit value=\"Modify User\">\n");
+    $r->print("<hr /><input type=submit value=\"".&mt('Modify User')."\">\n");
     $r->print("</form></body></html>");
 }
 
@@ -993,6 +1040,7 @@
 	}
 	$full{$priv}=1;
     }
+
     $r->print(<<ENDCCF);
 <form method="post">
 <input type="hidden" name="phase" value="set_custom_roles" />
@@ -1138,7 +1186,7 @@
 	$thiscourse=~s:_:/:g;
 	my %coursedata=&Apache::lonnet::coursedescription($thiscourse);
 	my $area=$coursedata{'description'};
-	if (!defined($area)) { $area='Unavailable course: '.$_; }
+	if (!defined($area)) { $area=&mt('Unavailable course').': '.$_; }
 	my $bgcol=$thiscourse;
 	$bgcol=~s/[^7-9a-e]//g;
 	$bgcol=substr($bgcol.$bgcol.$bgcol.'ffffff',2,6);

--sakharuk1071088689--