Diff for /loncom/interface/lonparmset.pm between versions 1.522.2.23.2.2 and 1.522.2.26.2.3

version 1.522.2.23.2.2, 2017/06/19 19:04:51 version 1.522.2.26.2.3, 2021/01/19 00:44:10
Line 36  lonparmset - Handler to set parameters f Line 36  lonparmset - Handler to set parameters f
   
 =head1 SYNOPSIS  =head1 SYNOPSIS
   
 lonparmset provides an interface to setting course parameters.   lonparmset provides an interface to setting content parameters in a 
   course.
   
 =head1 DESCRIPTION  =head1 DESCRIPTION
   
Line 129  javascript function 'pjump'. Line 130  javascript function 'pjump'.
   
 =item print_td()  =item print_td()
   
 =item print_usergroups()  =item check_other_groups()
   
 =item parm_control_group()  =item parm_control_group()
   
Line 752  sub storeparm_by_symb_inner { Line 753  sub storeparm_by_symb_inner {
   
   
 sub valout {  sub valout {
     my ($value,$type,$name,$editable)=@_;      my ($value,$type,$editable)=@_;
     my $result = '';      my $result = '';
     # Values of zero are valid.      # Values of zero are valid.
     if (! $value && $value ne '0') {      if (! $value && $value ne '0') {
Line 833  sub plink { Line 834  sub plink {
     my ($type,$dis,$value,$marker,$return,$call)=@_;      my ($type,$dis,$value,$marker,$return,$call)=@_;
     my $winvalue=$value;      my $winvalue=$value;
     unless ($winvalue) {      unless ($winvalue) {
     if (&isdateparm($type)) {          if ((&isdateparm($type)) || (&is_specialstring($type))) {
             $winvalue=$env{'form.recent_'.$type};              $winvalue=$env{'form.recent_'.$type};
           } elsif ($type eq 'string_yesno') {
               if ($env{'form.recent_string'} =~ /^(yes|no)$/i) {
                   $winvalue=$env{'form.recent_string'};
               }
         } else {          } else {
             $winvalue=$env{'form.recent_'.(split(/\_/,$type))[0]};              $winvalue=$env{'form.recent_'.(split(/\_/,$type))[0]};
         }          }
Line 842  sub plink { Line 847  sub plink {
     my ($parmname)=((split(/\&/,$marker))[1]=~/\_([^\_]+)$/);      my ($parmname)=((split(/\&/,$marker))[1]=~/\_([^\_]+)$/);
     my ($hour,$min,$sec,$val)=&preset_defaults($parmname);      my ($hour,$min,$sec,$val)=&preset_defaults($parmname);
     unless (defined($winvalue)) { $winvalue=$val; }      unless (defined($winvalue)) { $winvalue=$val; }
     my $valout = &valout($value,$type,$parmname,1);      my $valout = &valout($value,$type,1);
     my $unencmarker = $marker;      my $unencmarker = $marker;
     foreach my $item (\$type, \$dis, \$winvalue, \$marker, \$return, \$call,      foreach my $item (\$type, \$dis, \$winvalue, \$marker, \$return, \$call,
               \$hour, \$min, \$sec) {                \$hour, \$min, \$sec) {
Line 867  sub page_js { Line 872  sub page_js {
     $pjump_def      $pjump_def
   
     function psub() {      function psub() {
           var specstring = /^string_!(yesno|any)/i;
         if (document.parmform.pres_marker.value!='') {          if (document.parmform.pres_marker.value!='') {
             document.parmform.action+='#'+document.parmform.pres_marker.value;              document.parmform.action+='#'+document.parmform.pres_marker.value;
             var typedef=new Array();              var typedef=new Array();
             typedef=document.parmform.pres_type.value.split('_');              typedef=document.parmform.pres_type.value.split('_');
            if (document.parmform.pres_type.value!='') {              if (document.parmform.pres_type.value!='') {
             if (typedef[0]=='date') {                  if ((typedef[0]=='date') ||
                 eval('document.parmform.recent_'+                      (specstring.test(document.parmform.pres_type.value)))  {
                      document.parmform.pres_type.value+                      eval('document.parmform.recent_'+
              '.value=document.parmform.pres_value.value;');                          document.parmform.pres_type.value+
             } else {                          '.value=document.parmform.pres_value.value;');
                 eval('document.parmform.recent_'+typedef[0]+                  } else {
              '.value=document.parmform.pres_value.value;');                      eval('document.parmform.recent_'+typedef[0]+
                           '.value=document.parmform.pres_value.value;');
                   }
             }              }
        }  
             document.parmform.submit();              document.parmform.submit();
         } else {          } else {
             document.parmform.pres_value.value='';              document.parmform.pres_value.value='';
Line 922  function showHide_courseContent() { Line 929  function showHide_courseContent() {
 COURSECONTENTSCRIPT  COURSECONTENTSCRIPT
 }  }
   
   sub validateparms_js {
       return <<'ENDSCRIPT';
   
   function validateParms() {
       var ipallowRegExp = /^setipallow_/;
       var ipdenyRegExp = /^setipdeny_/;
       var patternIP = /[\[\]\*\.a-zA-Z\d\-]+/;
       if ((document.parmform.elements.length != 'undefined')  && (document.parmform.elements.length) != 'null') {
           if (document.parmform.elements.length) {
               for (i=0; i<document.parmform.elements.length; i++) {
                   var name=document.parmform.elements[i].name;
                   if (ipallowRegExp.test(name)) {
                       var identifier = name.replace(ipallowRegExp,'');
                       var possallow = document.parmform.elements[i].value;
                       possallow = possallow.replace(/^\s+|\s+$/g,'');
                       if (patternIP.test(possallow)) {
                           if (document.parmform.elements['set_'+identifier].value) {
                               possallow = ','+possallow;
                           }
                           document.parmform.elements['set_'+identifier].value += possallow;
                       }
                   } else if (ipdenyRegExp.test(name)) {
                       var identifier = name.replace(ipdenyRegExp,'');
                       var possdeny = document.parmform.elements[i].value;
                       possdeny = possdeny.replace(/^\s+|\s+$/g,'');
                       if (patternIP.test(possdeny)) {
                           possdeny = '!'+possdeny;
                           if (document.parmform.elements['set_'+identifier].value) {
                               possdeny = ','+possdeny;
                           }
                       }
                   }
               }
           }
       }
       return true;
   }
   
   ENDSCRIPT
   }
   
   # Javascript initialization, for overview mode
   sub ipacc_boxes_js  {
       my $remove = &mt('Remove');
       return <<"END";
   \$(document).ready(function() {
       var wrapper         = \$(".LC_string_ipacc_wrap");
       var add_button      = \$(".LC_add_ipacc_button");
       var ipaccRegExp     = /^LC_string_ipacc_/;
   
       \$(add_button).click(function(e){
           e.preventDefault();
           var identifier = \$(this).closest("div").attr("id");
           identifier = identifier.replace(ipaccRegExp,'');
           \$(this).closest('div').find('.LC_string_ipacc_inner').append('<div><input type="text" name="setip'+identifier+'" /><a href="#" class="LC_remove_ipacc">$remove</a></div>');
       });
   
       \$(wrapper).delegate(".LC_remove_ipacc","click", function(e){
           e.preventDefault(); \$(this).closest("div").remove();
       })
   });
   
   
   END
   }
   
 sub done_proctor_js {  sub done_proctor_js {
     return <<"END";      return <<"END";
 function toggleSecret(form,radio,key) {  function toggleSecret(form,radio,key) {
Line 1036  sub print_row { Line 1109  sub print_row {
     my $thismarker=$which;      my $thismarker=$which;
     $thismarker=~s/^parameter\_//;      $thismarker=~s/^parameter\_//;
     my $mprefix=$rid.'&'.$thismarker.'&';      my $mprefix=$rid.'&'.$thismarker.'&';
     my $effective_parm = &valout($outpar[$result],$typeoutpar[$result],$thismarker);      my $effective_parm = &valout($outpar[$result],$typeoutpar[$result]);
     my ($othergrp,$grp_parm,$controlgrp);      my ($othergrp,$grp_parm,$controlgrp);
   
     if ($parmlev eq 'general') {      if ($parmlev eq 'general') {
Line 1066  sub print_row { Line 1139  sub print_row {
             if (@{$usersgroups} > 1) {              if (@{$usersgroups} > 1) {
                 my ($coursereply,$grp_parm,$controlgrp);                  my ($coursereply,$grp_parm,$controlgrp);
                 ($coursereply,$othergrp,$grp_parm,$controlgrp) =                  ($coursereply,$othergrp,$grp_parm,$controlgrp) =
                     &print_usergroups($r,$$part{$which}.'.'.$$name{$which},                      &check_other_groups($$part{$which}.'.'.$$name{$which},
                        $rid,$cgroup,$defbgone,$usersgroups,$result,$courseopt);                         $rid,$cgroup,$defbgone,$usersgroups,$result,$courseopt);
                 if ($coursereply && $result > 3) {                  if ($coursereply && $result > 3) {
                     if (defined($controlgrp)) {                      if (defined($controlgrp)) {
Line 1116  sub print_row { Line 1189  sub print_row {
         my $sessionvaltype=$typeoutpar[$result];          my $sessionvaltype=$typeoutpar[$result];
         if (!defined($sessionvaltype)) { $sessionvaltype=$$defaulttype{$which}; }          if (!defined($sessionvaltype)) { $sessionvaltype=$$defaulttype{$which}; }
         $r->print('<td style="background-color:#999999;" align="center"><font color="#FFFFFF">'.          $r->print('<td style="background-color:#999999;" align="center"><font color="#FFFFFF">'.
                   &valout($sessionval,$sessionvaltype,$$name{$which}).'&nbsp;'.                    &valout($sessionval,$sessionvaltype).'&nbsp;'.
                   '</font></td>');                    '</font></td>');
     }      }
     $r->print('</tr>');      $r->print('</tr>');
Line 1133  sub print_td { Line 1206  sub print_td {
     } else {      } else {
         if ($which == 11 || $which == 12) {          if ($which == 11 || $which == 12) {
             $nolink = 1;              $nolink = 1;
         } elsif ($mprefix =~ /availablestudent\&$/) {          } elsif (($env{'request.course.sec'} ne '') && ($which > 9)) {
             if ($which > 3) {              $nolink = 1;
           } elsif ($which == 4 || $which ==  5 || $which == 6) {
               if ($noeditgrp) {
                 $nolink = 1;                  $nolink = 1;
             }              }
           } elsif ($mprefix =~ /availablestudent\&$/) {
               $nolink = 1;
         } elsif ($mprefix =~ /examcode\&$/) {          } elsif ($mprefix =~ /examcode\&$/) {
             unless ($which == 2) {              unless ($which == 2) {
                 $nolink = 1;                  $nolink = 1;
Line 1144  sub print_td { Line 1221  sub print_td {
         }          }
     }      }
     if ($nolink) {      if ($nolink) {
         $r->print(&valout($$outpar[$which],$$typeoutpar[$which],$mprefix));          $r->print(&valout($$outpar[$which],$$typeoutpar[$which]));
     } else {      } else {
         $r->print(&plink($$typeoutpar[$which],          $r->print(&plink($$typeoutpar[$which],
                          $$display{$value},$$outpar[$which],                           $$display{$value},$$outpar[$which],
Line 1153  sub print_td { Line 1230  sub print_td {
     $r->print('</td>'."\n");      $r->print('</td>'."\n");
 }  }
   
 sub print_usergroups {  sub check_other_groups {
     my ($r,$what,$rid,$cgroup,$defbg,$usersgroups,$result,$courseopt) = @_;      my ($what,$rid,$cgroup,$defbg,$usersgroups,$result,$courseopt) = @_;
     my $courseid = $env{'request.course.id'};      my $courseid = $env{'request.course.id'};
     my $output;      my $output;
     my $symb = &symbcache($rid);      my $symb = &symbcache($rid);
Line 1169  sub print_usergroups { Line 1246  sub print_usergroups {
     if (($coursereply) && ($cgroup ne $resultgroup)) {      if (($coursereply) && ($cgroup ne $resultgroup)) {
         if ($result > 3) {          if ($result > 3) {
             $bgcolor = '#AAFFAA';              $bgcolor = '#AAFFAA';
             $grp_parm = &valout($coursereply,$resulttype,$what);  
         }          }
         $grp_parm = &valout($coursereply,$resulttype,$what);          $grp_parm = &valout($coursereply,$resulttype);
         $output = '<td style="background-color:'.$bgcolor.';" align="center">';          $output = '<td style="background-color:'.$bgcolor.';" align="center">';
         if ($resultgroup && $resultlevel) {          if ($resultgroup && $resultlevel) {
             $output .= '<small><b>'.$resultgroup.'</b> ('.$resultlevel.'): </small>'.$grp_parm;              $output .= '<small><b>'.$resultgroup.'</b> ('.$resultlevel.'): </small>'.$grp_parm;
Line 1315  sub isdateparm { Line 1391  sub isdateparm {
     return (($type=~/^date/) && (!($type eq 'date_interval')));      return (($type=~/^date/) && (!($type eq 'date_interval')));
 }  }
   
   # Determine if parameter type is specialized string type (i.e.,
   # not just string or string_yesno.
   
   sub is_specialstring {
       my $type=shift;
       return (($type=~/^string_/) && (($type ne 'string_yesno')));
   }
   
 #  #
 # parmmenu displays a list of the selected parameters.  # parmmenu displays a list of the selected parameters.
 # It also offers a link to show/hide the complete parameter list  # It also offers a link to show/hide the complete parameter list
 # from which you can select all desired parameters.  # from which you can select all desired parameters.
 #  #
 sub parmmenu {  sub parmmenu {
     my ($r,$allparms,$pscat,$keyorder)=@_;      my ($r)=@_;
     my $tempkey;  
     $r->print(<<ENDSCRIPT);      $r->print(<<ENDSCRIPT);
 <script type="text/javascript">  <script type="text/javascript">
 // <![CDATA[  // <![CDATA[
Line 1401  sub parmmenu { Line 1484  sub parmmenu {
 ENDSCRIPT  ENDSCRIPT
   
     $r->print('<hr />');      $r->print('<hr />');
     &shortCuts($r,$allparms,$pscat,$keyorder);      &shortCuts($r);
     $r->print('<hr />');      $r->print('<hr />');
 }  }
 # return a hash  # return a hash
Line 1466  sub lookUpTableParameter { Line 1549  sub lookUpTableParameter {
         'retrypartial' => 'tries',          'retrypartial' => 'tries',
         'discussvote'  => 'misc',          'discussvote'  => 'misc',
         'examcode' => 'high_level_randomization',          'examcode' => 'high_level_randomization',
     );          );
 }  }
   
 sub whatIsMyCategory {  sub whatIsMyCategory {
Line 1548  sub parmboxes { Line 1631  sub parmboxes {
                   .&mt($categories{$key})                    .&mt($categories{$key})
                   .'</h4>'."\n");                    .'</h4>'."\n");
         foreach $tempkey (&keysindisplayorderCategory($categoryList{$key},$keyorder)) {          foreach $tempkey (&keysindisplayorderCategory($categoryList{$key},$keyorder)) {
               next if ($tempkey eq '');
             $r->print('<span class="LC_nobreak">'              $r->print('<span class="LC_nobreak">'
                      .'<label><input type="checkbox" name="pscat" '                       .'<label><input type="checkbox" name="pscat" '
                      .'value="'.$tempkey.'" ');                       .'value="'.$tempkey.'" ');
Line 1567  sub parmboxes { Line 1651  sub parmboxes {
 # This function offers some links on the parameter section to get with one click a group a parameters  # This function offers some links on the parameter section to get with one click a group a parameters
 #  #
 sub shortCuts {  sub shortCuts {
     my ($r,$allparms,$pscat,$keyorder)=@_;      my ($r)=@_;
   
     # Parameter Selection      # Parameter Selection
     $r->print(      $r->print(
Line 1626  sub partmenu { Line 1710  sub partmenu {
 }  }
   
 sub usermenu {  sub usermenu {
     my ($r,$uname,$id,$udom,$csec,$cgroup,$parmlev,$usersgroups)=@_;      my ($r,$uname,$id,$udom,$csec,$cgroup,$parmlev,$usersgroups,$pssymb)=@_;
     my $chooseopt=&Apache::loncommon::select_dom_form($udom,'udom').' '.      my $chooseopt=&Apache::loncommon::select_dom_form($udom,'udom').' '.
         &Apache::loncommon::selectstudent_link('parmform','uname','udom');                    &Apache::loncommon::selectstudent_link('parmform','uname','udom','condition').
     my $selscript=&Apache::loncommon::studentbrowser_javascript();                    &Apache::lonhtmlcommon::scripttag(<<ENDJS);
   function setCourseadv(form,caller) {
       if (caller.value == 'st') {
           form.courseadv.value = 'none';
       } else {
           form.courseadv.value = '';
       }
       return;
   }
   ENDJS
   
       my (%chkroles,$stuonly,$courseadv);
       if ($env{'form.userroles'} eq 'any') {
           $chkroles{'any'} = ' checked="checked"';
       } else {
           $chkroles{'st'} = ' checked="checked"';
           $courseadv = 'none';
       }
       my $crstype = $env{'course.'.$env{'request.course.id'}.'.type'};
       if ($crstype eq 'Community') {
           $stuonly = &mt('member only');
       } else {
           $stuonly = &mt('student only');
       }
       $chooseopt .= '<br /><span class="LC_cusr_subheading">'.
                     &mt("User's role").':&nbsp;'.
                     '<label><input type="radio" name="userroles" value="st"'.$chkroles{'st'}.' onclick="setCourseadv(this.form,this);" />'.
                     $stuonly.'</label>&nbsp;&nbsp;'.
                     '<label><input type="radio" name="userroles" value="any"'.$chkroles{'any'}.' onclick="setCourseadv(this.form,this);" />'.
                     &mt('any role').'</label><input type="hidden" id="courseadv" name="courseadv" value="'.$courseadv.'" /></span>';
     my $sections='';      my $sections='';
     my %sectionhash = &Apache::loncommon::get_sections();      my %sectionhash = &Apache::loncommon::get_sections();
   
     my $groups;      my $groups;
     my %grouphash = &Apache::longroup::coursegroups();      my %grouphash;
       if (($pssymb) || &Apache::lonnet::allowed('mdg',$env{'request.course.id'})) {
           %grouphash = &Apache::longroup::coursegroups();
       } elsif ($env{'request.course.groups'} ne '') {
           map { $grouphash{$_} = 1; } split(/:/,$env{'request.course.groups'});
       }
   
     my $g_s_header='';      my $g_s_header='';
     my $g_s_footer='';      my $g_s_footer='';
   
     if (%sectionhash) {      my $currsec = $env{'request.course.sec'};
       if ($currsec) {
           $sections=&mt('Section:').' '.$currsec;
           if (%grouphash) {
               $sections .= ';'.('&nbsp;' x2);
           }
       } elsif (%sectionhash && $currsec eq '') {
         $sections=&mt('Section:').' <select name="csec"';          $sections=&mt('Section:').' <select name="csec"';
         if (%grouphash && $parmlev ne 'full') {          if (%grouphash && $parmlev ne 'full') {
             $sections .= qq| onchange="group_or_section('csec')" |;              $sections .= qq| onchange="group_or_section('csec')" |;
Line 1654  sub usermenu { Line 1777  sub usermenu {
         $sections.='</select>';          $sections.='</select>';
     }      }
   
     if (%sectionhash && %grouphash && $parmlev ne 'full') {      if (%sectionhash && %grouphash && $parmlev ne 'full' && $currsec eq '') {
         $sections .= '&nbsp;'.&mt('or').'&nbsp;';          $sections .= '&nbsp;'.&mt('or').'&nbsp;';
         $sections .= qq|          $sections .= qq|
 <script type="text/javascript">  <script type="text/javascript">
Line 1673  function group_or_section(caller) { Line 1796  function group_or_section(caller) {
 // ]]>  // ]]>
 </script>  </script>
 |;  |;
     } else {      } elsif ($currsec eq '') {
         $sections .= qq|          $sections .= qq|
 <script type="text/javascript">  <script type="text/javascript">
 // <![CDATA[  // <![CDATA[
Line 1687  function group_or_section(caller) { Line 1810  function group_or_section(caller) {
   
     if (%grouphash) {      if (%grouphash) {
         $groups=&mt('Group:').' <select name="cgroup"';          $groups=&mt('Group:').' <select name="cgroup"';
         if (%sectionhash && $env{'form.action'} eq 'settable') {          if (%sectionhash && $env{'form.action'} eq 'settable' && $currsec eq '') {
             $groups .= qq| onchange="group_or_section('cgroup')" |;              $groups .= qq| onchange="group_or_section('cgroup')" |;
         }          }
         $groups .= '>';          $groups .= '>';
Line 1726  function group_or_section(caller) { Line 1849  function group_or_section(caller) {
 # This function shows on table Mode the available Parameters for the selected Resources  # This function shows on table Mode the available Parameters for the selected Resources
 #  #
 sub displaymenu {  sub displaymenu {
     my ($r,$allparms,$pscat,$psprt,$keyorder,$divid)=@_;      my ($r,$allparms,$pscat,$keyorder,$divid)=@_;
   
     $r->print(&Apache::lonhtmlcommon::start_pick_box());      $r->print(&Apache::lonhtmlcommon::start_pick_box());
     $r->print(&Apache::lonhtmlcommon::row_title(&mt('Select Parameters to View')));      $r->print(&Apache::lonhtmlcommon::row_title(&mt('Select Parameters to View')));
   
     &parmmenu($r,$allparms,$pscat,$keyorder);      &parmmenu($r);
     $r->print(&Apache::loncommon::start_scrollbox('480px','440px','200px',$divid));      $r->print(&Apache::loncommon::start_scrollbox('480px','440px','200px',$divid));
     &parmboxes($r,$allparms,$pscat,$keyorder);      &parmboxes($r,$allparms,$pscat,$keyorder);
     $r->print(&Apache::loncommon::end_scrollbox());      $r->print(&Apache::loncommon::end_scrollbox());
Line 1911  sub levelmenu { Line 2034  sub levelmenu {
   
   
 sub sectionmenu {  sub sectionmenu {
     my ($r,$selectedsections)=@_;      my ($selectedsections)=@_;
     my %sectionhash = &Apache::loncommon::get_sections();      my %sectionhash = &Apache::loncommon::get_sections();
     return if (!%sectionhash);      return '' if (!%sectionhash);
   
     $r->print('<select name="Section" multiple="multiple" size="8">');      my (@possibles,$disabled);
     foreach my $s ('all',sort keys %sectionhash) {      if ($env{'request.course.sec'} ne '') {
     $r->print('    <option value="'.$s.'"');          @possibles = ($env{'request.course.sec'});
     foreach (@{$selectedsections}) {          $selectedsections = [$env{'request.course.sec'}];
         if ($s eq $_) {          $disabled = ' disabled="disabled"';
         $r->print(' selected="selected"');      } else {
         last;          @possibles = ('all',sort(keys(%sectionhash)));
         }  
     }      }
     $r->print('>'.$s."</option>\n");      my $output = '<select name="Section" multiple="multiple" size="8"'.$disabled.'>';
       foreach my $s (@possibles) {
           $output .= '    <option value="'.$s.'"';
           if ((@{$selectedsections}) && (grep(/^\Q$s\E$/,@{$selectedsections}))) {
               $output .= ' selected="selected"';
           }
           $output .= '>'."$s</option>\n";
     }      }
     $r->print("</select>\n");      $output .= "</select>\n";
       return $output;
 }  }
   
 sub groupmenu {  sub groupmenu {
     my ($r,$selectedgroups)=@_;      my ($selectedgroups)=@_;
     my %grouphash = &Apache::longroup::coursegroups();      my %grouphash;
     return if (!%grouphash);      if (&Apache::lonnet::allowed('mdg',$env{'request.course.id'})) {
           %grouphash = &Apache::longroup::coursegroups();
       } elsif ($env{'request.course.groups'} ne '') {
           map { $grouphash{$_} = 1; } split(/:/,$env{'request.course.groups'});
       }
       return '' if (!%grouphash);
   
     $r->print('<select name="Group" multiple="multiple" size="8">');      my $output = '<select name="Group" multiple="multiple" size="8">';
     foreach my $group (sort(keys(%grouphash))) {      foreach my $group (sort(keys(%grouphash))) {
     $r->print('    <option value="'.$group.'"');          $output .= '    <option value="'.$group.'"';
     foreach (@{$selectedgroups}) {          if ((@{$selectedgroups}) && (grep(/^\Q$group\E$/,\@{$selectedgroups}))) {
         if ($group eq $_) {              $output .= ' selected="selected"';
         $r->print(' selected="selected"');  
         last;  
         }          }
           $output .= '>'.$group."</option>\n";
     }      }
     $r->print('>'.$group."</option>\n");      $output .= "</select>\n";
     }      return $output;
     $r->print("</select>\n");  
 }  }
   
   
 sub keysplit {  sub keysplit {
     my $keyp=shift;      my $keyp=shift;
     return (split(/\,/,$keyp));      return (split(/\,/,$keyp));
Line 2067  sub assessparms { Line 2198  sub assessparms {
     my $message='';      my $message='';
   
     $csec=$env{'form.csec'};      $csec=$env{'form.csec'};
       if ($env{'request.course.sec'} ne '') {
           $csec = $env{'request.course.sec'};    
       }
   
   # Check group privs.
     $cgroup=$env{'form.cgroup'};      $cgroup=$env{'form.cgroup'};
     my $noeditgrp;      my $noeditgrp;
     if ($cgroup ne '') {      if ($cgroup ne '') {
         unless (&Apache::lonnet::allowed('mdg',$env{'request.course.id'})) {          unless (&Apache::lonnet::allowed('mdg',$env{'request.course.id'})) {
             if (($env{'request.course.groups'} eq '') ||              if (($env{'request.course.groups'} eq '') ||
                 (!grep(/^\Q$cgroup\E$/,split(/,/,$env{'request.course.groups'})))) {                  (!grep(/^\Q$cgroup\E$/,split(/:/,$env{'request.course.groups'})))) {
                 $noeditgrp = 1;                  $noeditgrp = 1;
             }              }
         }          }
Line 2148  sub assessparms { Line 2284  sub assessparms {
             $csec=&Apache::lonnet::getsection($udom,$uname,              $csec=&Apache::lonnet::getsection($udom,$uname,
                           $env{'request.course.id'});                            $env{'request.course.id'});
             if ($csec eq '-1') {              if ($csec eq '-1') {
                 $message='<span class="LC_error">'.                  my $crstype = $env{'course.'.$env{'request.course.id'}.'.type'};
                 &mt("User")." '$uname' ".&mt("at domain")." '$udom' ".                  if ($env{'form.userroles'} eq 'any') {
                 &mt("not in this course")."</span>";                      if (($env{'user.name'} eq $uname) && ($env{'user.domain'} eq $udom)) {
                 $uname='';                          $csec = $env{'request.course.sec'};
                 $csec=$env{'form.csec'};                          $message = '<span class="LC_info">';
                           if ($crstype eq 'Community') {
                               $message .= &mt('User [_1] at domain [_2] has a non-member role in this community',
                                               $uname,$udom);
                           } else {
                               $message .= &mt('User [_1] at domain [_2] has a non-student role in this course',
                                               $uname,$udom);
                           }
                           $message .= '</span>';
                       } else {
                           my @possroles = ('in','ep','ta','cr');
                           if ($crstype eq 'Community') {
                               unshift(@possroles,'co');
                           } else {
                               unshift(@possroles,'cc');
                           }
                           my %not_student_roles =
                               &Apache::lonnet::get_my_roles($uname,$udom,'userroles',['active'],
                                                             \@possroles,[$udom],1,1);
                           my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};
                           my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'};
                           my %sections_by_role;
                           foreach my $role (keys(%not_student_roles)) {
                               if ($role =~ /^\Q$cnum:$cdom:\E([^:]+):(|[^:]+)$/) {
                                   my ($rolename,$sec) = ($1,$2);
                                   if ($rolename =~ m{^cr/}) {
                                       $rolename = 'cr';
                                   }
                                   push(@{$sections_by_role{$rolename}},$sec);
                               }
                           }
                           my $numroles = scalar(keys(%sections_by_role));
                           if ($numroles) {
                               foreach my $role (@possroles) {
                                   if (ref($sections_by_role{$role}) eq 'ARRAY') {
                                       my @secs = sort { $a <=> $b } @{$sections_by_role{$role}};
                                       $csec = $secs[0];
                                       last;
                                   }
                               }
                           }
                           if ($csec eq '-1') {
                               $message = '<span class="LC_warning">';
                               if ($crstype eq 'Community') {
                                   $message .= &mt('User [_1] at domain [_2] does not have a role in this community',
                                                   $uname,$udom);
                               } else {
                                   $message .= &mt('User [_1] at domain [_2] does not have a role in this course',
                                                   $uname,$udom);
                               }
                               $message .= '</span>';
                               $uname='';
                               if ($env{'request.course.sec'} ne '') {
                                   $csec=$env{'request.course.sec'};
                               } else {
                                   $csec=$env{'form.csec'};
                               }
                               $cgroup=$env{'form.cgroup'};
                           } else {
                               $message = '<span class="LC_info">';
                               if ($crstype eq 'Community') {
                                   $message .= &mt('User [_1] at domain [_2] has a non-member role in this community',
                                            $uname,$udom);
                               } else {
                                   $message .= &mt('User [_1] at domain [_2] has a non-student role in this course',
                                                   $uname,$udom);
                               }
                               $message .= '</span>';
                           }
                       }
                   } else {
                       $message = '<span class="LC_warning">';
                       if ($crstype eq 'Community') {
                           $message .= &mt('User [_1] at domain [_2] does not have a member role in this community',
                                            $uname,$udom);
                       } else {
                            $message .= &mt('User [_1] at domain [_2] does not have a student role in this course',
                                            $uname,$udom);
                       }
                       $message .= '</span>';
                       $uname='';
                       if ($env{'request.course.sec'} ne '') {
                           $csec=$env{'request.course.sec'};
                       } else {
                           $csec=$env{'form.csec'};
                       }
                       $cgroup=$env{'form.cgroup'};
                   }
               } elsif ($env{'request.course.sec'} ne '') {
                   if ($csec ne $env{'request.course.sec'}) {
                       $message='<span class="LC_warning">'.
                                 &mt("User '[_1]' at domain '[_2]' not in section '[_3]'",
                                     $uname,$udom,$env{'request.course.sec'}).
                                 '</span>';
                       $uname='';
                       $csec=$env{'request.course.sec'};
                   }
                 $cgroup=$env{'form.cgroup'};                  $cgroup=$env{'form.cgroup'};
             } else {              }
               if ($uname ne '') {
                 my %name=&Apache::lonnet::userenvironment($udom,$uname,                  my %name=&Apache::lonnet::userenvironment($udom,$uname,
                   ('firstname','middlename','lastname','generation','id'));                    ('firstname','middlename','lastname','generation','id'));
                 $message="\n<p>\n".&mt("Full Name").": ".                  $message .= "\n<p>\n".&mt('Full Name').': ' 
                 $name{'firstname'}.' '.$name{'middlename'}.' '                              .$name{'firstname'}.' '.$name{'middlename'}.' '
                 .$name{'lastname'}.' '.$name{'generation'}.                              .$name{'lastname'}.' '.$name{'generation'}
                 "<br />\n".&mt('Student/Employee ID').": ".$name{'id'}.'<p>';                              ."<br />\n".&mt('Student/Employee ID').': '.$name{'id'}.'</p>';
             }                  @usersgroups = &Apache::lonnet::get_users_groups(
             @usersgroups = &Apache::lonnet::get_users_groups(                                     $udom,$uname,$env{'request.course.id'});
                                        $udom,$uname,$env{'request.course.id'});                  if (@usersgroups > 0) {
             if (@usersgroups > 0) {                      unless (grep(/^\Q$cgroup\E$/,@usersgroups)) {
                 unless (grep(/^\Q$cgroup\E$/,@usersgroups)) {                          $cgroup = $usersgroups[0];
                     $cgroup = $usersgroups[0];                      }
                   } else {
                       $cgroup = '';
                 }                  }
             }              }
         }          }
Line 2194  sub assessparms { Line 2429  sub assessparms {
         my ($got_chostname,$chostname,$cmajor,$cminor);          my ($got_chostname,$chostname,$cmajor,$cminor);
         my $totalstored = 0;          my $totalstored = 0;
         my $now = time;          my $now = time;
   
         for (my $i=0;$i<=$#markers;$i++) {          for (my $i=0;$i<=$#markers;$i++) {
             my ($needsrelease,$needsnewer,$name);              my ($needsrelease,$needsnewer,$name);
               if (($env{'request.course.sec'} ne '') && ($markers[$i] =~ /\&(7|8|9)$/)) {
                   next if ($csec ne $env{'request.course.sec'});
               }
               if ($markers[$i] =~ /\&(6|5|4)$/) {
                   next if ($noeditgrp);
               }
             if ($markers[$i] =~ /^[\d.]+\&0_availablestudent\&(1|2|3)$/) {              if ($markers[$i] =~ /^[\d.]+\&0_availablestudent\&(1|2|3)$/) {
                 my (@ok_slots,@fail_slots,@del_slots);                  my (@ok_slots,@fail_slots,@del_slots);
                 my $courseopt=&Apache::lonnet::get_courseresdata($cnum,$cdom);                  my $courseopt=&Apache::lonnet::get_courseresdata($cnum,$cdom);
Line 2286  sub assessparms { Line 2526  sub assessparms {
   
     &startpage($r,$pssymb);      &startpage($r,$pssymb);
   
     foreach ('tolerance','date_default','date_start','date_end',      foreach my $item ('tolerance','date_default','date_start','date_end',
         'date_interval','int','float','string') {                        'date_interval','int','float','string','string_lenient',
                         'string_examcode','string_deeplink','string_discussvote',
                         'string_useslots','string_problemstatus','string_ip',
                         'string_questiontype') {
         $r->print('<input type="hidden" value="'.          $r->print('<input type="hidden" value="'.
           &HTML::Entities::encode($env{'form.recent_'.$_},'"&<>').            &HTML::Entities::encode($env{'form.recent_'.$item},'"&<>').
           '" name="recent_'.$_.'" />');            '" name="recent_'.$item.'" />');
     }      }
   
     # ----- Start Parameter Selection      # ----- Start Parameter Selection
Line 2336  ENDPARMSELSCRIPT Line 2579  ENDPARMSELSCRIPT
   
         # Step 2          # Step 2
         $r->print(&Apache::lonhtmlcommon::topic_bar(2,&mt('Parameter Specification'),'parmstep2'));          $r->print(&Apache::lonhtmlcommon::topic_bar(2,&mt('Parameter Specification'),'parmstep2'));
         &displaymenu($r,\%allparms,\@pscat,\@psprt,\%keyorder,'parmmenuscroll');          &displaymenu($r,\%allparms,\@pscat,\%keyorder,'parmmenuscroll');
   
         # Step 3          # Step 3
         $r->print(&Apache::lonhtmlcommon::topic_bar(3,&mt('User Specification (optional)'),'parmstep3'));          $r->print(&Apache::lonhtmlcommon::topic_bar(3,&mt('User Specification (optional)'),'parmstep3'));
         $r->print(&Apache::lonhtmlcommon::start_pick_box());          $r->print(&Apache::lonhtmlcommon::start_pick_box());
         &usermenu($r,$uname,$id,$udom,$csec,$cgroup,$parmlev,\@usersgroups);          &usermenu($r,$uname,$id,$udom,$csec,$cgroup,$parmlev,\@usersgroups,$pssymb);
         $r->print(&Apache::lonhtmlcommon::row_closure(1));          $r->print(&Apache::lonhtmlcommon::row_closure(1));
         $r->print(&Apache::lonhtmlcommon::end_pick_box());          $r->print(&Apache::lonhtmlcommon::end_pick_box());
   
Line 2380  ENDPARMSELSCRIPT Line 2623  ENDPARMSELSCRIPT
                   ($env{'form.psprt'}?' checked="checked"':'').' />'.                    ($env{'form.psprt'}?' checked="checked"':'').' />'.
                   &mt('Show all parts').                    &mt('Show all parts').
                   '</label></td></tr>');                    '</label></td></tr>');
         &usermenu($r,$uname,$id,$udom,$csec,$cgroup,$parmlev,\@usersgroups);          &usermenu($r,$uname,$id,$udom,$csec,$cgroup,$parmlev,\@usersgroups,$pssymb);
         $r->print(&Apache::lonhtmlcommon::row_closure(1));          $r->print(&Apache::lonhtmlcommon::row_closure(1));
         $r->print(&Apache::lonhtmlcommon::end_pick_box());          $r->print(&Apache::lonhtmlcommon::end_pick_box());
         $r->print('<p>'          $r->print('<p>'
Line 2902  sub storedata { Line 3145  sub storedata {
     if ($key =~ /^form\.([a-z]+)\_(.+)$/) {      if ($key =~ /^form\.([a-z]+)\_(.+)$/) {
         my $cmd=$1;          my $cmd=$1;
         my $thiskey=$2;          my $thiskey=$2;
           next if ($cmd eq 'setipallow' || $cmd eq 'setipdeny');
         my ($tuname,$tudom)=&extractuser($thiskey);          my ($tuname,$tudom)=&extractuser($thiskey);
         my $tkey=$thiskey;          my $tkey=$thiskey;
             if ($tuname) {              if ($tuname) {
Line 3070  sub listdata { Line 3314  sub listdata {
     $tableopen=0;      $tableopen=0;
     my $foundkeys=0;      my $foundkeys=0;
     my %keyorder=&standardkeyorder();      my %keyorder=&standardkeyorder();
       my $readonlyall = $readonly;
   
       my ($secidx,%grouphash);
       if (($env{'request.course.sec'} ne '') && ($caller eq 'overview')) {
           $secidx = &Apache::loncoursedata::CL_SECTION();
           if (&Apache::lonnet::allowed('mdg',$env{'request.course.id'})) {
               %grouphash = &Apache::longroup::coursegroups();
           } elsif ($env{'request.course.groups'} ne '') {
               map { $grouphash{$_} = 1; } split(/:/,$env{'request.course.groups'});
           }
       }
   
     foreach my $thiskey (sort {      foreach my $thiskey (sort {
     my ($astudent,$ares,$apart,$aparm) = &parse_listdata_key($a,$listdata);      my ($astudent,$ares,$apart,$aparm) = &parse_listdata_key($a,$listdata);
Line 3113  sub listdata { Line 3368  sub listdata {
     } keys %{$listdata}) {      } keys %{$listdata}) {
   
     if ($$listdata{$thiskey.'.type'}) {      if ($$listdata{$thiskey.'.type'}) {
             my $thistype=$$listdata{$thiskey.'.type'};          my $thistype=$$listdata{$thiskey.'.type'};
             if ($$resourcedata{$thiskey.'.type'}) {          if ($$resourcedata{$thiskey.'.type'}) {
         $thistype=$$resourcedata{$thiskey.'.type'};              $thistype=$$resourcedata{$thiskey.'.type'};
         }          }
         my ($middle,$part,$name)=          my ($middle,$part,$name)=
         ($thiskey=~/^$env{'request.course.id'}\.(?:(.+)\.)*([\w\s]+)\.(\w+)$/);          ($thiskey=~/^$env{'request.course.id'}\.(?:(.+)\.)*([\w\s]+)\.(\w+)$/);
         my $section=&mt('All Students');          my $section=&mt('All Students');
           $readonly = $readonlyall;
           my $userscope;
           my $showval = $$resourcedata{$thiskey};
         if ($middle=~/^\[(.*)\]/) {          if ($middle=~/^\[(.*)\]/) {
         my $issection=$1;              my $issection=$1;
         if ($issection=~/^useropt\:($match_username)\:($match_domain)/) {              if ($issection=~/^useropt\:($match_username)\:($match_domain)/) {
             $section=&mt('User').": ".&Apache::loncommon::plainname($1,$2);                  my ($stuname,$studom) = ($1,$2);
         } else {                  if (($env{'request.course.sec'} ne '') && ($caller eq 'overview')) {
             $section=&mt('Group/Section').': '.$issection;                      if (ref($classlist) eq 'HASH') {
         }                          if (ref($classlist->{$stuname.':'.$studom}) eq 'ARRAY') {
         $middle=~s/^\[(.*)\]//;                              next unless ($classlist->{$stuname.':'.$studom}->[$secidx] eq $env{'request.course.sec'});
                           }
                       }
                   }
                   $section=&mt('User').": ".&Apache::loncommon::plainname($1,$2);
                   $userscope = 1;
               } else {
                   if (($env{'request.course.sec'} ne '') && ($caller eq 'overview')) {
                       if (exists($grouphash{$issection})) {
                           $section=&mt('Group').': '.$issection;
                       } elsif ($issection eq $env{'request.course.sec'}) {
                           $section = &mt('Section').': '.$issection;
                       } else {
                           next;
                       }
                   } else {
                       $section=&mt('Group/Section').': '.$issection;
                   }
               }
               $middle=~s/^\[(.*)\]//;
           } elsif (($env{'request.course.sec'} ne '') && ($caller eq 'overview')) {
               $readonly = 1;
         }          }
         $middle=~s/\.+$//;          $middle=~s/\.+$//;
         $middle=~s/^\.+//;          $middle=~s/^\.+//;
         my $realm='<span class="LC_parm_scope_all">'.&mt('All Resources').'</span>';          my $realm='<span class="LC_parm_scope_all">'.&mt('All Resources').'</span>';
   
         if ($middle=~/^(.+)\_\_\_\(all\)$/) {          if ($middle=~/^(.+)\_\_\_\(all\)$/) {
         $realm='<span class="LC_parm_scope_folder">'.&mt('Folder/Map').': '.&Apache::lonnet::gettitle($1).' <br /><span class="LC_parm_folder">('.$1.')</span></span>';          $realm='<span class="LC_parm_scope_folder">'.&mt('Folder/Map').': '.&Apache::lonnet::gettitle($1).' <br /><span class="LC_parm_folder">('.$1.')</span></span>';
         } elsif ($middle) {          } elsif ($middle) {
Line 3175  sub listdata { Line 3455  sub listdata {
               '<td><b>'.&mt($parmitem).                '<td><b>'.&mt($parmitem).
               '</b></td>');                '</b></td>');
         unless ($readonly) {          unless ($readonly) {
               my $disabled;
               if (($name eq 'availablestudent') &&
                   (($showval eq '') || ($userscope))) {
                   $disabled = ' disabled="disabled"';
               }
             $r->print('<td><input type="checkbox" name="del_'.              $r->print('<td><input type="checkbox" name="del_'.
                       $thiskey.'" /></td>');                        $thiskey.'"'.$disabled.' /></td>');
         }          }
         $r->print('<td>');          $r->print('<td>');
         $foundkeys++;          $foundkeys++;
Line 3204  sub listdata { Line 3489  sub listdata {
             $r->print(&date_interval_selector($thiskey,$name,              $r->print(&date_interval_selector($thiskey,$name,
                       $$resourcedata{$thiskey},$readonly));                        $$resourcedata{$thiskey},$readonly));
         } elsif ($thistype =~ m/^string/) {          } elsif ($thistype =~ m/^string/) {
               if ($name eq 'availablestudent') {
                   $readonly = 1;
               }
             $r->print(&string_selector($thistype,$thiskey,              $r->print(&string_selector($thistype,$thiskey,
                       $$resourcedata{$thiskey},$name,$readonly));                        $$resourcedata{$thiskey},$name,$readonly));
         } else {          } else {
Line 3314  sub default_selector { Line 3602  sub default_selector {
     return '<input type="text" name="set_'.$thiskey.'" value="'.$showval.'"'.$disabled.' />';      return '<input type="text" name="set_'.$thiskey.'" value="'.$showval.'"'.$disabled.' />';
 }  }
   
   sub string_ip_selector {
       my ($thiskey, $showval, $readonly) = @_;
       my %access = (
                      allow => [],
                      deny  => [],
                    );
       if ($showval ne '') {
           my @current;
           if ($showval =~ /,/) {
               @current = split(/,/,$showval);
           } else {
               @current = ($showval);
           }
           foreach my $item (@current) {
               if ($item =~ /^\!([\[\]a-zA-Z\.\d\*\-]+)$/) {
                   push(@{$access{'deny'}},$1);
               } elsif ($item =~ /^([\[\]a-zA-Z\.\d\*\-]+)$/) {
                   push(@{$access{'allow'}},$item);
               }
           }
       }
       if (!@{$access{'allow'}}) {
           @{$access{'allow'}} = ('');
       }
       if (!@{$access{'deny'}}) {
           @{$access{'deny'}} = ('');
       }
       my ($disabled,$addmore);
       if ($readonly) {
           $disabled=' disabled="disabled"';
       } else {
           $addmore = "\n".'<button class="LC_add_ipacc_button">'.&mt('Add more').'</button>';
       }
       my $output = '<input type="hidden" name="set_'.$thiskey.'" />
   <table><tr><th>'.&mt('Allow from').'</th><th>'.&mt('Deny from').'</th></tr><tr>';
       foreach my $acctype ('allow','deny') {
           $output .= '
   <td valign="top">
   <div class="LC_string_ipacc_wrap" id="LC_string_ipacc_'.$acctype.'_'.$thiskey.'">
     <div class="LC_string_ipacc_inner">'."\n";
           my $num = 0;
           foreach my $curr (@{$access{$acctype}}) {
               $output .= '<div><input type="text" name="setip'.$acctype.'_'.$thiskey.'" value="'.$curr.'"'.$disabled.' />';
               if ($num > 0) {
                   $output .= '<a href="#" class="LC_remove_ipacc">'.&mt('Remove').'</a>';
               }
               $output .= '</div>'."\n";
               $num ++;
           }
           $output .= '
     </div>'.$addmore.'
   </div>
   </td>';
      }
      $output .= '
   </tr>
   </table>'."\n";
       return $output;
   }
   
   {
   
 my %strings =  my %strings =
     (      (
      'string_yesno'       'string_yesno'
Line 3341  my %strings = Line 3691  my %strings =
              => [['yes','Yes'],               => [['yes','Yes'],
                  ['notended','Yes, unless discussion ended'],                   ['notended','Yes, unless discussion ended'],
                  ['no','No']],                   ['no','No']],
        'string_ip'
                => [['_allowfrom_','Hostname(s), or IP(s) from which access is allowed'],
                    ['_denyfrom_','Hostname(s) or IP(s) from which access is disallowed']],
      );       );
   
 sub standard_string_options {  sub standard_string_options {
Line 3381  sub string_selector { Line 3734  sub string_selector {
             }              }
         }          }
     }      }
   
       if ($thistype eq 'string_ip') {
           return &string_ip_selector($thiskey,$showval,$readonly);
       }
     
     my ($result,$disabled);      my ($result,$disabled);
   
Line 3435  sub string_selector { Line 3792  sub string_selector {
     return $result;      return $result;
 }  }
   
   sub oldversion_warning {
       my ($name,$value,$chostname,$cmajor,$cminor,$needsrelease) = @_;
       my $desc;
       my %stringtypes = (
                           type         => 'string_questiontype',
                           lenient      => 'string_lenient',
                           retrypartial => 'string_yesno',
                           discussvote  => 'string_discussvote',
                           examcode     => 'string_examcode',
                         );
       if (exists($stringtypes{$name})) {
           if ($name eq 'examcode') {
               $desc = $value;
           } elsif (ref($strings{$stringtypes{$name}}) eq 'ARRAY') {
               foreach my $possibilities (@{ $strings{$stringtypes{$name}} }) {
                   next unless (ref($possibilities) eq 'ARRAY');
                   my ($parmval, $description) = @{ $possibilities };
                   if ($parmval eq $value) {
                       $desc = $description;
                       last;
                   }
               }
           }
       } elsif (($name eq 'printstartdate') || ($name eq 'printenddate')) {
           my $now = time;
           if ($value =~ /^\d+$/) {
               if ($name eq 'printstartdate') {
                   if ($value > $now) {
                       $desc = &Apache::lonlocal::locallocaltime($value);
                   }
               } elsif ($name eq 'printenddate') {
                   if ($value < $now) {
                       $desc = &Apache::lonlocal::locallocaltime($value);
                   }
               }
           }
       }
       my $standard_name = &standard_parameter_names($name);
       return '<p class="LC_warning">'.
              &mt('[_1] was [_2]not[_3] set to [_4].',
                  $standard_name,'<b>','</b>','"'.$desc.'"').'<br />'.
              &mt('LON-CAPA version ([_1]) installed on home server ([_2]) does not meet version requirements ([_3] or newer).',
              $cmajor.'.'.$cminor,$chostname,
              $needsrelease).
              '</p>';
   }
   
   }
   
 #  #
 # Shift all start and end dates by $shift  # Shift all start and end dates by $shift
 #  #
   
 sub dateshift {  sub dateshift {
     my ($shift)=@_;      my ($shift,$numchanges)=@_;
     my $dom = $env{'course.'.$env{'request.course.id'}.'.domain'};      my $dom = $env{'course.'.$env{'request.course.id'}.'.domain'};
     my $crs = $env{'course.'.$env{'request.course.id'}.'.num'};      my $crs = $env{'course.'.$env{'request.course.id'}.'.num'};
       my $sec = $env{'request.course.sec'};
       my $secgrpregex;
       if ($sec ne '') {
           my @groups;
           if ($env{'request.course.groups'} ne '') {
               @groups = split(/:/,$env{'request.course.groups'});
           }
           if (@groups) {
               $secgrpregex = '(?:'.join('|',($sec,@groups)).')';
           } else {
               $secgrpregex = $sec;
           }
       }
     my %data=&Apache::lonnet::dump('resourcedata',$dom,$crs);      my %data=&Apache::lonnet::dump('resourcedata',$dom,$crs);
 # ugly retro fix for broken version of types  # ugly retro fix for broken version of types
     foreach my $key (keys %data) {      foreach my $key (keys %data) {
Line 3457  sub dateshift { Line 3876  sub dateshift {
 # go through all parameters and look for dates  # go through all parameters and look for dates
     foreach my $key (keys %data) {      foreach my $key (keys %data) {
        if ($data{$key.'.type'}=~/^date_(start|end)$/) {         if ($data{$key.'.type'}=~/^date_(start|end)$/) {
             if ($sec ne '') {
                 next unless ($key =~ /^$env{'request.course.id'}\.\[$secgrpregex\]\./);
             }
           my $newdate=$data{$key}+$shift;            my $newdate=$data{$key}+$shift;
             $$numchanges ++;
           $storecontent{$key}=$newdate;            $storecontent{$key}=$newdate;
        }         }
     }      }
Line 3537  ENDOVER Line 3960  ENDOVER
             @selected_sections = ('all');              @selected_sections = ('all');
         }          }
     }      }
       if ($env{'request.course.sec'} ne '') {
           @selected_sections = ($env{'request.course.sec'});
       }
     my @selected_groups =      my @selected_groups =
         &Apache::loncommon::get_env_multiple('form.Group');          &Apache::loncommon::get_env_multiple('form.Group');
   
Line 3576  ENDOVER Line 4002  ENDOVER
     &displaymenu($r,\%allparms,\@pscat,\%keyorder);      &displaymenu($r,\%allparms,\@pscat,\%keyorder);
     $r->print(&Apache::lonhtmlcommon::start_pick_box());      $r->print(&Apache::lonhtmlcommon::start_pick_box());
     $r->print(&Apache::lonhtmlcommon::row_title(&mt('Select Parts to View')));      $r->print(&Apache::lonhtmlcommon::row_title(&mt('Select Parts to View')));
       my $sectionselector = &sectionmenu(\@selected_sections);
       my $groupselector = &groupmenu(\@selected_groups);
     $r->print('<table>'.      $r->print('<table>'.
               '<tr><th>'.&mt('Parts').'</th><th>'.&mt('Section(s)').                '<tr><th>'.&mt('Parts').'</th>');
               '</th><th>'.&mt('Group(s)').'</th></tr><tr><td>');      if ($sectionselector) {
           $r->print('<th>'.&mt('Section(s)').'</th>');
       }
       if ($groupselector) {
           $r->print('<th>'.&mt('Group(s)').'</th>');
       }
       $r->print('</tr><tr><td>');
     &partmenu($r,\%allparts,\@psprt);      &partmenu($r,\%allparts,\@psprt);
     $r->print('</td><td>');      $r->print('</td>');
     &sectionmenu($r,\@selected_sections);      if ($sectionselector) {
     $r->print('</td><td>');          $r->print('<td>'.$sectionselector.'</td>');
     &groupmenu($r,\@selected_groups);      }
     $r->print('</td></tr></table>');      if ($groupselector) {
     #$r->print('</td></tr></table>');          $r->print('<td>'.$groupselector.'</td>');
       }
       $r->print('</tr></table>');
     $r->print(&Apache::lonhtmlcommon::row_closure(1));      $r->print(&Apache::lonhtmlcommon::row_closure(1));
     $r->print(&Apache::lonhtmlcommon::end_pick_box());      $r->print(&Apache::lonhtmlcommon::end_pick_box());
     $r->print('</div></div>');      $r->print('</div></div>');
Line 3780  ENDOVER Line 4216  ENDOVER
         $r->print(&mt('All users'));          $r->print(&mt('All users'));
         } elsif ($data{'scope_type'} eq 'user') {          } elsif ($data{'scope_type'} eq 'user') {
         $r->print(&mt('User: [_1]',join(':',@{$data{'scope'}})));          $r->print(&mt('User: [_1]',join(':',@{$data{'scope'}})));
         } elsif ($data{'scope_type'} eq 'section') {          } elsif ($data{'scope_type'} eq 'secgroup') {
         $r->print(&mt('Section: [_1]',$data{'scope'}));          $r->print(&mt('Group/Section: [_1]',$data{'scope'}));
         } elsif ($data{'scope_type'} eq 'group') {  
         $r->print(&mt('Group: [_1]',$data{'scope'}));  
         }          }
         $r->print('<br />');          $r->print('<br />');
         if ($data{'realm_type'} eq 'all') {          if ($data{'realm_type'} eq 'all') {
Line 3812  sub date_shift_one { Line 4246  sub date_shift_one {
     my ($r) = @_;      my ($r) = @_;
     my $dom = $env{'course.'.$env{'request.course.id'}.'.domain'};      my $dom = $env{'course.'.$env{'request.course.id'}.'.domain'};
     my $crs = $env{'course.'.$env{'request.course.id'}.'.num'};      my $crs = $env{'course.'.$env{'request.course.id'}.'.num'};
       my $sec = $env{'request.course.sec'};
     &Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=dateshift1&timebase='.$env{'form.timebase'},      &Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=dateshift1&timebase='.$env{'form.timebase'},
         text=>"Shifting Dates"});          text=>"Shifting Dates"});
       my $submit_text = &mt('Shift all dates accordingly');
       if ($sec ne '') {
           my @groups;
           if ($env{'request.course.groups'} ne '') {
               @groups = split(/:/,$env{'request.course.groups'});
           }
           if (@groups) {
               $submit_text = &mt("Shift dates set just for your section/group(s), accordingly");
           } else {
               $submit_text = &mt("Shift dates set just for your section, accordingly");
           }
       }
     my $start_page=&Apache::loncommon::start_page('Shift Dates');      my $start_page=&Apache::loncommon::start_page('Shift Dates');
     my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs('Shift');      my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs('Shift');
     $r->print($start_page.$breadcrumbs);      $r->print($start_page.$breadcrumbs);
Line 3829  sub date_shift_one { Line 4275  sub date_shift_one {
               '</td></tr></table>'.                '</td></tr></table>'.
               '<input type="hidden" name="action" value="dateshift2" />'.                '<input type="hidden" name="action" value="dateshift2" />'.
               '<input type="hidden" name="timebase" value="'.$env{'form.timebase'}.'" />'.                '<input type="hidden" name="timebase" value="'.$env{'form.timebase'}.'" />'.
               '<input type="submit" value="'.&mt('Shift all dates accordingly').'" /></form>');                '<input type="submit" value="'.$submit_text.'" /></form>');
     $r->print(&Apache::loncommon::end_page());      $r->print(&Apache::loncommon::end_page());
 }  }
   
Line 3837  sub date_shift_two { Line 4283  sub date_shift_two {
     my ($r) = @_;      my ($r) = @_;
     my $dom = $env{'course.'.$env{'request.course.id'}.'.domain'};      my $dom = $env{'course.'.$env{'request.course.id'}.'.domain'};
     my $crs = $env{'course.'.$env{'request.course.id'}.'.num'};      my $crs = $env{'course.'.$env{'request.course.id'}.'.num'};
       my $sec = $env{'request.course.sec'};
     &Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=dateshift1&timebase='.$env{'form.timebase'},      &Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=dateshift1&timebase='.$env{'form.timebase'},
         text=>"Shifting Dates"});          text=>"Shifting Dates"});
     my $start_page=&Apache::loncommon::start_page('Shift Dates');      my $start_page=&Apache::loncommon::start_page('Shift Dates');
     my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs('Shift');      my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs('Shift');
     $r->print($start_page.$breadcrumbs);      $r->print($start_page.$breadcrumbs);
     my $timeshifted=&Apache::lonhtmlcommon::get_date_from_form('timeshifted');      my $timeshifted=&Apache::lonhtmlcommon::get_date_from_form('timeshifted');
     $r->print('<h2>'.&mt('Shift Dates').'</h2>'.      $r->print('<h2>'.&mt('Shift Dates').'</h2>');
               '<p>'.&mt('Shifting all dates such that [_1] becomes [_2]',      if ($sec ne '') {
               &Apache::lonlocal::locallocaltime($env{'form.timebase'}),          my @groups;
               &Apache::lonlocal::locallocaltime($timeshifted)).'</p>');          if ($env{'request.course.groups'} ne '') {
               @groups = split(/:/,$env{'request.course.groups'});
           }
           if (@groups) {
               $r->print('<p>'.
                         &mt("Shift dates set just for your section/group(s), such that [_1] becomes [_2]",
                             &Apache::lonlocal::locallocaltime($env{'form.timebase'}),
                             &Apache::lonlocal::locallocaltime($timeshifted)).
                         '</p>');
           } else {
               $r->print('<p>'.
                         &mt("Shift dates set just for your section, such that [_1] becomes [_2]",
                             &Apache::lonlocal::locallocaltime($env{'form.timebase'}),
                             &Apache::lonlocal::locallocaltime($timeshifted)).
                         '</p>');
           }
       } else {
           $r->print('<p>'.&mt('Shifting all dates such that [_1] becomes [_2]',
                               &Apache::lonlocal::locallocaltime($env{'form.timebase'}),
                               &Apache::lonlocal::locallocaltime($timeshifted)).
                     '</p>');
       }
     my $delta=$timeshifted-$env{'form.timebase'};      my $delta=$timeshifted-$env{'form.timebase'};
     &dateshift($delta);      my $numchanges = 0;
       my $result = &dateshift($delta,\$numchanges);
       if ($result eq 'ok') {
           $r->print(
               &Apache::lonhtmlcommon::confirm_success(&mt('Completed shifting of [quant,_1,date setting]',
                                                       $numchanges)));
       } elsif ($result eq 'con_delayed') {
           $r->print(
               &Apache::lonhtmlcommon::confirm_success(&mt('Queued shifting of [quant,_1,date setting]',
                                                           $numchanges)));
       } else {
           $r->print(
               &Apache::lonhtmlcommon::confirm_success(&mt('An error occurred attempting to shift dates'),1));
       }
     $r->print(      $r->print(
         &Apache::lonhtmlcommon::confirm_success(&mt('Done')).  
         '<br /><br />'.          '<br /><br />'.
         &Apache::lonhtmlcommon::actionbox(          &Apache::lonhtmlcommon::actionbox(
             ['<a href="/adm/parmset">'.&mt('Content and Problem Settings').'</a>']));              ['<a href="/adm/parmset">'.&mt('Content and Problem Settings').'</a>']));
Line 3869  sub parse_key { Line 4349  sub parse_key {
         $data{'scope_type'} = 'user';          $data{'scope_type'} = 'user';
         $data{'scope'} = [$1,$2];          $data{'scope'} = [$1,$2];
     } else {      } else {
         #FIXME check for group scope          $data{'scope_type'} = 'secgroup';
         $data{'scope_type'} = 'section';  
     }      }
     $middle=~s/^\[(.*)\]//;      $middle=~s/^\[(.*)\]//;
     }      }
Line 4184  sub continue { Line 4663  sub continue {
     my $output;      my $output;
     $output .= '<form action="" method="post">';      $output .= '<form action="" method="post">';
     $output .= '<input type="hidden" name="action" value="setrestrictmeta" />';      $output .= '<input type="hidden" name="action" value="setrestrictmeta" />';
     $output .= '<input type="submit" value="Continue" />';      $output .= '<input type="submit" value="'.&mt('Continue').'" />';
     return ($output);      return ($output);
 }  }
   
Line 4206  sub addmetafield { Line 4685  sub addmetafield {
             my $put_result = &Apache::lonnet::put('environment',              my $put_result = &Apache::lonnet::put('environment',
                                         {'metadata.'.$meta_field.'.options'=>$options},$dom,$crs);                                          {'metadata.'.$meta_field.'.options'=>$options},$dom,$crs);
   
             $r->print('Undeleted Metadata Field <strong>'.$env{'course.'.$env{'request.course.id'}.'.metadata.'.$meta_field.'.added'}."</strong> with result ".$put_result.'<br />');              $r->print(&mt('Undeleted Metadata Field [_1] with result [_2]',
                             '<strong>'.$env{'course.'.$env{'request.course.id'}.'.metadata.'.$meta_field.'.added'}.
                             '</strong>',$put_result).
                         '<br />');
         }          }
         $r->print(&continue());          $r->print(&continue());
     } elsif (exists($env{'form.fieldname'})) {      } elsif (exists($env{'form.fieldname'})) {
Line 4218  sub addmetafield { Line 4700  sub addmetafield {
                             {'metadata.'.$meta_field.'.values'=>"",                              {'metadata.'.$meta_field.'.values'=>"",
                              'metadata.'.$meta_field.'.added'=>"$display_field",                               'metadata.'.$meta_field.'.added'=>"$display_field",
                              'metadata.'.$meta_field.'.options'=>""},$dom,$crs);                               'metadata.'.$meta_field.'.options'=>""},$dom,$crs);
         $r->print('Added new Metadata Field <strong>'.$env{'form.fieldname'}."</strong> with result ".$put_result.'<br />');          $r->print(&mt('Added new Metadata Field [_1] with result [_2]',
                         '<strong>'.$env{'form.fieldname'}.'</strong>',$put_result).
                     '<br />');
         $r->print(&continue());          $r->print(&continue());
     } else {      } else {
         my $fields = &get_deleted_meta_fieldnames($env{'request.course.id'});          my $fields = &get_deleted_meta_fieldnames($env{'request.course.id'});
         if ($fields) {          if ($fields) {
             $r->print('You may undelete previously deleted fields.<br />Check those you wish to undelete and click Undelete.<br />');              $r->print(&mt('You may undelete previously deleted fields.').
                         '<br />'.
                         &mt('Check those you wish to undelete and click Undelete.').
                         '<br />');
             $r->print('<form method="post" action="">');              $r->print('<form method="post" action="">');
             foreach my $key(keys(%$fields)) {              foreach my $key(keys(%$fields)) {
                 $r->print('<input type="checkbox" name="undeletefield" value="'.$key.'" />'.$$fields{$key}.'<br /');                  $r->print('<input type="checkbox" name="undeletefield" value="'.$key.'" />'.$$fields{$key}.'<br /');
Line 4231  sub addmetafield { Line 4718  sub addmetafield {
             $r->print('<input type="submit" name="undelete" value="Undelete" />');              $r->print('<input type="submit" name="undelete" value="Undelete" />');
             $r->print('</form>');              $r->print('</form>');
         }          }
         $r->print('<hr /><strong>Or</strong> you may enter a new metadata field name.<form method="post" action="/adm/parmset?action=addmetadata">');          $r->print('<hr />'.
                     &mt('[_1]Or[_2] you may enter a new metadata field name.',
                         '<strong>','</strong>').
                    '<form method="post" action="/adm/parmset?action=addmetadata">');
         $r->print('<input type="text" name="fieldname" /><br />');          $r->print('<input type="text" name="fieldname" /><br />');
         $r->print('<input type="submit" value="Add Metadata Field" />');          $r->print('<input type="submit" value="'.&mt('Add Metadata Field').'" />');
     }      }
     $r->print('</form>');      $r->print('</form>');
 }  }
Line 4254  sub setrestrictmeta { Line 4744  sub setrestrictmeta {
     my $crs = $env{'course.'.$env{'request.course.id'}.'.num'};      my $crs = $env{'course.'.$env{'request.course.id'}.'.num'};
     my $key_base = $env{'course.'.$env{'request.course.id'}.'.'};      my $key_base = $env{'course.'.$env{'request.course.id'}.'.'};
     my $save_field = '';      my $save_field = '';
       my %lt = &Apache::lonlocal::texthash(
                                              addm => 'Add Metadata Field',
                                              ordm => 'Order Metadata Fields',
                                              save => 'Save',
                                           );
     if ($env{'form.restrictmeta'}) {      if ($env{'form.restrictmeta'}) {
         foreach my $field (sort(keys(%env))) {          foreach my $field (sort(keys(%env))) {
             if ($field=~m/^form.(.+)_(.+)$/) {              if ($field=~m/^form.(.+)_(.+)$/) {
Line 4292  sub setrestrictmeta { Line 4787  sub setrestrictmeta {
     my %metadata_fields = &Apache::lonmeta::fieldnames('portfolio');      my %metadata_fields = &Apache::lonmeta::fieldnames('portfolio');
     # Now get possible added metadata fields      # Now get possible added metadata fields
     my $added_metadata_fields = &get_added_meta_fieldnames($env{'request.course.id'});      my $added_metadata_fields = &get_added_meta_fieldnames($env{'request.course.id'});
     my $row_alt = 1;  
     $output .= &Apache::loncommon::start_data_table();      $output .= &Apache::loncommon::start_data_table();
     foreach my $field (sort(keys(%metadata_fields))) {      foreach my $field (sort(keys(%metadata_fields))) {
         if ($field ne 'courserestricted') {          if ($field ne 'courserestricted') {
             $row_alt = $row_alt ? 0 : 1;  
         $output.= &output_row($r, $field, $metadata_fields{$field});          $output.= &output_row($r, $field, $metadata_fields{$field});
     }      }
     }      }
     my $buttons = (<<ENDButtons);      my $buttons = (<<ENDButtons);
         <input type="submit" name="restrictmeta" value="Save" />          <input type="submit" name="restrictmeta" value="$lt{'save'}" />
         </form><br />          </form><br />
         <form method="post" action="/adm/parmset?action=addmetadata" name="form1">          <form method="post" action="/adm/parmset?action=addmetadata" name="form1">
         <input type="submit" name="restrictmeta" value="Add a Metadata Field" />          <input type="submit" name="restrictmeta" value="$lt{'addm'}" />
         </form>          </form>
         <br />          <br />
         <form method="post" action="/adm/parmset?action=ordermetadata" name="form2">          <form method="post" action="/adm/parmset?action=ordermetadata" name="form2">
         <input type="submit" name="restrictmeta" value="Order Metadata Fields" />          <input type="submit" name="restrictmeta" value="$lt{'ordm'}" />
 ENDButtons  ENDButtons
     my $added_flag = 1;      my $added_flag = 1;
     foreach my $field (sort(keys(%$added_metadata_fields))) {      foreach my $field (sort(keys(%$added_metadata_fields))) {
         $row_alt = $row_alt ? 0 : 1;          $output.= &output_row($r,$field,$$added_metadata_fields{$field},$added_flag);
         $output.= &output_row($r, $field, $$added_metadata_fields{$field},$added_flag, $row_alt);  
     }      }
     $output .= &Apache::loncommon::end_data_table();      $output .= &Apache::loncommon::end_data_table();
     $r->print(<<ENDenv);      $r->print(<<ENDenv);
Line 4558  my %standard_parms; Line 5050  my %standard_parms;
 my %standard_parms_types;  my %standard_parms_types;
   
 sub load_parameter_names {  sub load_parameter_names {
     open(my $config,"<$Apache::lonnet::perlvar{'lonTabDir'}/packages.tab");      open(my $config,"<","$Apache::lonnet::perlvar{'lonTabDir'}/packages.tab");
     while (my $configline=<$config>) {      while (my $configline=<$config>) {
     if ($configline !~ /\S/ || $configline=~/^\#/) { next; }      if ($configline !~ /\S/ || $configline=~/^\#/) { next; }
     chomp($configline);      chomp($configline);
Line 4573  sub load_parameter_names { Line 5065  sub load_parameter_names {
     close($config);      close($config);
     $standard_parms{'int_pos'}      = 'Positive Integer';      $standard_parms{'int_pos'}      = 'Positive Integer';
     $standard_parms{'int_zero_pos'} = 'Positive Integer or Zero';      $standard_parms{'int_zero_pos'} = 'Positive Integer or Zero';
       $standard_parms{'scoreformat'}  = 'Format for display of score';
 }  }
   
 sub standard_parameter_names {  sub standard_parameter_names {
Line 4652  sub parm_change_log { Line 5145  sub parm_change_log {
     }      }
     if ($last) { ($folder) = &Apache::lonnet::decode_symb($last); }      if ($last) { ($folder) = &Apache::lonnet::decode_symb($last); }
     }      }
       my $numgroups = 0;
       my @groups;
       if ($env{'request.course.groups'} ne '') {
           @groups = split(/:/,$env{'request.course.groups'});
           $numgroups = scalar(@groups);
       }
     foreach my $id (sort      foreach my $id (sort
             {              {
             if ($parmlog{$b}{'exe_time'} ne $parmlog{$a}{'exe_time'}) {              if ($parmlog{$b}{'exe_time'} ne $parmlog{$a}{'exe_time'}) {
Line 4691  sub parm_change_log { Line 5190  sub parm_change_log {
                 !exists($parmlog{$id}{'logentry'}{$changed.'.type'}));                  !exists($parmlog{$id}{'logentry'}{$changed.'.type'}));
             my ($realm,$section,$parmname,$part,$what,$middle,$uname,$udom,$issection,$realmdescription)=              my ($realm,$section,$parmname,$part,$what,$middle,$uname,$udom,$issection,$realmdescription)=
         &components($changed,$parmlog{$id}{'uname'},$parmlog{$id}{'udom'},undef,undef,$typeflag);          &components($changed,$parmlog{$id}{'uname'},$parmlog{$id}{'udom'},undef,undef,$typeflag);
           if ($env{'request.course.sec'} ne '') {
               next if (($issection ne '') && (!(($issection eq $env{'request.course.sec'}) ||
                                                 ($numgroups && (grep(/^\Q$issection\E$/,@groups))))));
               if ($uname ne '') {
                   my $stusection = &Apache::lonnet::getsection($uname,$udom,$env{'request.course.id'});
                   next if (($stusection ne '-1') && ($stusection ne $env{'request.course.sec'}));
               }
           }
         if ($env{'form.displayfilter'} eq 'currentfolder') {          if ($env{'form.displayfilter'} eq 'currentfolder') {
         if ($folder) {          if ($folder) {
             if ($middle!~/^\Q$folder\E/) { next; }              if ($middle!~/^\Q$folder\E/) { next; }
Line 4907  sub parameter_releasecheck { Line 5414  sub parameter_releasecheck {
     return $needsnewer;      return $needsnewer;
 }  }
   
 sub oldversion_warning {  
     my ($name,$value,$chostname,$cmajor,$cminor,$needsrelease) = @_;  
     my $desc;  
     my %stringtypes = (  
                         type         => 'string_questiontype',  
                         lenient      => 'string_lenient',  
                         retrypartial => 'string_yesno',  
                         discussvote  => 'string_discussvote',  
                         examcode     => 'string_examcode',  
                       );  
     if (exists($stringtypes{$name})) {  
         if ($name eq 'examcode') {  
             $desc = $value;  
         } elsif (ref($strings{$stringtypes{$name}}) eq 'ARRAY') {  
             foreach my $possibilities (@{ $strings{$stringtypes{$name}} }) {  
                 next unless (ref($possibilities) eq 'ARRAY');  
                 my ($parmval, $description) = @{ $possibilities };  
                 if ($parmval eq $value) {  
                     $desc = $description;  
                     last;  
                 }  
             }  
         }  
     } elsif (($name eq 'printstartdate') || ($name eq 'printenddate')) {  
         my $now = time;  
         if ($value =~ /^\d+$/) {  
             if ($name eq 'printstartdate') {  
                 if ($value > $now) {  
                     $desc = &Apache::lonlocal::locallocaltime($value);  
                 }  
             } elsif ($name eq 'printenddate') {  
                 if ($value < $now) {  
                     $desc = &Apache::lonlocal::locallocaltime($value);  
                 }  
             }  
         }  
     }  
     my $standard_name = &standard_parameter_names($name);  
     return '<p class="LC_warning">'.  
            &mt('[_1] was [_2]not[_3] set to [_4].',  
                $standard_name,'<b>','</b>','"'.$desc.'"').'<br />'.  
            &mt('LON-CAPA version ([_1]) installed on home server ([_2]) does not meet version requirements ([_3] or newer).',  
            $cmajor.'.'.$cminor,$chostname,  
            $needsrelease).  
            '</p>';  
 }  
   
 sub get_permission {  sub get_permission {
     my %permission;      my %permission;
     my $allowed = 0;      my $allowed = 0;

Removed from v.1.522.2.23.2.2  
changed lines
  Added in v.1.522.2.26.2.3


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