Added Voiceplan PDF export
This commit is contained in:
@@ -297,4 +297,25 @@ class VoiceplanController extends mfBaseController {
|
||||
$this->redirect("Voiceplan", "Index");
|
||||
|
||||
}
|
||||
|
||||
protected function downloadPdf() {
|
||||
$this->layout()->setTemplate("Voiceplan/export.pdf");
|
||||
|
||||
$voiceplan = new Voiceplan($this->request->id);
|
||||
if(!$voiceplan->id) {
|
||||
$this->layout()->setFlash("Sprachtarif nicht gefunden", "error");
|
||||
$this->redirect("Voiceplan", "Index");
|
||||
}
|
||||
|
||||
$pdf_vars = [
|
||||
"voiceplan" => $voiceplan,
|
||||
];
|
||||
|
||||
$pdf = new PdfForm("Voiceplan/export.pdf", $pdf_vars);
|
||||
$title = "Xinon Sprachtarif ".$voiceplan->name;
|
||||
$pdf->render("--footer-center '$title Seite [page] / [topage]' --footer-font-name OpenSans --footer-font-size 9");
|
||||
$tvalue = $pdf->getReturnedValues();
|
||||
$pdfname = $tvalue['filename'];
|
||||
$pdf->download($pdfname);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user