version 1.79, 2008/09/11 14:47:22
|
version 1.80, 2008/09/12 14:35:46
|
Line 1525 sub outsheet_csv {
|
Line 1525 sub outsheet_csv {
|
my $csvdata = ''; |
my $csvdata = ''; |
my @Values; |
my @Values; |
# |
# |
# Open the csv file |
# Open the CSV file |
my $filename = '/prtspool/'. |
my $filename = '/prtspool/'. |
$env{'user.name'}.'_'.$env{'user.domain'}.'_'. |
$env{'user.name'}.'_'.$env{'user.domain'}.'_'. |
time.'_'.rand(1000000000).'.csv'; |
time.'_'.rand(1000000000).'.csv'; |
my $file; |
my $file; |
unless ($file = Apache::File->new('>'.'/home/httpd'.$filename)) { |
unless ($file = Apache::File->new('>'.'/home/httpd'.$filename)) { |
$r->log_error("Couldn't open $filename for output $!"); |
$r->log_error("Couldn't open $filename for output $!"); |
$r->print(&mt('Problems occurred in writing the csv file. ' |
$r->print(&mt('Problems occurred in writing the CSV file. ' |
.'This error has been logged. ' |
.'This error has been logged. ' |
.'Please alert your LON-CAPA administrator.')); |
.'Please alert your LON-CAPA administrator.')); |
$r->print("<pre>\n".$csvdata."</pre>\n"); |
$r->print("<pre>\n".$csvdata."</pre>\n"); |
Line 1547 sub outsheet_csv {
|
Line 1547 sub outsheet_csv {
|
# Output the body of the spreadsheet |
# Output the body of the spreadsheet |
$self->csv_rows($connection,$file); |
$self->csv_rows($connection,$file); |
# |
# |
# Close the csv file |
# Close the CSV file |
close($file); |
close($file); |
$r->print('<br /><br />'. |
$r->print('<br /><br />'. |
'<a href="'.$filename.'">'.&mt('Your CSV spreadsheet.').'</a>'."\n"); |
'<a href="'.$filename.'">'.&mt('Your CSV spreadsheet.').'</a>'."\n"); |