Diff for /loncom/interface/londocs.pm between versions 1.91 and 1.92

version 1.91, 2003/10/28 21:50:02 version 1.92, 2003/10/29 21:21:55
Line 585  sub checkversions { Line 585  sub checkversions {
     my %changes=();      my %changes=();
     my $starttime=0;      my $starttime=0;
     my $haschanged=0;      my $haschanged=0;
       my %setversions=&Apache::lonnet::dump('resourceversions',
     $ENV{'course.'.$ENV{'request.course.id'}.'.domain'},
     $ENV{'course.'.$ENV{'request.course.id'}.'.num'});
   
       $hashtied=0;
       &tiehash();
       my %newsetversions=();
     if ($ENV{'form.setmostrecent'}) {      if ($ENV{'form.setmostrecent'}) {
  $haschanged=1;   $haschanged=1;
    foreach (keys %hash) {
       if ($_=~/^ids\_(\/res\/.+)$/) {
    my $src=$1;
       }
    }
     } elsif ($ENV{'form.setcurrent'}) {      } elsif ($ENV{'form.setcurrent'}) {
  $haschanged=1;   $haschanged=1;
    foreach (keys %hash) {
       if ($_=~/^ids\_(\/res\/.+)$/) {
    my $src=$1;
       }
    }
     } elsif ($ENV{'form.setversions'}) {      } elsif ($ENV{'form.setversions'}) {
  $haschanged=1;   $haschanged=1;
    foreach (keys %ENV) {
       if ($_=~/^form\.set_version_(.+)$/) {
    my $src=$1;
    &Apache::lonnet::logthis('Found: '.$1.' '.$ENV{$_});
    if (($ENV{$_}) && ($ENV{$_} ne $setversions{$src})) {
       $newsetversions{$src}=$ENV{$_};
    }
       }
    }
     }      }
     if ($haschanged) {      if ($haschanged) {
  $r->print('<h1>'.&mt('Your Version Settings have been Stored').'</h1>');          if (&Apache::lonnet::put('resourceversions',\%newsetversions,
     $ENV{'course.'.$ENV{'request.course.id'}.'.domain'},
     $ENV{'course.'.$ENV{'request.course.id'}.'.num'}) eq 'ok') {
       $r->print('<h1>'.&mt('Your Version Settings have been Stored').'</h1>');
    } else {
       $r->print('<h1><font color="red">'.&mt('An Error Occured while Attempting to Store your Version Settings').'</font></h1>');
    }
  &changewarning($r,'');   &changewarning($r,'');
  return;  
     }      }
     $hashtied=0;  
     &tiehash();  
     if ($ENV{'form.timerange'} eq 'all') {      if ($ENV{'form.timerange'} eq 'all') {
 # show all documents  # show all documents
  $header=&mt('All Documents in Course');   $header=&mt('All Documents in Course');
Line 642  sub checkversions { Line 671  sub checkversions {
     $header=&mt('No content modifications yet.');      $header=&mt('No content modifications yet.');
  }   }
     }      }
       %setversions=&Apache::lonnet::dump('resourceversions',
     $ENV{'course.'.$ENV{'request.course.id'}.'.domain'},
     $ENV{'course.'.$ENV{'request.course.id'}.'.num'});
     my %lt=&Apache::lonlocal::texthash      my %lt=&Apache::lonlocal::texthash
       ('st' => 'Version changes since start of Course',        ('st' => 'Version changes since start of Course',
        'lm' => 'Version changes since last Month',         'lm' => 'Version changes since last Month',
Line 671  sub checkversions { Line 703  sub checkversions {
 <option value="86400" $daysel>$lt{'sy'}</option>  <option value="86400" $daysel>$lt{'sy'}</option>
 </select>  </select>
 <input type="submit" name="display" value="$lt{'sd'}" />  <input type="submit" name="display" value="$lt{'sd'}" />
 </form>  
 <h3>$header</h3>  <h3>$header</h3>
 <input type="submit" name="setversions" value="$lt{'sv'}" />  <input type="submit" name="setversions" value="$lt{'sv'}" />
 <table border="2">  <table border="2">
Line 701  ENDHEADERS Line 732  ENDHEADERS
     }      }
     $r->print('</font></td><td>');      $r->print('</font></td><td>');
 # Set version  # Set version
     $r->print(&Apache::loncommon::select_form($usedversion,      $r->print(&Apache::loncommon::select_form($setversions{$linkurl},
       'set_version_'.$linkurl,        'set_version_'.$linkurl,
       ('' => '',        ('' => '',
        'current' => 'most recent',         'current' => 'most recent',
Line 732  ENDHEADERS Line 763  ENDHEADERS
     $r->print('</ul></font></td></tr>');      $r->print('</ul></font></td></tr>');
  }   }
     }      }
     $r->print('</table>');      $r->print('</table></form>');
     $r->print('<h1>'.&mt('Done').'.</h1>');      $r->print('<h1>'.&mt('Done').'.</h1>');
   
     &untiehash();      &untiehash();

Removed from v.1.91  
changed lines
  Added in v.1.92


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