Diff for /loncom/interface/lonuserutils.pm between versions 1.116 and 1.117

version 1.116, 2010/02/19 15:41:40 version 1.117, 2010/03/21 14:15:58
Line 4527  sub update_user_list { Line 4527  sub update_user_list {
             } elsif ($choice eq 'chgsec') {              } elsif ($choice eq 'chgsec') {
                 my (@newsecs,$revresult,$nochg,@retained);                  my (@newsecs,$revresult,$nochg,@retained);
                 if (($role ne 'cc') && ($role ne 'co')) {                  if (($role ne 'cc') && ($role ne 'co')) {
                     @newsecs = split(/,/,$env{'form.newsecs'});                      my @secs = sort(split(/,/,$env{'form.newsecs'}));
                       if (@secs) {
                           my %curr_groups = &Apache::longroup::coursegroups();
                           foreach my $sec (@secs) {
                               next if (($sec =~ /\W/) || ($sec eq 'none') ||
                               (exists($curr_groups{$sec})));
                               push(@newsecs,$sec);
                           }
                       }
                 }                  }
                 # remove existing section if not to be retained.                     # remove existing section if not to be retained.   
                 if (!$env{'form.retainsec'}) {                  if (!$env{'form.retainsec'}) {
Line 4884  function setSections(formname,crstype) { Line 4892  function setSections(formname,crstype) {
                         } else {                          } else {
                             numsplit = newsecs.split(/,/g);                              numsplit = newsecs.split(/,/g);
                         }                          }
                         for (var i=0; i<numsplit.length; i++) {                          for (var m=0; m<numsplit.length; m++) {
                             var newsec = numsplit[i];                              var newsec = numsplit[m];
                             newsec = newsec.replace(trimleading,'');                              newsec = newsec.replace(trimleading,'');
                             newsec = newsec.replace(trimtrailing,'');                              newsec = newsec.replace(trimtrailing,'');
                             if (re2.test(newsec) == true) {                              if (re2.test(newsec) == true) {
Line 4894  function setSections(formname,crstype) { Line 4902  function setSections(formname,crstype) {
                                 if (newsec != '') {                                  if (newsec != '') {
                                     var isnew = 1;                                      var isnew = 1;
                                     if (fromexisting != null) {                                      if (fromexisting != null) {
                                         for (var m=0; m<fromexisting.length; m++) {                                          for (var n=0; n<fromexisting.length; n++) {
                                             if (newsec == fromexisting[m]) {                                              if (newsec == fromexisting[n]) {
                                                 isnew = 0;                                                  isnew = 0;
                                             }                                              }
                                         }                                          }
Line 4942  function setSections(formname,crstype) { Line 4950  function setSections(formname,crstype) {
                         }                          }
                     }                      }
                     if ((validsecstr != '') && (validsecstr != null)) {                      if ((validsecstr != '') && (validsecstr != null)) {
                         if (numsec > 0) {                          if ((sections == '') || (sections == null)) {
                             sections = sections + "," + validsecstr;  
                         } else {  
                             sections = validsecstr;                              sections = validsecstr;
                           } else {
                               sections = sections + "," + validsecstr;
                         }                          }
                     }                      }
                     formname.elements[num+2].value = sections;                      formname.elements[num+2].value = sections;

Removed from v.1.116  
changed lines
  Added in v.1.117


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