Skip to content

Commit

Permalink
Fix can not import any report on any extension in Gradebook - Refs #8050
Browse files Browse the repository at this point in the history
  • Loading branch information
jloguercio committed Feb 10, 2016
1 parent f13a129 commit 66e8840
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
10 changes: 10 additions & 0 deletions main/gradebook/gradebook_flatview.php
Expand Up @@ -228,18 +228,28 @@

switch ($_GET['export_format']) {
case 'xls':
ob_start();
$export = new GradeBookResult();
$export->exportCompleteReportXLS($printable_data);
$content = ob_get_contents();
ob_end_clean();
echo $content;
break;
case 'doc':
ob_start();
$export = new GradeBookResult();
$export->exportCompleteReportDOC($printable_data);
ob_end_clean();
exit;
break;
case 'csv':
default:
ob_start();
$export = new GradeBookResult();
$export->exportCompleteReportCSV($printable_data);
$content = ob_get_contents();
ob_end_clean();
echo $content;
exit;
break;
}
Expand Down
4 changes: 4 additions & 0 deletions main/gradebook/lib/GradebookUtils.php
Expand Up @@ -943,8 +943,12 @@ public static function export_pdf_flatview(
);

$page_format = $params['orientation'] == 'landscape' ? 'A4-L' : 'A4';
ob_start();
$pdf = new PDF($page_format, $page_format, $pdfParams);
$pdf->html_to_pdf_with_template($flatviewtable->return_table());
$content = ob_get_contents();
ob_end_clean();
echo $content;
exit;
}

Expand Down
2 changes: 1 addition & 1 deletion main/gradebook/lib/gradebook_result.class.php
Expand Up @@ -91,7 +91,7 @@ public function exportCompleteReportXLS($data)

//headers
foreach ($data[0] as $header_col) {
$worksheet->SetCellValueByColumnAndRow($line, $column, $header_col);
$worksheet->SetCellValueByColumnAndRow($line, $column, html_entity_decode(strip_tags($header_col)));
$column++;
}
$line++;
Expand Down

0 comments on commit 66e8840

Please sign in to comment.