diff --git a/Layout/default/Voiceplan/Index.php b/Layout/default/Voiceplan/Index.php index 42d7110f7..3325688aa 100644 --- a/Layout/default/Voiceplan/Index.php +++ b/Layout/default/Voiceplan/Index.php @@ -85,6 +85,7 @@ price_multiplicator)?>x create)?> (creator->name?>) + $plan->id])?>"> $plan->id])?>"> $plan->id])?>"> $plan->id])?>" onclick="if(!confirm('Sprachtarifpaket wirklich löschen?')) return false;" class="text-danger" title="Löschen"> diff --git a/Layout/default/Voiceplan/export.pdf.php b/Layout/default/Voiceplan/export.pdf.php new file mode 100644 index 000000000..9ef27d6b7 --- /dev/null +++ b/Layout/default/Voiceplan/export.pdf.php @@ -0,0 +1,77 @@ +setReturnValue([ + 'filename' => "xinon-sprachtarif-uebersicht-".preg_replace("/[^a-z0-9-_]+/i","-", $voiceplan->name).".pdf" +]); +?> + + + + + Xinon Sprachtarifsübersicht <?=$voiceplan->name?> + + + + + + + + + +
+   +
+ +
+ +
+ + +
+ + +
+

Gesprächsgebührenübersicht für den Sprachtarif
name?>

+ increment_first == 1 && $voiceplan->increment == 1): ?> +

Abrechnungstakt: Sekundengenaue Abrechnung

+ +

Abrechnungstakt: increment_first?>/increment?>*

+ + + + + + + + + zones as $zone): ?> + + + + + + + +
ZielPreis pro Minute excl. Ust.Preis pro Minute incl. Ust.
name?>price, 4, ",",".")?>price*1.2, 4, ",",".")?>
+ + increment_first != 1 || $voiceplan->increment != 1): ?> +

* Taktung: Jedes Gespräch wird für volle increment_first?> Gesprächssekunden abgerechnet, darüber hinausgehende Gesprächsdauer in Schritten von increment?> Sekunden.

+ +
+ + + + + \ No newline at end of file diff --git a/application/Voiceplan/VoiceplanController.php b/application/Voiceplan/VoiceplanController.php index f8aa6df17..54f4e221f 100644 --- a/application/Voiceplan/VoiceplanController.php +++ b/application/Voiceplan/VoiceplanController.php @@ -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); + } } \ No newline at end of file