From: moodler Date: Mon, 30 Dec 2002 15:46:15 +0000 (+0000) Subject: Fixes to XLS routines that were causing some problems X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=814ada432cc536b9d35abb4626993e2f1f85632a;p=moodle.git Fixes to XLS routines that were causing some problems --- diff --git a/course/grades.php b/course/grades.php index 9a23861062..c329a86bed 100644 --- a/course/grades.php +++ b/course/grades.php @@ -3,9 +3,7 @@ require("../config.php"); require("lib.php"); - require("$CFG->libdir/psxlsgen.php"); - - + require("../lib/psxlsgen.php"); require_variable($id); // course id optional_variable($download, ""); // to download data @@ -29,6 +27,9 @@ /// Get a list of all students if (!$students = get_course_students($course->id)) { + print_header("$course->shortname: $strgrades", "$course->fullname", + "wwwroot/course/view.php?id=$course->id\">$course->shortname + -> $strgrades"); print_heading(get_string("nostudentsyet")); print_footer($course); exit; @@ -131,7 +132,7 @@ $myxls->InsertNumber($totals[$student->id]); } - $myxls->SendFile("$course->shortname $strgrades"); + $myxls->SendFileName("$course->shortname $strgrades"); exit; diff --git a/lib/psxlsgen.php b/lib/psxlsgen.php index e977d9cdbc..45c030166e 100644 --- a/lib/psxlsgen.php +++ b/lib/psxlsgen.php @@ -139,7 +139,7 @@ if( !defined( "PHP_SIMPLE_XLS_GEN" ) ) { } // send generated xls as stream file - function SendFile( $filename ) + function SendFileName( $filename ) { $this->filename = $filename; $this->SendFile(); @@ -171,7 +171,7 @@ if( !defined( "PHP_SIMPLE_XLS_GEN" ) ) { } // Save generated xls file - function SaveFile( $filename ) + function SaveFileName( $filename ) { $this->filename = $filename; $this->SaveFile(); diff --git a/mod/survey/download.php b/mod/survey/download.php index 68063f01af..c400a17719 100644 --- a/mod/survey/download.php +++ b/mod/survey/download.php @@ -161,7 +161,7 @@ } } } - $myxls->SendFile("surveyreport"); + $myxls->SendFileName("$survey->name"); exit; } @@ -171,7 +171,7 @@ // Print header to force download header("Content-Type: application/download\n"); - header("Content-Disposition: attachment; filename=\"$survey->name results.txt\""); + header("Content-Disposition: attachment; filename=\"$survey->name.txt\""); // Print names of all the fields