--- loncom/interface/spreadsheet/lonspreadsheet.pm 2003/05/27 19:17:07 1.5 +++ loncom/interface/spreadsheet/lonspreadsheet.pm 2003/06/18 19:44:22 1.11 @@ -1,5 +1,5 @@ # -# $Id: lonspreadsheet.pm,v 1.5 2003/05/27 19:17:07 matthew Exp $ +# $Id: lonspreadsheet.pm,v 1.11 2003/06/18 19:44:22 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -58,7 +58,6 @@ use Apache::classcalc(); use Apache::studentcalc(); use Apache::assesscalc(); use Apache::Constants qw(:common :http); -use Apache::lonmenu(); use Apache::lonnet; use Apache::lonhtmlcommon; use HTML::Entities(); @@ -94,18 +93,19 @@ sub file_dialogs { my $bgcolor = "#FFFFFF"; my $sheettype = $spreadsheet->{'type'}; my $result = ''; + my $message = ''; ## ## Deal with saving the spreadsheet - if (exists($ENV{'form.save'}) && + if ((exists($ENV{'form.save'}) || exists($ENV{'form.makedefault'})) && exists($ENV{'form.savefilename'})) { $spreadsheet->filename($ENV{'form.savefilename'}); my $save_status = $spreadsheet->save(); if ($save_status ne 'ok') { - $result .= "An error occurred while saving the spreadsheet". + $message .= "An error occurred while saving the spreadsheet". "There error is:".$save_status; return $result; } else { - $result .= "Spreadsheet saved as ".$ENV{'form.savefilename'}; + $message .= "Spreadsheet saved as ".$ENV{'form.savefilename'}; } } elsif (exists($ENV{'form.newformula'}) && exists($ENV{'form.cell'}) && @@ -117,8 +117,13 @@ sub file_dialogs { $spreadsheet->save_tmp(); # output that we are dealing with a temporary file $result .=&hiddenfield('workcopy',$sheettype); - $result .='
'.$ENV{'form.cell'}.' = '. - $ENV{'form.newformula'}."\n"; + if ($ENV{'form.newformula'} !~ /^\s*$/) { + $message .='
Cell '.$ENV{'form.cell'}.' = | '.
+ ''.$ENV{'form.newformula'}." |