--- loncom/interface/spreadsheet/Spreadsheet.pm 2005/03/10 17:33:57 1.40 +++ loncom/interface/spreadsheet/Spreadsheet.pm 2005/04/07 06:56:23 1.41 @@ -1,5 +1,5 @@ # -# $Id: Spreadsheet.pm,v 1.40 2005/03/10 17:33:57 matthew Exp $ +# $Id: Spreadsheet.pm,v 1.41 2005/04/07 06:56:23 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -90,10 +90,10 @@ sub new { $usymb = $usymb->symb; } if (! defined($name) || $name eq '') { - $name = $ENV{'user.name'}; + $name = $env{'user.name'}; } if (! defined($domain) || $domain eq '') { - $domain = $ENV{'user.domain'}; + $domain = $env{'user.domain'}; } # my $self = { @@ -103,12 +103,12 @@ sub new { symb => $usymb, errorlog => '', maxrow => 0, - cid => $ENV{'request.course.id'}, - cnum => $ENV{'course.'.$ENV{'request.course.id'}.'.num'}, - cdom => $ENV{'course.'.$ENV{'request.course.id'}.'.domain'}, - chome => $ENV{'course.'.$ENV{'request.course.id'}.'.home'}, - coursedesc => $ENV{'course.'.$ENV{'request.course.id'}.'.description'}, - coursefilename => $ENV{'request.course.fn'}, + cid => $env{'request.course.id'}, + cnum => $env{'course.'.$env{'request.course.id'}.'.num'}, + cdom => $env{'course.'.$env{'request.course.id'}.'.domain'}, + chome => $env{'course.'.$env{'request.course.id'}.'.home'}, + coursedesc => $env{'course.'.$env{'request.course.id'}.'.description'}, + coursefilename => $env{'request.course.fn'}, # # Flags temporary => 0, # true if this sheet has been modified but not saved @@ -132,8 +132,8 @@ sub new { # # Load in the spreadsheet definition $self->filename($filename); - if (exists($ENV{'form.workcopy'}) && - $self->{'type'} eq $ENV{'form.workcopy'}) { + if (exists($env{'form.workcopy'}) && + $self->{'type'} eq $env{'form.workcopy'}) { $self->load_tmp(); } else { $self->load(); @@ -160,8 +160,8 @@ sub filename { $newfilename !~ /\w/ || $newfilename eq '') { my $key = 'course.'.$self->{'cid'}.'.spreadsheet_default_'. $self->{'type'}; - if (exists($ENV{$key}) && $ENV{$key} ne '') { - $newfilename = $ENV{$key}; + if (exists($env{$key}) && $env{$key} ne '') { + $newfilename = $env{$key}; } else { $newfilename = 'default_'.$self->{'type'}; } @@ -259,10 +259,10 @@ sub initialize_spreadsheet_package { sub load_spreadsheet_expirationdates { undef %expiredates; - my $cid=$ENV{'request.course.id'}; + my $cid=$env{'request.course.id'}; my @tmp = &Apache::lonnet::dump('nohist_expirationdates', - $ENV{'course.'.$cid.'.domain'}, - $ENV{'course.'.$cid.'.num'}); + $env{'course.'.$cid.'.domain'}, + $env{'course.'.$cid.'.num'}); if (lc($tmp[0]) !~ /^error/){ %expiredates = @tmp; } @@ -318,7 +318,7 @@ sub initialize_safe_space { my $self = shift; my $usection = &Apache::lonnet::getsection($self->{'domain'}, $self->{'name'}, - $ENV{'request.course.id'}); + $env{'request.course.id'}); if (! defined($safeeval)) { $safeeval = new Safe(shift); my $safehole = new Safe::Hole; @@ -1222,7 +1222,7 @@ sub display { my ($r) = @_; my $outputmode = 'html'; foreach ($self->output_options()) { - if ($ENV{'form.output_format'} eq $_->{'value'}) { + if ($env{'form.output_format'} eq $_->{'value'}) { $outputmode = $_->{'value'}; last; } @@ -1266,7 +1266,7 @@ sub html_export_row { my $self = shift(); my ($color) = @_; $color = '#CCCCFF' if (! defined($color)); - my $allowed = &Apache::lonnet::allowed('mgr',$ENV{'request.course.id'}); + my $allowed = &Apache::lonnet::allowed('mgr',$env{'request.course.id'}); my $row_html; my @rowdata = $self->get_row(0); foreach my $cell (@rowdata) { @@ -1283,7 +1283,7 @@ sub html_export_row { sub html_template_row { my $self = shift(); - my $allowed = &Apache::lonnet::allowed('mgr',$ENV{'request.course.id'}); + my $allowed = &Apache::lonnet::allowed('mgr',$env{'request.course.id'}); my ($num_uneditable,$importcolor) = @_; my $row_html; my @rowdata = $self->get_template_row(); @@ -1350,7 +1350,7 @@ sub html_uneditable_cell { sub html_row { my $self = shift(); my ($num_uneditable,$row,$exportcolor,$importcolor) = @_; - my $allowed = &Apache::lonnet::allowed('mgr',$ENV{'request.course.id'}); + my $allowed = &Apache::lonnet::allowed('mgr',$env{'request.course.id'}); my @rowdata = $self->get_row($row); my $num_cols_output = 0; my $row_html; @@ -1374,7 +1374,7 @@ sub html_row { sub html_header { my $self = shift; - return '' if (! $ENV{'request.role.adv'}); + return '' if (! $env{'request.role.adv'}); return "\n". ''."\n". '\n". @@ -1399,10 +1399,10 @@ sub output_selector { my $self = shift(); my $output_selector = '
'.&mt('Output Format').'
'.$self->output_selector()."