Diff for /loncom/interface/lonuserutils.pm between versions 1.169 and 1.170

version 1.169, 2014/12/15 01:11:49 version 1.170, 2015/06/09 21:22:57
Line 450  sub javascript_validations { Line 450  sub javascript_validations {
     if (($mode eq 'upload') && ($context eq 'domain')) {      if (($mode eq 'upload') && ($context eq 'domain')) {
         $alert{'inststatus'} = &mt('The optional affiliation field was not specified');           $alert{'inststatus'} = &mt('The optional affiliation field was not specified'); 
     }      }
       &js_escape(\%alert);
     my $function_name = <<"END";      my $function_name = <<"END";
 $setsections_js  $setsections_js
   
Line 642  sub upload_manager_javascript_forward_as Line 643  sub upload_manager_javascript_forward_as
             $numbuttons ++;              $numbuttons ++;
         }          }
         if (!$can_assign->{'int'}) {          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.');                            &mt('Your current role does not have rights to create users with that authentication type.');
               &js_escape(\$warning);
             $auth_update = <<"END";              $auth_update = <<"END";
    // Currently the initial password field is only supported for internal auth     // Currently the initial password field is only supported for internal auth
    // (see bug 6368).     // (see bug 6368).
Line 781  sub upload_manager_javascript_reverse_as Line 783  sub upload_manager_javascript_reverse_as
         if (!$can_assign->{'int'}) {          if (!$can_assign->{'int'}) {
             my $warning = &mt('You may not specify an initial password, as this is only available when new users use LON-CAPA internal authentication.\n').              my $warning = &mt('You may not specify an initial password, 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.');                            &mt('Your current role does not have rights to create users with that authentication type.');
               &js_escape(\$warning);
             $auth_update = <<"END";              $auth_update = <<"END";
    // Currently the initial password field is only supported for internal auth     // Currently the initial password field is only supported for internal auth
    // (see bug 6368).     // (see bug 6368).
Line 3173  sub bulkaction_javascript { Line 3176  sub bulkaction_javascript {
     my $noaction = &mt("You need to select an action to take for the user(s) you have selected");       my $noaction = &mt("You need to select an action to take for the user(s) you have selected"); 
     my $singconfirm = &mt(' for a single user?');      my $singconfirm = &mt(' for a single user?');
     my $multconfirm = &mt(' for multiple users?');      my $multconfirm = &mt(' for multiple users?');
       &js_escape(\$alert);
       &js_escape(\$noaction);
       &js_escape(\$singconfirm);
       &js_escape(\$multconfirm);
     my $output = <<"ENDJS";      my $output = <<"ENDJS";
 function verify_action (field) {  function verify_action (field) {
     var numchecked = 0;      var numchecked = 0;
Line 5215  sub active_student_roles { Line 5222  sub active_student_roles {
   
 sub section_check_js {  sub section_check_js {
     my $groupslist= &get_groupslist();      my $groupslist= &get_groupslist();
       my %js_lt = &Apache::lonlocal::texthash(
           mayn   => 'may not be used as the name for a section, as it is a reserved word.',
           plch   => 'Please choose a different section name.',
           mnot   => 'may not be used as a section name, as it is the name of a course group.',
           secn   => 'Section names and group names must be distinct. Please choose a different section name.',
       );
       &js_escape(\%js_lt);
     return <<"END";      return <<"END";
 function validate(caller) {  function validate(caller) {
     var groups = new Array($groupslist);      var groups = new Array($groupslist);
     var secname = caller.value;      var secname = caller.value;
     if ((secname == 'all') || (secname == 'none')) {      if ((secname == 'all') || (secname == 'none')) {
         alert("'"+secname+"' may not be used as the name for a section, as it is a reserved word.\\nPlease choose a different section name.");          alert("'"+secname+"' $js_lt{'mayn'}\\n$js_lt{'plch'}");
         return 'error';          return 'error';
     }      }
     if (secname != '') {      if (secname != '') {
         for (var k=0; k<groups.length; k++) {          for (var k=0; k<groups.length; k++) {
             if (secname == groups[k]) {              if (secname == groups[k]) {
                 alert("'"+secname+"' may not be used as the name for a section, as it is the name of a course group.\\nSection names and group names must be distinct. Please choose a different section name.");                  alert("'"+secname+"' $js_lt{'mnot'}\\n$js_lt{'secn'}");
                 return 'error';                  return 'error';
             }              }
         }          }
Line 5385  sub setsections_javascript { Line 5399  sub setsections_javascript {
                     mnot => 'may not be used as a section name, as it is the name of a course group.',                      mnot => 'may not be used as a section name, as it is the name of a course group.',
                     secn => 'Section names and group names must be distinct. Please choose a different section name.',                      secn => 'Section names and group names must be distinct. Please choose a different section name.',
                     nonw => 'Section names may only contain letters or numbers.',                      nonw => 'Section names may only contain letters or numbers.',
                  );                                   );
       &js_escape(\%alerts);
     $setsection_js .= <<"ENDSECCODE";      $setsection_js .= <<"ENDSECCODE";
   
 function setSections(formname,crstype) {  function setSections(formname,crstype) {
Line 6022  sub sectioncheck_alerts { Line 6037  sub sectioncheck_alerts {
                     thwa => 'There was a problem with your course selection',                      thwa => 'There was a problem with your course selection',
                     thwc => 'There was a problem with your community selection',                      thwc => 'There was a problem with your community selection',
                  );                   );
       &js_escape(\%alerts);
     return %alerts;      return %alerts;
 }  }
   
Line 6032  sub authcheck_alerts { Line 6048  sub authcheck_alerts {
                     krb    => 'You need to specify the Kerberos domain.',                      krb    => 'You need to specify the Kerberos domain.',
                     ipass  => 'You need to specify the initial password.',                      ipass  => 'You need to specify the initial password.',
         );          );
       &js_escape(\%alerts);
     return %alerts;      return %alerts;
 }  }
   

Removed from v.1.169  
changed lines
  Added in v.1.170


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>