version 1.55, 2001/07/20 02:05:33
|
version 1.56, 2001/07/21 22:45:46
|
Line 6
|
Line 6
|
# 01/01/01,02/01,03/01,19/01,20/01,22/01, |
# 01/01/01,02/01,03/01,19/01,20/01,22/01, |
# 03/05,03/08,03/10,03/12,03/13,03/15,03/17, |
# 03/05,03/08,03/10,03/12,03/13,03/15,03/17, |
# 03/19,03/20,03/21,03/27,04/05,04/09, |
# 03/19,03/20,03/21,03/27,04/05,04/09, |
# 07/09,07/14 Gerd Kortemeyer |
# 07/09,07/14,07/21 Gerd Kortemeyer |
|
|
package Apache::lonspreadsheet; |
package Apache::lonspreadsheet; |
|
|
Line 893 sub writesheet {
|
Line 893 sub writesheet {
|
# ----------------------------------------------------------------- Write sheet |
# ----------------------------------------------------------------- Write sheet |
my $sheetdata=''; |
my $sheetdata=''; |
map { |
map { |
|
unless ($f{$_} eq 'import') { |
$sheetdata.=&Apache::lonnet::escape($_).'='. |
$sheetdata.=&Apache::lonnet::escape($_).'='. |
&Apache::lonnet::escape($f{$_}).'&'; |
&Apache::lonnet::escape($f{$_}).'&'; |
|
} |
} keys %f; |
} keys %f; |
$sheetdata=~s/\&$//; |
$sheetdata=~s/\&$//; |
my $reply=&Apache::lonnet::reply('put:'.$cdom.':'.$cnum.':'.$fn.':'. |
my $reply=&Apache::lonnet::reply('put:'.$cdom.':'.$cnum.':'.$fn.':'. |
Line 1953 ENDSCRIPT
|
Line 1955 ENDSCRIPT
|
} |
} |
} |
} |
|
|
# ---------------------------------------------------- See if something to save |
|
|
|
if (&Apache::lonnet::allowed('opa',$ENV{'request.course.id'})) { |
|
my $fname=''; |
|
if ($ENV{'form.saveas'} && ($fname=$ENV{'form.newfn'})) { |
|
$fname=~s/\W/\_/g; |
|
if ($fname eq 'default') { $fname='course_default'; } |
|
$fname.='_'.&gettype($asheet); |
|
&setfilename($asheet,$fname); |
|
$ENV{'form.ufn'}=$fname; |
|
$r->print('<p>Saving spreadsheet: '. |
|
&writesheet($asheet,$ENV{'form.makedefufn'}).'<p>'); |
|
} |
|
} |
|
|
|
# ------------------------------------------------ Write the modified worksheet |
|
|
|
$r->print('<b>Current sheet:</b> '.&getfilename($asheet).'<p>'); |
|
|
|
&tmpwrite($asheet); |
|
|
|
# ---------------------------------------------------------- Additional options |
# ---------------------------------------------------------- Additional options |
|
|
$r->print( |
$r->print( |
Line 2062 ENDSCRIPT
|
Line 2043 ENDSCRIPT
|
my $calcoutput=&calcsheet($asheet); |
my $calcoutput=&calcsheet($asheet); |
$r->print('<h3><font color=red>'.$calcoutput.'</h3></font>'); |
$r->print('<h3><font color=red>'.$calcoutput.'</h3></font>'); |
|
|
|
# ---------------------------------------------------- See if something to save |
|
|
|
if (&Apache::lonnet::allowed('opa',$ENV{'request.course.id'})) { |
|
my $fname=''; |
|
if ($ENV{'form.saveas'} && ($fname=$ENV{'form.newfn'})) { |
|
$fname=~s/\W/\_/g; |
|
if ($fname eq 'default') { $fname='course_default'; } |
|
$fname.='_'.&gettype($asheet); |
|
&setfilename($asheet,$fname); |
|
$ENV{'form.ufn'}=$fname; |
|
$r->print('<p>Saving spreadsheet: '. |
|
&writesheet($asheet,$ENV{'form.makedefufn'}).'<p>'); |
|
} |
|
} |
|
|
|
# ------------------------------------------------ Write the modified worksheet |
|
|
|
$r->print('<b>Current sheet:</b> '.&getfilename($asheet).'<p>'); |
|
|
|
&tmpwrite($asheet); |
|
|
|
# ------------------------------------------------------------- Print out sheet |
|
|
&outsheet($r,$asheet); |
&outsheet($r,$asheet); |
$r->print('</form></body></html>'); |
$r->print('</form></body></html>'); |
|
|