Diff for /loncom/interface/Attic/lonspreadsheet.pm between versions 1.149 and 1.151

version 1.149, 2002/11/22 19:21:59 version 1.151, 2002/12/02 16:39:30
Line 965  sub templaterow { Line 965  sub templaterow {
      'N','O','P','Q','R','S','T','U','V','W','X','Y','Z',       'N','O','P','Q','R','S','T','U','V','W','X','Y','Z',
      'a','b','c','d','e','f','g','h','i','j','k','l','m',       'a','b','c','d','e','f','g','h','i','j','k','l','m',
      'n','o','p','q','r','s','t','u','v','w','x','y','z') {       'n','o','p','q','r','s','t','u','v','w','x','y','z') {
         my $fm=$sheet->{'f'}->{'template_'.$_};  
         $fm=~s/[\'\"]/\&\#34;/g;  
         push(@cols,{ name    => 'template_'.$_,          push(@cols,{ name    => 'template_'.$_,
                      formula => $fm,                       formula => $sheet->{'f'}->{'template_'.$_},
                      value   => $fm });                       value   => $sheet->{'f'}->{'template_'.$_} });
     }      }
     return ($rowlabel,@cols);      return ($rowlabel,@cols);
 }  }
Line 993  sub outrowassess { Line 991  sub outrowassess {
      'N','O','P','Q','R','S','T','U','V','W','X','Y','Z',       'N','O','P','Q','R','S','T','U','V','W','X','Y','Z',
      'a','b','c','d','e','f','g','h','i','j','k','l','m',       'a','b','c','d','e','f','g','h','i','j','k','l','m',
      'n','o','p','q','r','s','t','u','v','w','x','y','z') {       'n','o','p','q','r','s','t','u','v','w','x','y','z') {
         my $fm=$sheet->{'f'}->{$_.$n};  
         $fm=~s/[\'\"]/\&\#34;/g;  
         push(@cols,{ name    => $_.$n,          push(@cols,{ name    => $_.$n,
                      formula => $fm,                       formula => $sheet->{'f'}->{$_.$n},
                      value   => $sheet->{'values'}->{$_.$n}});                       value   => $sheet->{'values'}->{$_.$n}});
     }      }
     return ($rowlabel,@cols);      return ($rowlabel,@cols);
Line 1019  sub outrow { Line 1015  sub outrow {
      'N','O','P','Q','R','S','T','U','V','W','X','Y','Z',       'N','O','P','Q','R','S','T','U','V','W','X','Y','Z',
      'a','b','c','d','e','f','g','h','i','j','k','l','m',       'a','b','c','d','e','f','g','h','i','j','k','l','m',
      'n','o','p','q','r','s','t','u','v','w','x','y','z') {       'n','o','p','q','r','s','t','u','v','w','x','y','z') {
         my $fm=$sheet->{'f'}->{$_.$n};  
         $fm=~s/[\'\"]/\&\#34;/g;  
         push(@cols,{ name    => $_.$n,          push(@cols,{ name    => $_.$n,
                      formula => $fm,                       formula => $sheet->{'f'}->{$_.$n},
                      value   => $sheet->{'values'}->{$_.$n}});                       value   => $sheet->{'values'}->{$_.$n}});
     }      }
     return ($rowlabel,@cols);      return ($rowlabel,@cols);
Line 1257  sub html_editable_cell { Line 1251  sub html_editable_cell {
     if ($value =~ /^\s*$/ ) {      if ($value =~ /^\s*$/ ) {
         $value = '<font color="'.$bgcolor.'">#</font>';          $value = '<font color="'.$bgcolor.'">#</font>';
     }      }
       &Apache::lonnet::logthis($name.' formula = '.$formula) if ($formula);
       $formula =~ s/</\&lt;/g;
       $formula =~ s/>/\&gt;/g;
       $formula =~ s/\&/\&amp;/g;
       $formula =~ s/\"/\&quot;/g;
       $formula =~ s/\'/\&quot;/g;
     $formula =~ s/\n/\\n/gs;      $formula =~ s/\n/\\n/gs;
     $result .= '<a href="javascript:celledit(\''.      &Apache::lonnet::logthis($name.' formula = '.$formula) if ($formula);
         $name.'\',\''.$formula.'\');">'.$value.'</a>';      $result .= "<a href=\"javascript:celledit(\'".
           $name."','".$formula."');\">".$value."</a>";
       &Apache::lonnet::logthis('result = '.$result) if ($formula);
     return $result;      return $result;
 }  }
   
Line 2988  sub handler { Line 2990  sub handler {
   
     function celledit(cellname,cellformula) {      function celledit(cellname,cellformula) {
         var edit_text = '';          var edit_text = '';
           // cellformula may contain less-than and greater-than symbols, so
           // we need to escape them?  
         edit_text +='<html><head><title>Cell Edit Window</title></head><body>';          edit_text +='<html><head><title>Cell Edit Window</title></head><body>';
         edit_text += '<form name="editwinform">';          edit_text += '<form name="editwinform">';
         edit_text += '<center><h3>Cell '+cellname+'</h3>';          edit_text += '<center><h3>Cell '+cellname+'</h3>';
Line 3221  ENDSCRIPT Line 3225  ENDSCRIPT
         }           } 
         $r->print('>'.$mode.'</option>'."\n");          $r->print('>'.$mode.'</option>'."\n");
     }      }
     if ($sheet->{'sheettype'} eq 'classcalc') {  #
         $r->print('<option value="recursive excel"');  #    Mulit-sheet excel takes too long and does not work at all for large
         if ($ENV{'form.output'} eq 'recursive excel') {  #    classes.  Future inclusion of this option may be possible with the
             $r->print(' selected ');  #    Spreadsheet::WriteExcel::Big and speed improvements.
         }   #
         $r->print(">Multi-Sheet Excel</option>\n");  #    if ($sheet->{'sheettype'} eq 'classcalc') {
     }  #        $r->print('<option value="recursive excel"');
   #        if ($ENV{'form.output'} eq 'recursive excel') {
   #            $r->print(' selected ');
   #        } 
   #        $r->print(">Multi-Sheet Excel</option>\n");
   #    }
     $r->print("</select>\n");      $r->print("</select>\n");
     #      #
     if ($sheet->{'sheettype'} eq 'classcalc') {      if ($sheet->{'sheettype'} eq 'classcalc') {

Removed from v.1.149  
changed lines
  Added in v.1.151


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