Diff for /loncom/interface/lonparmset.pm between versions 1.229 and 1.235

version 1.229, 2005/06/18 17:23:25 version 1.235, 2005/06/28 15:28:08
Line 525  sub plink { Line 525  sub plink {
         }          }
     }      }
     my ($parmname)=((split(/\&/,$marker))[1]=~/\_([^\_]+)$/);      my ($parmname)=((split(/\&/,$marker))[1]=~/\_([^\_]+)$/);
     &Apache::lonnet::logthis($marker.'-'.$parmname);  
     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; }
     return       return 
Line 630  sub print_row { Line 629  sub print_row {
     } else {          } else {    
         $parm=~s|\[.*\]\s||g;          $parm=~s|\[.*\]\s||g;
     }      }
       my $automatic=&rulescache(($which=~/\_([^\_]+)$/)[0].'_triggers');
       if ($automatic) {
    $parm.='<font color="red"><br />'.&mt('Automatically sets').' '.join(', ',split(/\:/,$automatic)).'</font>';
       }
     $r->print('<td bgcolor='.$defbgone.'>'.$parm.'</td>');      $r->print('<td bgcolor='.$defbgone.'>'.$parm.'</td>');
         
     my $thismarker=$which;      my $thismarker=$which;
Line 902  ENDSCRIPT Line 904  ENDSCRIPT
     $r->print("\n<table><tr>");      $r->print("\n<table><tr>");
     my $cnt=0;      my $cnt=0;
     foreach $tempkey (&keysindisplayorder($allparms,$keyorder)) {      foreach $tempkey (&keysindisplayorder($allparms,$keyorder)) {
  $r->print("\n<td><font size='-1'><input type='checkbox' name='pscat' ");   $r->print("\n<td><font size='-1'><label><input type='checkbox' name='pscat' ");
  $r->print('value="'.$tempkey.'"');   $r->print('value="'.$tempkey.'"');
  if ($$pscat[0] eq "all" || grep $_ eq $tempkey, @{$pscat}) {   if ($$pscat[0] eq "all" || grep $_ eq $tempkey, @{$pscat}) {
     $r->print(' checked');      $r->print(' checked');
  }   }
  $r->print('>'.$$allparms{$tempkey}.'</font></td>');   $r->print('>'.$$allparms{$tempkey}.'</label></font></td>');
   $cnt++;    $cnt++;
         if ($cnt==3) {          if ($cnt==3) {
     $r->print("</tr>\n<tr>");      $r->print("</tr>\n<tr>");
Line 916  ENDSCRIPT Line 918  ENDSCRIPT
     }      }
     $r->print('      $r->print('
 </tr><tr><td>  </tr><tr><td>
 <a href="javascript:checkall(true, \'pscat\')">Select All</a><br />  <a href="javascript:checkall(true, \'pscat\')">Select&nbsp;All</a><br />
 <a href="javascript:checkstandard()">Select Common Only</a>  <a href="javascript:checkstandard()">Select&nbsp;Common&nbsp;Only</a>
 </td><td>  </td><td>
 <a href="javascript:checkdates()">Add Problem Dates</a>  <a href="javascript:checkdates()">Add&nbsp;Problem&nbsp;Dates</a>
 <a href="javascript:checkcontdates()">Add Content Dates</a><br />  <a href="javascript:checkcontdates()">Add&nbsp;Content&nbsp;Dates</a><br />
 <a href="javascript:checkdisset()">Add Discussion Settings</a>  <a href="javascript:checkdisset()">Add&nbsp;Discussion&nbsp;Settings</a>
 <a href="javascript:checkvisi()">Add Visibilities</a><br />  <a href="javascript:checkvisi()">Add&nbsp;Visibilities</a><br />
 <a href="javascript:checkparts()">Add Part Parameters</a>  <a href="javascript:checkparts()">Add&nbsp;Part&nbsp;Parameters</a>
 </td><td>  </td><td>
 <a href="javascript:checkall(false, \'pscat\')">Unselect All</a>  <a href="javascript:checkall(false, \'pscat\')">Unselect&nbsp;All</a>
 </td>  </td>
 ');  ');
     $r->print('</tr></table>');      $r->print('</tr></table>');
Line 939  sub partmenu { Line 941  sub partmenu {
     $r->print('>'.&mt('All Parts').'</option>');      $r->print('>'.&mt('All Parts').'</option>');
     my %temphash=();      my %temphash=();
     foreach (@{$psprt}) { $temphash{$_}=1; }      foreach (@{$psprt}) { $temphash{$_}=1; }
     foreach my $tempkey (sort keys %{$allparts}) {      foreach my $tempkey (sort {
    if ($a==$b) { return ($a cmp $b) } else { return ($a <=> $b); }
       } keys(%{$allparts})) {
  unless ($tempkey =~ /\./) {   unless ($tempkey =~ /\./) {
     $r->print('<option value="'.$tempkey.'"');      $r->print('<option value="'.$tempkey.'"');
     if ($$psprt[0] eq "all" ||  $temphash{$tempkey}) {      if ($$psprt[0] eq "all" ||  $temphash{$tempkey}) {
Line 1001  sub displaymenu { Line 1005  sub displaymenu {
   
 sub mapmenu {  sub mapmenu {
     my ($r,$allmaps,$pschp,$maptitles)=@_;      my ($r,$allmaps,$pschp,$maptitles)=@_;
     $r->print(&mt('Select Enclosing Map or Folder').' ');      $r->print('<b>'.&mt('Select Enclosing Map or Folder').'</b> ');
     $r->print('<select name="pschp">');      $r->print('<select name="pschp">');
     $r->print('<option value="all">'.&mt('All Maps or Folders').'</option>');      $r->print('<option value="all">'.&mt('All Maps or Folders').'</option>');
     foreach (sort {$$allmaps{$a} cmp $$allmaps{$b}} keys %{$allmaps}) {      foreach (sort {$$allmaps{$a} cmp $$allmaps{$b}} keys %{$allmaps}) {
Line 1014  sub mapmenu { Line 1018  sub mapmenu {
   
 sub levelmenu {  sub levelmenu {
     my ($r,$alllevs,$parmlev)=@_;      my ($r,$alllevs,$parmlev)=@_;
     $r->print(&mt('Select Parameter Level').      $r->print('<b>'.&mt('Select Parameter Level').
       &Apache::loncommon::help_open_topic('Course_Parameter_Levels').' ');        &Apache::loncommon::help_open_topic('Course_Parameter_Levels').'</b> ');
     $r->print('<select name="parmlev">');      $r->print('<select name="parmlev">');
     foreach (reverse sort keys %{$alllevs}) {      foreach (reverse sort keys %{$alllevs}) {
  $r->print('<option value="'.$$alllevs{$_}.'"');   $r->print('<option value="'.$$alllevs{$_}.'"');
Line 2223  sub listdata { Line 2227  sub listdata {
  $oldpart=$part;   $oldpart=$part;
     }      }
 #  #
   # Preset defaults?
   #
               my ($hour,$min,$sec,$val)=('','','','');
       unless ($$resourcedata{$thiskey}) {
    my ($parmname)=($thiskey=~/\.(\w+)$/);
    ($hour,$min,$sec,$val)=&preset_defaults($parmname);
       }
   
   #
 # Ready to print  # Ready to print
 #  #
     $r->print(&tablestart().'<tr><td><b>'.$name.      $r->print(&tablestart().'<tr><td><b>'.$name.
Line 2233  sub listdata { Line 2246  sub listdata {
  my $jskey='key_'.$pointer;   my $jskey='key_'.$pointer;
  $pointer++;   $pointer++;
  $r->print(   $r->print(
   &Apache::lonhtmlcommon::date_setter('overviewform',    &Apache::lonhtmlcommon::date_setter('parmform',
       $jskey,        $jskey,
       $$resourcedata{$thiskey},        $$resourcedata{$thiskey},
       '',1).        '',1,'','',$hour,$min,$sec).
 '<input type="hidden" name="datepointer_'.$thiskey.'" value="'.$jskey.'" />'  '<input type="hidden" name="datepointer_'.$thiskey.'" value="'.$jskey.'" />'
   );    );
     } elsif ($thistype eq 'string_yesno') {      } elsif ($thistype eq 'string_yesno') {
    my $showval;
    if (defined($$resourcedata{$thiskey})) {
       $showval=$$resourcedata{$thiskey};
    } else {
       $showval=$val;
    }
  $r->print('<label><input type="radio" name="set_'.$thiskey.   $r->print('<label><input type="radio" name="set_'.$thiskey.
   '" value="yes"');    '" value="yes"');
  if ($$resourcedata{$thiskey} eq 'yes') {   if ($showval eq 'yes') {
     $r->print(' checked="checked"');      $r->print(' checked="checked"');
  }   }
                 $r->print(' />'.&mt('Yes').'</label> ');                  $r->print(' />'.&mt('Yes').'</label> ');
  $r->print('<label><input type="radio" name="set_'.$thiskey.   $r->print('<label><input type="radio" name="set_'.$thiskey.
   '" value="no"');    '" value="no"');
  if ($$resourcedata{$thiskey} eq 'no') {   if ($showval eq 'no') {
     $r->print(' checked="checked"');      $r->print(' checked="checked"');
  }   }
                 $r->print(' />'.&mt('No').'</label>');                  $r->print(' />'.&mt('No').'</label>');
     } else {      } else {
    my $showval;
    if (defined($$resourcedata{$thiskey})) {
       $showval=$$resourcedata{$thiskey};
    } else {
       $showval=$val;
    }
  $r->print('<input type="text" name="set_'.$thiskey.'" value="'.   $r->print('<input type="text" name="set_'.$thiskey.'" value="'.
   $$resourcedata{$thiskey}.'">');    $showval.'">');
     }      }
     $r->print('<input type="hidden" name="typeof_'.$thiskey.'" value="'.      $r->print('<input type="hidden" name="typeof_'.$thiskey.'" value="'.
       $thistype.'">');        $thistype.'">');
Line 2423  $html Line 2448  $html
 </head>  </head>
 $bodytag  $bodytag
 $breadcrumbs  $breadcrumbs
 <form method="post" action="/adm/parmset?action=setoverview" name="overviewform">  <form method="post" action="/adm/parmset?action=setoverview" name="parmform">
 ENDOVER  ENDOVER
 # Store modified  # Store modified
   
Line 2715  ENDDEFHEAD Line 2740  ENDDEFHEAD
     push @datedisplay,&mt('Automatically set earlier than ').$tempkey;      push @datedisplay,&mt('Automatically set earlier than ').$tempkey;
  }    } 
     }      }
   $r->print(&mt('Manual setting rules apply to all interfaces.').'<br />'.
     &mt('Automatic setting rules apply to table mode interfaces only.'));
     $r->print("\n<table border='1'><tr><th>".&mt('Rule for parameter').'</th><th>'.      $r->print("\n<table border='1'><tr><th>".&mt('Rule for parameter').'</th><th>'.
       &mt('Action').'</th><th>'.&mt('Value').'</th></tr>');        &mt('Action').'</th><th>'.&mt('Value').'</th></tr>');
     foreach my $tempkey (&keysindisplayorder(\%allparms,\%keyorder)) {      foreach my $tempkey (&keysindisplayorder(\%allparms,\%keyorder)) {

Removed from v.1.229  
changed lines
  Added in v.1.235


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