Diff for /loncom/interface/lonparmset.pm between versions 1.588 and 1.596

version 1.588, 2019/01/06 15:27:48 version 1.596, 2020/02/12 16:25:47
Line 976  sub storeparm_by_symb_inner { Line 976  sub storeparm_by_symb_inner {
 #  #
 # @param {string} $value - the parameter value  # @param {string} $value - the parameter value
 # @param {string} $type - the parameter type  # @param {string} $type - the parameter type
 # @param {string} $name - the parameter name (unused)  
 # @param {boolean} $editable - Set to true to get an icon when no value is defined.  # @param {boolean} $editable - Set to true to get an icon when no value is defined.
 sub valout {  sub valout {
     my ($value,$type,$name,$editable)=@_;      my ($value,$type,$name,$editable)=@_;
Line 1071  sub plink { Line 1070  sub plink {
     my ($type,$dis,$value,$marker,$return,$call,$recursive,$extra)=@_;      my ($type,$dis,$value,$marker,$return,$call,$recursive,$extra)=@_;
     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 1080  sub plink { Line 1083  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, \$extra) {                \$hour, \$min, \$sec, \$extra) {
Line 1108  sub page_js { Line 1111  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') || 
                       (specstring.test(document.parmform.pres_type.value)))  {
                     eval('document.parmform.recent_'+                      eval('document.parmform.recent_'+
                         document.parmform.pres_type.value+                          document.parmform.pres_type.value+
                         '.value=document.parmform.pres_value.value;');                          '.value=document.parmform.pres_value.value;');
Line 1710  sub print_row { Line 1715  sub print_row {
             }              }
         }          }
         my ($parmname)=($thismarker=~/\_([^\_]+)$/);          my ($parmname)=($thismarker=~/\_([^\_]+)$/);
         $effective_parm = &valout($recursinfo->[0],$recursinfo->[1],$parmname);          $effective_parm = &valout($recursinfo->[0],$recursinfo->[1]);
         $r->print('<td style="background-color:#CCCCFF;" align="center">'.$effective_parm.          $r->print('<td style="background-color:#CCCCFF;" align="center">'.$effective_parm.
                   '<br /><span class="LC_parm_recursive">'.$rectitle.'&nbsp;'.                    '<br /><span class="LC_parm_recursive">'.$rectitle.'&nbsp;'.
                   $effparm_level.'</span></td>');                    $effparm_level.'</span></td>');
     } else {      } else {
         if ($result) {          if ($result) {
             $effective_parm = &valout($outpar[$result],$typeoutpar[$result],$parmname);              $effective_parm = &valout($outpar[$result],$typeoutpar[$result]);
         }          }
         if ($eff_groupparm) {          if ($eff_groupparm) {
             $effective_parm = $eff_groupparm;              $effective_parm = $eff_groupparm;
Line 1733  sub print_row { Line 1738  sub print_row {
             $sessionvaltype=$$defaulttype{$which};              $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 1814  sub print_td { Line 1819  sub print_td {
     }      }
     if ($nolink) {      if ($nolink) {
         my ($parmname)=((split(/\&/,$mprefix))[1]=~/\_([^\_]+)$/);          my ($parmname)=((split(/\&/,$mprefix))[1]=~/\_([^\_]+)$/);
         $r->print(&valout($currval,$currtype,$parmname));          $r->print(&valout($currval,$currtype));
     } else {      } else {
         $r->print(&plink($currtype,          $r->print(&plink($currtype,
                          $$display{$value},$currval,                           $$display{$value},$currval,
Line 1854  sub check_other_groups { Line 1859  sub check_other_groups {
         if ($result > 3) {          if ($result > 3) {
             $bgcolor = '#AAFFAA';              $bgcolor = '#AAFFAA';
         }          }
         $grp_parm = &valout($coursereply,$resulttype,$parmname);          $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) {
             if ($resultlevel eq 'recursive') {              if ($resultlevel eq 'recursive') {
Line 2062  sub isdateparm { Line 2067  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')));
   }
   
 # Prints the HTML and Javascript to select parameters, with various shortcuts.  # Prints the HTML and Javascript to select parameters, with various shortcuts.
 #  #
 # @param {Apache2::RequestRec} $r - the Apache request  # @param {Apache2::RequestRec} $r - the Apache request
Line 2407  sub partmenu { Line 2420  sub partmenu {
 sub usermenu {  sub usermenu {
     my ($r,$uname,$id,$udom,$csec,$cgroup,$parmlev,$usersgroups,$pssymb)=@_;      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();
   
Line 3051  sub assessparms { Line 3092  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=                  my $crstype = $env{'course.'.$env{'request.course.id'}.'.type'};
                     '<p class="LC_warning">'.                  if ($env{'form.userroles'} eq 'any') {
                     &mt('User [_1] at domain [_2] not in this course',                      if (($env{'user.name'} eq $uname) && ($env{'user.domain'} eq $udom)) {
                         "'".$uname."'","'".$udom."'").                          $csec = $env{'request.course.sec'};
                     '</p>';                          $message = '<span class="LC_info">';
                 $uname='';                          if ($crstype eq 'Community') {
                 $csec=$env{'form.csec'};                              $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 3268  sub assessparms { Line 3406  sub assessparms {
     &startpage($r,$pssymb,$crstype);      &startpage($r,$pssymb,$crstype);
   
     foreach my $item ('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_'.$item},'"&<>').              &HTML::Entities::encode($env{'form.recent_'.$item},'"&<>').
             '" name="recent_'.$item.'" />');              '" name="recent_'.$item.'" />');
Line 4372  sub listdata { Line 4513  sub listdata {
     $tableopen=0;      $tableopen=0;
     my $foundkeys=0;      my $foundkeys=0;
     my %keyorder=&standardkeyorder();      my %keyorder=&standardkeyorder();
       my $readonlyall = $readonly;
   
     my ($secidx,%grouphash);      my ($secidx,%grouphash);
     if (($env{'request.course.sec'} ne '') && ($caller eq 'overview')) {      if (($env{'request.course.sec'} ne '') && ($caller eq 'overview')) {
Line 4433  sub listdata { Line 4575  sub listdata {
             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 $showval = $$resourcedata{$thiskey};               my $showval = $$resourcedata{$thiskey}; 
             if ($middle=~/^\[(.*)\]/) {              if ($middle=~/^\[(.*)\]/) {
                 my $issection=$1;                  my $issection=$1;
Line 5369  sub oldversion_warning { Line 5512  sub oldversion_warning {
 # @param {integer} $shift - time to shift, in seconds  # @param {integer} $shift - time to shift, in seconds
 # @returns {string} - error name or 'ok'  # @returns {string} - error name or 'ok'
 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 5386  sub dateshift { Line 5542  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 5798  sub date_shift_one { Line 5958  sub date_shift_one {
     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 $crstype = $env{'course.'.$env{'request.course.id'}.'.type'};      my $crstype = $env{'course.'.$env{'request.course.id'}.'.type'};
       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 5816  sub date_shift_one { Line 5988  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>');
     &endSettingsScreen($r);      &endSettingsScreen($r);
     $r->print(&Apache::loncommon::end_page());      $r->print(&Apache::loncommon::end_page());
 }  }
Line 5828  sub date_shift_two { Line 6000  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'};
     my $crstype = $env{'course.'.$env{'request.course.id'}.'.type'};      my $crstype = $env{'course.'.$env{'request.course.id'}.'.type'};
     &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"});
Line 5836  sub date_shift_two { Line 6009  sub date_shift_two {
     $r->print($start_page.$breadcrumbs);      $r->print($start_page.$breadcrumbs);
     &startSettingsScreen($r,'parmset',$crstype);      &startSettingsScreen($r,'parmset',$crstype);
     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 6793  sub parm_change_log { Line 6999  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'}) {
                     return $parmlog{$b}{'exe_time'} <=>$parmlog{$a}{'exe_time'}                      return $parmlog{$b}{'exe_time'} <=>$parmlog{$a}{'exe_time'}
Line 6832  sub parm_change_log { Line 7044  sub parm_change_log {
             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'},$typeflag);                  &components($changed,$parmlog{$id}{'uname'},$parmlog{$id}{'udom'},$typeflag);
             if ($env{'request.course.sec'} ne '') {              if ($env{'request.course.sec'} ne '') {
                 next if (($issection ne '') && ($issection ne $env{'request.course.sec'}));                  next if (($issection ne '') && (!(($issection eq $env{'request.course.sec'}) ||
                                                     ($numgroups && (grep(/^\Q$issection\E$/,@groups))))));
                 if ($uname ne '') {                  if ($uname ne '') {
                     my $stusection = &Apache::lonnet::getsection($uname,$udom,$env{'request.course.id'});                      my $stusection = &Apache::lonnet::getsection($uname,$udom,$env{'request.course.id'});
                     next if (($stusection ne '-1') && ($stusection ne $env{'request.course.sec'}));                       next if (($stusection ne '-1') && ($stusection ne $env{'request.course.sec'})); 

Removed from v.1.588  
changed lines
  Added in v.1.596


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