Diff for /loncom/interface/lonprintout.pm between versions 1.399 and 1.402

version 1.399, 2005/11/15 12:37:11 version 1.402, 2005/12/06 15:01:45
Line 908  sub unsupported { Line 908  sub unsupported {
 #  #
 # List of recently generated print files  # List of recently generated print files
 #  #
   
 sub recently_generated {  sub recently_generated {
     my $r=shift;      my $r=shift;
     my $prtspool=$r->dir_config('lonPrtDir');      my $prtspool=$r->dir_config('lonPrtDir');
     my $result;      my $zip_result;
       my $pdf_result;
     opendir(DIR,$prtspool);      opendir(DIR,$prtspool);
     while (my $filename=readdir(DIR)) {  
  if ($filename=~/^$env{'user.name'}\_$env{'user.domain'}\_printout\_(\d+)\_.*.pdf$/) {      my @files = 
     my ($cdev,$cino,$cmode,$cnlink,   grep(/^$env{'user.name'}_$env{'user.domain'}_printout_(\d+)_.*\.(pdf|zip)$/,readdir(DIR));
  $cuid,$cgid,$crdev,$csize,  
  $catime,$cmtime,$cctime,  
  $cblksize,$cblocks)=stat($prtspool.'/'.$filename);  
             $result.="<a href='/prtspool/$filename'>".  
  &mt('Generated [_1] ([_2] bytes)',  
     &Apache::lonlocal::locallocaltime($cctime),$csize).  
     '</a><br />';  
  }  
     }  
     closedir(DIR);      closedir(DIR);
     if ($result) {  
  $r->print('<h4>'.&mt('Recently generated printouts').'</h4>'."\n".      @files = sort {
   $result);   my ($actime) = (stat($prtspool.'/'.$a))[10];
    my ($bctime) = (stat($prtspool.'/'.$b))[10];
    return $bctime <=> $actime;
       } (@files);
   
       foreach my $filename (@files) {
    my ($ext) = ($filename =~ m/(pdf|zip)$/);
    my ($cdev,$cino,$cmode,$cnlink,
       $cuid,$cgid,$crdev,$csize,
       $catime,$cmtime,$cctime,
       $cblksize,$cblocks)=stat($prtspool.'/'.$filename);
    my $result="<a href='/prtspool/$filename'>".
       &mt('Generated [_1] ([_2] bytes)',
    &Apache::lonlocal::locallocaltime($cctime),$csize).
    '</a><br />';
    if ($ext eq 'pdf') { $pdf_result .= $result; }
    if ($ext eq 'zip') { $zip_result .= $result; }
       }
       if ($zip_result) {
    $r->print('<h4>'.&mt('Recently generated printout zip files')."</h4>\n"
     .$zip_result);
       }
       if ($pdf_result) {
    $r->print('<h4>'.&mt('Recently generated printouts')."</h4>\n"
     .$pdf_result);
     }      }
 }  }
   
Line 990  $html Line 1005  $html
 <title>LON-CAPA output for printing</title>  <title>LON-CAPA output for printing</title>
 </head>  </head>
 $bodytag  $bodytag
   <p>
 Please stand by while processing your print request, this may take some time ...  Please stand by while processing your print request, this may take some time ...
   </p>
 ENDPART  ENDPART
   
   
Line 1094  ENDPART Line 1111  ENDPART
  $form{'grade_target'}='answer';   $form{'grade_target'}='answer';
  $form{'answer_output_mode'}='tex';   $form{'answer_output_mode'}='tex';
  $form{'rndseed'}=$rndseed;   $form{'rndseed'}=$rndseed;
                   if ($helper->{'VARS'}->{'probstatus'} eq 'exam') {
       $form{'problemtype'}='exam';
    }
  $resources_printed .= $currentURL.':';   $resources_printed .= $currentURL.':';
  my $answer=&Apache::lonnet::ssi($currentURL,%form);   my $answer=&Apache::lonnet::ssi($currentURL,%form);
  if ($helper->{'VARS'}->{'ANSWER_TYPE'} eq 'no') {   if ($helper->{'VARS'}->{'ANSWER_TYPE'} eq 'no') {

Removed from v.1.399  
changed lines
  Added in v.1.402


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