--- loncom/interface/lonuserutils.pm 2010/02/02 05:56:09 1.115 +++ loncom/interface/lonuserutils.pm 2010/03/21 14:15:58 1.117 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Utility functions for managing LON-CAPA user accounts # -# $Id: lonuserutils.pm,v 1.115 2010/02/02 05:56:09 raeburn Exp $ +# $Id: lonuserutils.pm,v 1.117 2010/03/21 14:15:58 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -3403,7 +3403,7 @@ sub results_header_row { if ($rolefilter eq 'Any') { $description .= &mt('All users with co-author roles in domain',$showfilter); } else { - $description .= &mt('All co-authors in domain with [_1] roles',$rolefilter); + $description .= &mt('All co-authors in domain with [_1] roles',$rolefilter); } } } elsif (($env{'form.roletype'} eq 'course') || @@ -4527,7 +4527,15 @@ sub update_user_list { } elsif ($choice eq 'chgsec') { my (@newsecs,$revresult,$nochg,@retained); 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. if (!$env{'form.retainsec'}) { @@ -4884,8 +4892,8 @@ function setSections(formname,crstype) { } else { numsplit = newsecs.split(/,/g); } - for (var i=0; i 0) { - sections = sections + "," + validsecstr; - } else { + if ((sections == '') || (sections == null)) { sections = validsecstr; + } else { + sections = sections + "," + validsecstr; } } formname.elements[num+2].value = sections;