Permalink
Browse files

Fixes to XLS routines that were causing some problems

  • Loading branch information...
moodler
moodler committed Dec 30, 2002
1 parent 86d6449 commit 814ada432cc536b9d35abb4626993e2f1f85632a
Showing with 9 additions and 8 deletions.
  1. +5 −4 course/grades.php
  2. +2 −2 lib/psxlsgen.php
  3. +2 −2 mod/survey/download.php
View
@@ -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",
+ "<A HREF=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</A>
+ -> $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;
View
@@ -139,7 +139,7 @@ function NewLine()
}
// send generated xls as stream file
- function SendFile( $filename )
+ function SendFileName( $filename )
{
$this->filename = $filename;
$this->SendFile();
@@ -171,7 +171,7 @@ function ChangeDefaultDir( $newdir )
}
// Save generated xls file
- function SaveFile( $filename )
+ function SaveFileName( $filename )
{
$this->filename = $filename;
$this->SaveFile();
View
@@ -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

0 comments on commit 814ada4

Please sign in to comment.