Diff for /loncom/interface/lonparmset.pm between versions 1.522.2.27 and 1.522.2.29

version 1.522.2.27, 2020/02/12 19:54:47 version 1.522.2.29, 2024/07/01 15:45:44
Line 1099  sub print_td { Line 1099  sub print_td {
                 $nolink = 1;                  $nolink = 1;
             }              }
         } elsif ($mprefix =~ /availablestudent\&$/) {          } elsif ($mprefix =~ /availablestudent\&$/) {
             if ($which > 3) {              $nolink = 1;
                 $nolink = 1;  
             }  
         } elsif ($mprefix =~ /examcode\&$/) {          } elsif ($mprefix =~ /examcode\&$/) {
             unless ($which == 2) {              unless ($which == 2) {
                 $nolink = 1;                  $nolink = 1;
Line 2308  sub assessparms { Line 2306  sub assessparms {
         my $chome = $env{'course.'.$env{'request.course.id'}.'.home'};          my $chome = $env{'course.'.$env{'request.course.id'}.'.home'};
         my ($got_chostname,$chostname,$cmajor,$cminor);          my ($got_chostname,$chostname,$cmajor,$cminor);
         my $totalstored = 0;          my $totalstored = 0;
           my $totalskippeduser = 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);
Line 2316  sub assessparms { Line 2315  sub assessparms {
             }              }
             if ($markers[$i] =~ /\&(6|5|4)$/) {              if ($markers[$i] =~ /\&(6|5|4)$/) {
                 next if ($noeditgrp);                  next if ($noeditgrp);
               } elsif ($markers[$i] =~ /\&(3|2|1)$/) {
                   if ($uname eq '') {
                       $totalskippeduser ++;
                       next;
                   }
             }              }
             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);
Line 2393  sub assessparms { Line 2397  sub assessparms {
 # ---------------------------------------------------------------- Done storing  # ---------------------------------------------------------------- Done storing
         if ($totalstored) {          if ($totalstored) {
             $message.='<p class="LC_warning">'              $message.='<p class="LC_warning">'
                        .&mt('Changes for [quant,_1,parameter] saved.',$totalstored)
                        .'<br />'
                      .&mt('Changes can take up to 10 minutes before being active for all students.')                       .&mt('Changes can take up to 10 minutes before being active for all students.')
                      .&Apache::loncommon::help_open_topic('Caching')                       .&Apache::loncommon::help_open_topic('Caching')
                      .'</p>';                       .'</p>';
           } else {
               $message.='<p class="LC_info">'.&mt('No parameter changes saved.').'</p>';
           }
           if ($totalskippeduser) {
               $message .= '<p class="LC_warning">';
               if ($uhome eq 'no_host') {
                   $message .= &mt('Changes for [quant,_1,user-specific parameter] not saved because the username or ID was invalid.',
                                   $totalskippeduser);
               } elsif ($env{'form.userroles'} eq 'any') {
                   $message .= &mt('Changes for [quant,_1,user-specific parameter] not saved because the user does not have a course role.',
                                   $totalskippeduser);
               } else {
                   $message .= &mt('Changes for [quant,_1,user-specific parameter] not saved because the user is not a student.',
                                   $totalskippeduser);
               }
               $message .= '</p>';
         }          }
     }      }
 #----------------------------------------------- if all selected, fill in array  #----------------------------------------------- if all selected, fill in array
Line 3252  sub listdata { Line 3274  sub listdata {
         ($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;          $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)/) {
Line 3264  sub listdata { Line 3288  sub listdata {
                     }                      }
                 }                  }
                 $section=&mt('User').": ".&Apache::loncommon::plainname($1,$2);                  $section=&mt('User').": ".&Apache::loncommon::plainname($1,$2);
                   $userscope = 1;
             } else {              } else {
                 if (($env{'request.course.sec'} ne '') && ($caller eq 'overview')) {                  if (($env{'request.course.sec'} ne '') && ($caller eq 'overview')) {
                     if (exists($grouphash{$issection})) {                      if (exists($grouphash{$issection})) {
Line 3328  sub listdata { Line 3353  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 3357  sub listdata { Line 3387  sub listdata {
             $r->print(&date_interval_selector($thiskey,              $r->print(&date_interval_selector($thiskey,
                       $$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 {

Removed from v.1.522.2.27  
changed lines
  Added in v.1.522.2.29


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