Diff for /loncom/interface/Attic/lonchart.pm between versions 1.59 and 1.60

version 1.59, 2002/07/09 15:43:49 version 1.60, 2002/07/17 12:36:17
Line 150  $Str: Formatted string. Line 150  $Str: Formatted string.
 sub FormatStudentInformation {  sub FormatStudentInformation {
     my ($cache,$name,$studentInformation,$spacePadding)=@_;      my ($cache,$name,$studentInformation,$spacePadding)=@_;
     my $Str='';      my $Str='';
       my $data;
   
     for(my $index=0; $index<(scalar @$studentInformation); $index++) {      for(my $index=0; $index<(scalar @$studentInformation); $index++) {
         if(!&ShouldShowColumn($cache, 'ChartHeading'.$index)) {          if(!&ShouldShowColumn($cache, 'ChartHeading'.$index)) {
             next;              next;
         }          }
  my $data=$cache->{$name.':'.$studentInformation->[$index]};          $data=$cache->{$name.':'.$studentInformation->[$index]};
  $Str .= $data;   $Str .= $data;
   
  my @dataLength=split(//,$data);   my @dataLength=split(//,$data);
Line 211  sub FormatStudentData { Line 212  sub FormatStudentData {
     unless(tie(%CacheData,'GDBM_File',$ChartDB,&GDBM_READER,0640)) {      unless(tie(%CacheData,'GDBM_File',$ChartDB,&GDBM_READER,0640)) {
         return '';          return '';
     }      }
   
   #    my $section = &Apache::loncoursedata::CheckStatus($name, \%CacheData, 
   #                                               $CacheData{'form.Status'});
   #    if($section eq 'not found') {
   #        untie(%CacheData);
   #        return;
   #    }
   
     # Handle Student information ------------------------------------------      # Handle Student information ------------------------------------------
     # Handle user data      # Handle user data
     $Str=&FormatStudentInformation(\%CacheData, $name, $studentInformation,       $Str=&FormatStudentInformation(\%CacheData, $name, $studentInformation, 
Line 586  sub CreateForm { Line 595  sub CreateForm {
     my $OpSel1='';      my $OpSel1='';
     my $OpSel2='';      my $OpSel2='';
     my $OpSel3='';      my $OpSel3='';
     my $Status = $CacheData->{'form.ChartStatus'};      my $Status = $CacheData->{'form.Status'};
     if ( $Status eq 'Any' ) { $OpSel3='selected'; }      if ( $Status eq 'Any' ) { $OpSel3='selected'; }
     elsif ($Status eq 'Expired' ) { $OpSel2 = 'selected'; }      elsif ($Status eq 'Expired' ) { $OpSel2 = 'selected'; }
     else { $OpSel1 = 'selected'; }      else { $OpSel1 = 'selected'; }
Line 614  sub CreateForm { Line 623  sub CreateForm {
     $Ptr .= '</td></tr><tr><td align="right">';      $Ptr .= '</td></tr><tr><td align="right">';
     $Ptr .= '<b> Student Status: &nbsp; </b>'."\n".      $Ptr .= '<b> Student Status: &nbsp; </b>'."\n".
             '</td><td align="left">'.              '</td><td align="left">'.
             '<select name="ChartStatus">'.               '<select name="Status">'. 
             '<option '.$OpSel1.' >Active</option>'."\n".              '<option '.$OpSel1.' >Active</option>'."\n".
             '<option '.$OpSel2.' >Expired</option>'."\n".              '<option '.$OpSel2.' >Expired</option>'."\n".
     '<option '.$OpSel3.' >Any</option> </select> '."\n";      '<option '.$OpSel3.' >Any</option> </select> '."\n";
Line 723  sub ProcessFormData { Line 732  sub ProcessFormData {
             $CacheData{'form.ChartSort'}='username';              $CacheData{'form.ChartSort'}='username';
         }          }
   
         if(defined($ENV{'form.ChartStatus'})) {          if(defined($ENV{'form.Status'})) {
             $CacheData{'form.ChartStatus'}=$ENV{'form.ChartStatus'};              $CacheData{'form.Status'}=$ENV{'form.Status'};
         } elsif(!defined($CacheData{'form.ChartStatus'})) {          } elsif(!defined($CacheData{'form.Status'})) {
             $CacheData{'form.ChartStatus'}='Active';              $CacheData{'form.Status'}='Active';
         }          }
   
         # $found checks for any instances of form data in the ENV.  If it is          # $found checks for any instances of form data in the ENV.  If it is
Line 768  sub ProcessFormData { Line 777  sub ProcessFormData {
         # on the remote was pressed and needs to reset all the selections          # on the remote was pressed and needs to reset all the selections
         if(defined($ENV{'form.ChartReset'}) || (!$found && !$isCached)) {          if(defined($ENV{'form.ChartReset'}) || (!$found && !$isCached)) {
             $CacheData{'form.ChartReset'}='true';              $CacheData{'form.ChartReset'}='true';
             $CacheData{'form.ChartStatus'}='Active';              $CacheData{'form.Status'}='Active';
             $CacheData{'form.ChartSort'}='username';              $CacheData{'form.ChartSort'}='username';
             $CacheData{'form.ChartHeadings'}='ALLHEADINGS';              $CacheData{'form.ChartHeadings'}='ALLHEADINGS';
             $CacheData{'form.ChartSequences'}='ALLSEQUENCES';              $CacheData{'form.ChartSequences'}='ALLSEQUENCES';
Line 864  sub SortStudents { Line 873  sub SortStudents {
         my ($end,$start)=split(/\:/,$CacheData->{$_.':date'});          my ($end,$start)=split(/\:/,$CacheData->{$_.':date'});
         my $active=1;          my $active=1;
         my $now=time;          my $now=time;
         my $Status=$CacheData->{'form.ChartStatus'};          my $Status=$CacheData->{'form.Status'};
         $Status = ($Status) ? $Status : 'Active';          $Status = ($Status) ? $Status : 'Active';
         if((($end) && $now > $end) && (($Status eq 'Active'))) {           if((($end) && $now > $end) && (($Status eq 'Active'))) { 
             $active=0;               $active=0; 
Line 1056  sub BuildChart { Line 1065  sub BuildChart {
   
   
         @students=&Apache::loncoursedata::ProcessClassList(\%CacheData,           @students=&Apache::loncoursedata::ProcessClassList(\%CacheData, 
                                               $classlist, $cid,                                                        $classlist, $cid, 
                                               $CacheData{'form.ChartStatus'},                                                       $CacheData{'form.Status'},
                                               $c);                                                       $c);
   
         if($c->aborted()) {          if($c->aborted()) {
             untie(%CacheData);              untie(%CacheData);

Removed from v.1.59  
changed lines
  Added in v.1.60


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