Diff for /loncom/interface/Attic/lonspreadsheet.pm between versions 1.175 and 1.179

version 1.175, 2003/03/07 23:32:05 version 1.179, 2003/05/27 15:50:30
Line 57  use strict; Line 57  use strict;
 use Apache::Constants qw(:common :http);  use Apache::Constants qw(:common :http);
 use Apache::lonnet;  use Apache::lonnet;
 use Apache::lonhtmlcommon;  use Apache::lonhtmlcommon;
   use Apache::lonmenu;
 use HTML::Entities();  use HTML::Entities();
   
 # --------------------------------------------------------- Various form fields  # --------------------------------------------------------- Various form fields
Line 152  sub handler { Line 153  sub handler {
                                              $ENV{'form.ufn'} eq 'default')) {                                               $ENV{'form.ufn'} eq 'default')) {
         $ENV{'form.ufn'}='default_'.$1;          $ENV{'form.ufn'}='default_'.$1;
     }      }
     if (!$ENV{'form.ufn'} || $ENV{'form.ufn'} eq 'default') {  #    if (!$ENV{'form.ufn'} || $ENV{'form.ufn'} eq 'default') {
         $ENV{'form.ufn'}='course_default_'.$sheettype;  #        $ENV{'form.ufn'}='course_default_'.$sheettype;
     }  #    }
     #      #
     # Interactive loading of specific sheet?      # Interactive loading of specific sheet?
     #      #
Line 183  sub handler { Line 184  sub handler {
     # Header....      # Header....
     #      #
     $r->print('<html><head><title>LON-CAPA Spreadsheet</title>');      $r->print('<html><head><title>LON-CAPA Spreadsheet</title>');
     my $nothing = "''";      my $nothing = &Apache::lonhtmlcommon::javascript_nothing();
     if ($ENV{'browser.type'} eq 'explorer') {  
         $nothing = "'javascript:void(0);'";  
     }  
   
     if ($ENV{'request.role'} !~ /^st\./) {      if ($ENV{'request.role'} !~ /^st\./) {
         $r->print(<<ENDSCRIPT);          $r->print(<<ENDSCRIPT);
Line 247  ENDSCRIPT Line 245  ENDSCRIPT
               &hiddenfield('udom',$ENV{'form.udom'}).                &hiddenfield('udom',$ENV{'form.udom'}).
               &hiddenfield('usymb',$ENV{'form.usymb'}).                &hiddenfield('usymb',$ENV{'form.usymb'}).
               &hiddenfield('unewfield','').                &hiddenfield('unewfield','').
               &hiddenfield('unewformula',''));                &hiddenfield('unewformula','').
                 &Apache::lonmenu::regflush());
     $r->rflush();      $r->rflush();
     #      #
     # Full recalc?      # Full recalc?
Line 355  ENDSCRIPT Line 354  ENDSCRIPT
         $oldsheets{'course'} ne $sheet->{'cid'}) {          $oldsheets{'course'} ne $sheet->{'cid'}) {
         undef %oldsheets;          undef %oldsheets;
         undef %loadedcaches;          undef %loadedcaches;
           &Apache::lonspreadsheet::Spreadsheet::clear_package_variables();
     }      }
     $oldsheets{'course'} = $sheet->{'cid'};      $oldsheets{'course'} = $sheet->{'cid'};
     #      #
Line 537  my %defaultsheets; Line 537  my %defaultsheets;
 my %rowlabel_cache;  my %rowlabel_cache;
 #my %oldsheets;  #my %oldsheets;
   
   sub clear_package_variables {
       undef %courseopt;
       undef %useropt;
       undef %parmhash;
       undef %Section;
       undef %expiredates;
       undef $cachedassess;
       undef %cachedstores;
       undef %starttimes;
       undef %usedtimes;
       undef %numbertimes;
       undef $includedir;
       undef %spreadsheets;
       undef %courserdatas;
       undef %userrdatas;
       undef %defaultsheets;
       undef %rowlabel_cache;
   }
   
 sub complete_recalc {  sub complete_recalc {
     my $self = shift;      my $self = shift;
     undef %spreadsheets;      undef %spreadsheets;
Line 754  sub new { Line 773  sub new {
     #      #
     my ($uname,$udom,$stype,$usymb)=@_;      my ($uname,$udom,$stype,$usymb)=@_;
     #      #
       if (! exists($Section{$uname.':'.$udom})) {
           my $classlist = &Apache::loncoursedata::get_classlist();
           #
           foreach my $student (keys(%$classlist)) {
               my ($studentDomain,$studentName,undef,undef,undef,$studentSection,
                   undef,undef) = @{$classlist->{$student}};
               $Section{$studentName.':'.$studentDomain} = $studentSection;
           }
       }
     my $self = {      my $self = {
         uname => $uname,          uname => $uname,
         udom  => $udom,          udom  => $udom,
Line 1526  sub expandnamed { Line 1554  sub expandnamed {
  foreach my $varname ( @vars ) {   foreach my $varname ( @vars ) {
             if ($varname=~/\D/) {              if ($varname=~/\D/) {
                $formula=~s/$varname/'$c{\''.$varname.'\'}'/ge;                 $formula=~s/$varname/'$c{\''.$varname.'\'}'/ge;
                $varname=~s/$var/\([\\w:- ]\+\)/g;                 $varname=~s/$var/\([\\w:\\- ]\+\)/g;
        foreach (keys(%{$self->{'constants'}})) {         foreach (keys(%{$self->{'constants'}})) {
   if ($_=~/$varname/) {    if ($_=~/$varname/) {
       $values{$1}=1;        $values{$1}=1;

Removed from v.1.175  
changed lines
  Added in v.1.179


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