From e2cdb8f1f653e76c1299476e201262f5431edc1a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 9 Aug 2004 19:33:48 +0000 Subject: [PATCH] =?UTF-8?q?Fix:=20Si=20la=20variable=20FAC=5FPDF=5FLOGO=20?= =?UTF-8?q?est=20d=E9finie=20=E0=20un=20fichier=20logo=20qui=20n'existe=20?= =?UTF-8?q?pas,=20la=20g=E9n=E9ration=20de=20la=20facture=20crabe=20se=20t?= =?UTF-8?q?erminait=20avec=20une=20erreur=20impropre.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/facture/pdf_crabe.modules.php | 28 +++++++++++-------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/htdocs/includes/modules/facture/pdf_crabe.modules.php b/htdocs/includes/modules/facture/pdf_crabe.modules.php index cef9f3b8b45..0e54bf1cb95 100644 --- a/htdocs/includes/modules/facture/pdf_crabe.modules.php +++ b/htdocs/includes/modules/facture/pdf_crabe.modules.php @@ -128,12 +128,6 @@ Class pdf_crabe { $tab_top = 96; $tab_height = 110; - if (defined("FAC_PDF_LOGO")) - { - $pdf->SetXY(10,5); - $pdf->Image(FAC_PDF_LOGO, 10, 5, 0, 24, 'PNG'); - } - $pdf->SetFillColor(220,220,220); $pdf->SetFont('Arial','', 9); $pdf->SetXY (10, $tab_top + 10 ); @@ -498,13 +492,25 @@ Class pdf_crabe { */ function _pagehead(&$pdf, $fac) { + $pdf->SetTextColor(0,0,60); + $pdf->SetFont('Arial','B',13); - $pdf->SetXY(10,5); - if (defined("FAC_PDF_INTITULE")) + $pdf->SetXY(10,6); + + if (defined("FAC_PDF_LOGO") && FAC_PDF_LOGO) { - $pdf->SetTextColor(0,0,60); - $pdf->SetFont('Arial','B',13); - $pdf->MultiCell(70, 8, FAC_PDF_INTITULE, 0, 'L'); + if (file_exists(FAC_PDF_LOGO)) { + $pdf->Image(FAC_PDF_LOGO, 10, 5, 0, 24, 'PNG'); + } + else { + $pdf->SetTextColor(150,0,0); + $pdf->SetFont('Arial','B',10); + $pdf->MultiCell(80, 6, "Logo file '".FAC_PDF_LOGO."' was not found", 0, 'L'); + } + } + else if (defined("FAC_PDF_INTITULE")) + { + $pdf->MultiCell(80, 6, FAC_PDF_INTITULE, 0, 'L'); } $pdf->SetFont('Arial','B',13);