--- loncom/interface/spreadsheet/lonspreadsheet.pm 2004/02/24 21:03:09 1.31.2.1 +++ loncom/interface/spreadsheet/lonspreadsheet.pm 2008/12/11 14:55:20 1.52 @@ -1,5 +1,5 @@ # -# $Id: lonspreadsheet.pm,v 1.31.2.1 2004/02/24 21:03:09 albertel Exp $ +# $Id: lonspreadsheet.pm,v 1.52 2008/12/11 14:55:20 bisitz Exp $ # # Copyright Michigan State University Board of Trustees # @@ -100,9 +100,10 @@ sub file_dialogs { my $message = ''; ## ## Deal with saving the spreadsheet - if ((exists($ENV{'form.save'}) || exists($ENV{'form.makedefault'})) && - exists($ENV{'form.savefilename'})) { - $spreadsheet->filename($ENV{'form.savefilename'}); + $spreadsheet->check_formulas_loaded(); + 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') { $message .= "An error occurred while saving the spreadsheet". @@ -110,22 +111,22 @@ sub file_dialogs { } else { $message .= "Spreadsheet saved as ".$spreadsheet->filename(); } - } elsif (exists($ENV{'form.newformula'}) && - exists($ENV{'form.cell'}) && - $ENV{'form.cell'} ne '' ) { + } elsif (exists($env{'form.newformula'}) && + exists($env{'form.cell'}) && + $env{'form.cell'} ne '' ) { ## ## Make any requested modifications to the spreadsheet - $spreadsheet->modify_cell($ENV{'form.cell'}, - $ENV{'form.newformula'}); + $spreadsheet->modify_cell($env{'form.cell'}, + $env{'form.newformula'}); $spreadsheet->save_tmp(); # output that we are dealing with a temporary file $result .=&hiddenfield('workcopy',$sheettype); - if ($ENV{'form.newformula'} !~ /^\s*$/) { + if ($env{'form.newformula'} !~ /^\s*$/) { $message .=''. - ''. - '
'.&mt('Cell').' '.$ENV{'form.cell'}.' = 
'.$ENV{'form.newformula'}."
\n"; + '
'.&mt('Cell').' '.$env{'form.cell'}.' = 
'. + '
'.$env{'form.newformula'}."
\n"; } else { - $message .= &mt('Deleted contents of cell').' '.$ENV{'form.cell'}.'.'; + $message .= &mt('Deleted contents of cell').' '.$env{'form.cell'}.'.'; } } ## @@ -139,11 +140,11 @@ sub file_dialogs { if ($spreadsheet->is_default()) { $filename = 'Default'; } - my $save_dialog = ''. + my $save_dialog = ''. ' '. ''. - ''; + ''; my $makedefault_dialog = ''; # @@ -153,9 +154,9 @@ sub file_dialogs { my $load_dialog = < - + - $link + $link