From 32f9e2b6c7b27fc8e75f5f51d5dd828449879381 Mon Sep 17 00:00:00 2001 From: chris Date: Fri, 21 Mar 2025 12:25:07 +0100 Subject: [PATCH] Fix directory permission problems with pdf output. --- pdf/ausist_pdf.php | 8 +------- pdf/aussoll_pdf.php | 8 +------- pdf/einist_pdf.php | 7 +------ pdf/einsoll_pdf.php | 8 +------- 4 files changed, 4 insertions(+), 27 deletions(-) diff --git a/pdf/ausist_pdf.php b/pdf/ausist_pdf.php index 1a01173..59e91eb 100644 --- a/pdf/ausist_pdf.php +++ b/pdf/ausist_pdf.php @@ -246,10 +246,4 @@ $pdf->Cell(25, 4, number_format(($_19_MwSt + $_7_MwSt + $Sonst_MwSt), '2', ',', $pdf->SetFont('Helvetica','', 10); $pdf->Cell(25, 4, number_format(($_19 + $_7 + $_0 + $Sonst_Preis + $_19_MwSt + $_7_MwSt + $Sonst_MwSt), '2', ',', '.')." €", 0, 0, 'R'); -if(!is_dir(__DIR__ . "/" . PREFIX . "/eur")) -{ - mkdir(__DIR__ . "/" . PREFIX . "/eur", 0777, true); -} - -$file = __DIR__ . "/" . PREFIX . "/eur/A_" . date('Ymd') . ".pdf"; -$pdf->Output($file, "F"); \ No newline at end of file +$pdf->Output("A_" . date('Ymd') . ".pdf", "I"); \ No newline at end of file diff --git a/pdf/aussoll_pdf.php b/pdf/aussoll_pdf.php index fcf50b5..04d2104 100644 --- a/pdf/aussoll_pdf.php +++ b/pdf/aussoll_pdf.php @@ -170,10 +170,4 @@ $pdf->Cell(25, 4, number_format(($_19_MwSt + $_7_MwSt + $Sonst_MwSt), '2', ',', $pdf->SetFont('Helvetica','', 10); $pdf->Cell(25, 4, number_format(($_19 + $_7 + $_0 + $Sonst_Preis + $_19_MwSt + $_7_MwSt + $Sonst_MwSt), '2', ',', '.')." €", 0, 0, 'R'); -if(!is_dir(__DIR__ . "/" . PREFIX . "/eur")) -{ - mkdir(__DIR__ . "/" . PREFIX . "/eur", 0777, true); -} - -$file = __DIR__ . "/" . PREFIX . "/eur/A_" . date('Ymd') . ".pdf"; -$pdf->Output($file, "F"); \ No newline at end of file +$pdf->Output("A_" . date('Ymd') . ".pdf", "I"); \ No newline at end of file diff --git a/pdf/einist_pdf.php b/pdf/einist_pdf.php index ae87bae..64a70d2 100644 --- a/pdf/einist_pdf.php +++ b/pdf/einist_pdf.php @@ -152,10 +152,5 @@ $pdf->Cell(25, 4, number_format($ntsum['MwSt'], '2', ',', '.') . " €", 0, 0, ' $pdf->SetFont('Helvetica', '', 10); $pdf->Cell(25, 4, number_format($ntsum['Gesamt'], '2', ',', '.') . " €", 0, 1, 'R'); -if(!is_dir(__DIR__ . "/" . PREFIX . "/eur")) -{ - mkdir(__DIR__ . "/" . PREFIX . "/eur", 0777, true); -} - $file = __DIR__ . "/" . PREFIX . "/eur/E_" . date('Ymd') . ".pdf"; -$pdf->Output($file, "F"); \ No newline at end of file +$pdf->Output("E_" . date('Ymd') . ".pdf", "I"); \ No newline at end of file diff --git a/pdf/einsoll_pdf.php b/pdf/einsoll_pdf.php index c160e23..c293b4f 100644 --- a/pdf/einsoll_pdf.php +++ b/pdf/einsoll_pdf.php @@ -150,10 +150,4 @@ $pdf->Cell(25, 4, number_format($ntsum['MwSt'], '2', ',', '.') . " €", 0, 0, ' $pdf->SetFont('Helvetica', '', 10); $pdf->Cell(25, 4, number_format($ntsum['Gesamt'], '2', ',', '.') . " €", 0, 1, 'R'); -if(!is_dir(__DIR__ . "/" . PREFIX . "/eur")) -{ - mkdir(__DIR__ . "/" . PREFIX . "/eur", 0777, true); -} - -$file = __DIR__ . "/" . PREFIX . "/eur/E_" . date('Ymd') . ".pdf"; -$pdf->Output($file, "F"); \ No newline at end of file +$pdf->Output("E_" . date('Ymd') . ".pdf", "I"); \ No newline at end of file