--- loncom/interface/spreadsheet/Spreadsheet.pm 2005/02/03 23:59:41 1.38 +++ loncom/interface/spreadsheet/Spreadsheet.pm 2005/03/10 17:33:57 1.40 @@ -1,5 +1,5 @@ # -# $Id: Spreadsheet.pm,v 1.38 2005/02/03 23:59:41 matthew Exp $ +# $Id: Spreadsheet.pm,v 1.40 2005/03/10 17:33:57 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -86,6 +86,9 @@ sub new { my ($stype) = ($class =~ /Apache::(.*)$/); # my ($name,$domain,$filename,$usymb)=@_; + if (defined($usymb) && ref($usymb)) { + $usymb = $usymb->symb; + } if (! defined($name) || $name eq '') { $name = $ENV{'user.name'}; } @@ -1430,31 +1433,6 @@ sub excel_output_row { return; } -sub create_excel_spreadsheet { - my $self = shift; - my ($r) = @_; - my $filename = '/prtspool/'. - $ENV{'user.name'}.'_'.$ENV{'user.domain'}.'_'. - time.'_'.rand(1000000000).'.xls'; - my $workbook = Spreadsheet::WriteExcel->new('/home/httpd'.$filename); - if (! defined($workbook)) { - $r->log_error("Error creating excel spreadsheet $filename: $!"); - $r->print(&mt("Problems creating new Excel file. ". - "This error has been logged. ". - "Please alert your LON-CAPA administrator")); - return undef; - } - # - # The excel spreadsheet stores temporary data in files, then put them - # together. If needed we should be able to disable this (memory only). - # The temporary directory must be specified before calling 'addworksheet'. - # File::Temp is used to determine the temporary directory. - $workbook->set_tempdir('/home/httpd/perl/tmp'); - # - # Determine the name to give the worksheet - return ($workbook,$filename); -} - # # This routine is just a stub sub outsheet_htmlclasslist { @@ -1475,8 +1453,8 @@ sub outsheet_excel { # $r->print("