Diff for /loncom/interface/lonuserutils.pm between versions 1.97.2.12 and 1.97.2.13

version 1.97.2.12, 2010/01/20 21:37:37 version 1.97.2.13, 2010/01/20 21:42:30
Line 1731  sub section_group_filter { Line 1731  sub section_group_filter {
         }          }
         if (@options > 0) {          if (@options > 0) {
             my $currsel;              my $currsel;
             $markup = '<select name="'.$name{$item}.'" />'."\n";              $markup = '<select name="'.$name{$item}.'">'."\n";
             foreach my $option ('all','none',@options) {               foreach my $option ('all','none',@options) { 
                 $currsel = '';                  $currsel = '';
                 if ($env{'form.'.$name{$item}} eq $option) {                  if ($env{'form.'.$name{$item}} eq $option) {
Line 2942  sub print_username_link { Line 2942  sub print_username_link {
         $output = $in->{'username'};          $output = $in->{'username'};
     } else {      } else {
         $output = '<a href="javascript:username_display_launch('.          $output = '<a href="javascript:username_display_launch('.
                   "'$in->{'username'}','$in->{'domain'}'".')" />'.                    "'$in->{'username'}','$in->{'domain'}'".')">'.
                   $in->{'username'}.'</a>';                    $in->{'username'}.'</a>';
     }      }
     return $output;      return $output;
Line 4828  sub setsections_javascript { Line 4828  sub setsections_javascript {
                     plch => 'Please choose a different section name.',                      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.',                      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.',
                  );                                   );                
     $setsection_js .= <<"ENDSECCODE";      $setsection_js .= <<"ENDSECCODE";
   
 function setSections(formname,crstype) {  function setSections(formname,crstype) {
     var re1 = /^currsec_/;      var re1 = /^currsec_/;
       var re2 =/\\W/;
     var groups = new Array($groupslist);      var groups = new Array($groupslist);
     for (var i=0;i<formname.elements.length;i++) {      for (var i=0;i<formname.elements.length;i++) {
         var str = formname.elements[i].name;          var str = formname.elements[i].name;
Line 4876  function setSections(formname,crstype) { Line 4878  function setSections(formname,crstype) {
                     }                      }
                     var newsecs = formname.elements[i+1].value;                      var newsecs = formname.elements[i+1].value;
                     var numsplit;                      var numsplit;
                       var validsecs = new Array();
                       var badsecs = new Array();
                     if (newsecs != null && newsecs != "") {                      if (newsecs != null && newsecs != "") {
                         numsplit = newsecs.split(/,/g);                          numsplit = newsecs.split(/,/g);
                         numsec = numsec + numsplit.length;                          numsec = numsec + numsplit.length;
                           for (var i=0; i<numsplit.length; i++) {
                               if (re2.test(numsplit[i]) == true) {
                                   badsecs.push(numsplit[i]);
                               } else {
                                   validsecs.push(numsplit[i]);
                               }
                           }
                           if (badsecs.length > 0) {
                               alert("$alerts{'nonw'}\\n$alerts{'plch'}");
                               return;
                           }
                           numsec = numsec + validsecs.length;
                     }                      }
   
                     if ((role == 'st') && (numsec > 1)) {                      if ((role == 'st') && (numsec > 1)) {

Removed from v.1.97.2.12  
changed lines
  Added in v.1.97.2.13


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