From 91fdb6a569f832a5611ff586af3496e36adf29f9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 3 Nov 2012 13:41:33 +0100 Subject: [PATCH] Fix: Not enought space for free text. To avoid to edit again and again value for all templates, I added an option to be able to fix template onto production when space is not enough. Conflicts: htdocs/core/modules/action/rapport.pdf.php htdocs/core/modules/cheque/pdf/pdf_blochet.class.php htdocs/core/modules/commande/doc/pdf_einstein.modules.php htdocs/core/modules/expedition/doc/pdf_expedition_merou.modules.php htdocs/core/modules/expedition/doc/pdf_expedition_rouget.modules.php htdocs/core/modules/facture/doc/pdf_crabe.modules.php htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php htdocs/core/modules/project/pdf/pdf_baleine.modules.php htdocs/core/modules/propale/doc/pdf_azur.modules.php htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php --- htdocs/core/modules/action/rapport.pdf.php | 5 +++++ htdocs/core/modules/cheque/pdf/pdf_blochet.class.php | 5 +++++ htdocs/core/modules/commande/doc/pdf_einstein.modules.php | 4 ++-- .../modules/expedition/doc/pdf_expedition_merou.modules.php | 4 ++-- .../modules/expedition/doc/pdf_expedition_rouget.modules.php | 4 ++-- htdocs/core/modules/facture/doc/pdf_crabe.modules.php | 4 ++-- htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php | 3 ++- htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php | 4 ++-- htdocs/core/modules/project/pdf/pdf_baleine.modules.php | 4 ++-- htdocs/core/modules/propale/doc/pdf_azur.modules.php | 4 ++-- .../modules/supplier_invoice/pdf/pdf_canelle.modules.php | 4 ++-- .../core/modules/supplier_order/pdf/pdf_muscadet.modules.php | 4 ++-- 12 files changed, 30 insertions(+), 19 deletions(-) diff --git a/htdocs/core/modules/action/rapport.pdf.php b/htdocs/core/modules/action/rapport.pdf.php index de1d1439f0e..7ac590365b3 100644 --- a/htdocs/core/modules/action/rapport.pdf.php +++ b/htdocs/core/modules/action/rapport.pdf.php @@ -114,6 +114,11 @@ class CommActionRapport { $pdf=pdf_getInstance($this->format); + $heightforinfotot = 50; // Height reserved to output the info and total part + $heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page + $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) + $pdf->SetAutoPageBreak(1,0); + if (class_exists('TCPDF')) { $pdf->setPrintHeader(false); diff --git a/htdocs/core/modules/cheque/pdf/pdf_blochet.class.php b/htdocs/core/modules/cheque/pdf/pdf_blochet.class.php index f7e2ac0c54d..675a31304ca 100644 --- a/htdocs/core/modules/cheque/pdf/pdf_blochet.class.php +++ b/htdocs/core/modules/cheque/pdf/pdf_blochet.class.php @@ -119,6 +119,11 @@ class BordereauChequeBlochet extends ModeleChequeReceipts // Create PDF instance $pdf=pdf_getInstance($this->format); + $heightforinfotot = 50; // Height reserved to output the info and total part + $heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page + $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) + $pdf->SetAutoPageBreak(1,0); + if (class_exists('TCPDF')) { $pdf->setPrintHeader(false); diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index f79b056f94a..1d56eb79635 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -187,8 +187,8 @@ class pdf_einstein extends ModelePDFCommandes // Create pdf instance $pdf=pdf_getInstance($this->format); $heightforinfotot = 50; // Height reserved to output the info and total part - $heightforfreetext= 5; // Height reserved to output the free text on last page - $heightforfooter = $this->marge_basse + 10; // Height reserved to output the footer (value include bottom margin) + $heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page + $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) $pdf->SetAutoPageBreak(1,0); if (class_exists('TCPDF')) diff --git a/htdocs/core/modules/expedition/doc/pdf_expedition_merou.modules.php b/htdocs/core/modules/expedition/doc/pdf_expedition_merou.modules.php index 3f866e4a2fd..e65d09453e8 100644 --- a/htdocs/core/modules/expedition/doc/pdf_expedition_merou.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_expedition_merou.modules.php @@ -148,8 +148,8 @@ class pdf_expedition_merou extends ModelePdfExpedition $pdf=pdf_getInstance($this->format,'mm','l'); $heightforinfotot = 0; // Height reserved to output the info and total part - $heightforfreetext= 5; // Height reserved to output the free text on last page - $heightforfooter = $this->marge_basse + 10; // Height reserved to output the footer (value include bottom margin) + $heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page + $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) $pdf->SetAutoPageBreak(1,0); if (class_exists('TCPDF')) diff --git a/htdocs/core/modules/expedition/doc/pdf_expedition_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_expedition_rouget.modules.php index 6799179a7e2..37f3ffc6538 100644 --- a/htdocs/core/modules/expedition/doc/pdf_expedition_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_expedition_rouget.modules.php @@ -134,8 +134,8 @@ class pdf_expedition_rouget extends ModelePdfExpedition $pdf=pdf_getInstance($this->format); $heightforinfotot = 0; // Height reserved to output the info and total part - $heightforfreetext= 5; // Height reserved to output the free text on last page - $heightforfooter = $this->marge_basse + 10; // Height reserved to output the footer (value include bottom margin) + $heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page + $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) $pdf->SetAutoPageBreak(1,0); if (class_exists('TCPDF')) diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 698911a08ee..13e18567271 100755 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -187,8 +187,8 @@ class pdf_crabe extends ModelePDFFactures $pdf=pdf_getInstance($this->format); $heightforinfotot = 50; // Height reserved to output the info and total part - $heightforfreetext= 5; // Height reserved to output the free text on last page - $heightforfooter = $this->marge_basse + 10; // Height reserved to output the footer (value include bottom margin) + $heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page + $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) $pdf->SetAutoPageBreak(1,0); if (class_exists('TCPDF')) diff --git a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php index d4c0768e4a7..3909a78d348 100644 --- a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php +++ b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php @@ -141,7 +141,8 @@ class pdf_soleil extends ModelePDFFicheinter { $pdf=pdf_getInstance($this->format); $heightforinfotot = 50; // Height reserved to output the info and total part - $heightforfooter = 25; // Height reserved to output the footer (value include bottom margin) + $heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:25); // Height reserved to output the free text on last page + $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) $pdf->SetAutoPageBreak(1,0); if (class_exists('TCPDF')) diff --git a/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php b/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php index 9b0b79168b8..420fce5653c 100644 --- a/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php +++ b/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php @@ -151,8 +151,8 @@ class pdf_typhon extends ModelePDFDeliveryOrder { $pdf=pdf_getInstance($this->format); $heightforinfotot = 50; // Height reserved to output the info and total part - $heightforfreetext= 5; // Height reserved to output the free text on last page - $heightforfooter = $this->marge_basse + 10; // Height reserved to output the footer (value include bottom margin) + $heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page + $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) $pdf->SetAutoPageBreak(1,0); if (class_exists('TCPDF')) diff --git a/htdocs/core/modules/project/pdf/pdf_baleine.modules.php b/htdocs/core/modules/project/pdf/pdf_baleine.modules.php index b023097035b..2a9048804c3 100644 --- a/htdocs/core/modules/project/pdf/pdf_baleine.modules.php +++ b/htdocs/core/modules/project/pdf/pdf_baleine.modules.php @@ -128,8 +128,8 @@ class pdf_baleine extends ModelePDFProjects { $pdf=pdf_getInstance($this->format); $heightforinfotot = 50; // Height reserved to output the info and total part - $heightforfreetext= 5; // Height reserved to output the free text on last page - $heightforfooter = $this->marge_basse + 10; // Height reserved to output the footer (value include bottom margin) + $heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page + $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) $pdf->SetAutoPageBreak(1,0); if (class_exists('TCPDF')) diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index ac17210651f..05485e86f73 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -186,8 +186,8 @@ class pdf_azur extends ModelePDFPropales // Create pdf instance $pdf=pdf_getInstance($this->format); $heightforinfotot = 50; // Height reserved to output the info and total part - $heightforfreetext= 5; // Height reserved to output the free text on last page - $heightforfooter = $this->marge_basse + 10; // Height reserved to output the footer (value include bottom margin) + $heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page + $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) $pdf->SetAutoPageBreak(1,0); if (class_exists('TCPDF')) diff --git a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php index f752ffaf6b0..dece24da350 100755 --- a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php @@ -185,8 +185,8 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $pdf=pdf_getInstance($this->format); $heightforinfotot = 50; // Height reserved to output the info and total part - $heightforfreetext= 5; // Height reserved to output the free text on last page - $heightforfooter = $this->marge_basse + 10; // Height reserved to output the footer (value include bottom margin) + $heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page + $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) $pdf->SetAutoPageBreak(1,0); if (class_exists('TCPDF')) diff --git a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php index f686c6508ea..fdc97727658 100644 --- a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php @@ -197,8 +197,8 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $pdf=pdf_getInstance($this->format); $heightforinfotot = 50; // Height reserved to output the info and total part - $heightforfreetext= 5; // Height reserved to output the free text on last page - $heightforfooter = $this->marge_basse + 10; // Height reserved to output the footer (value include bottom margin) + $heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page + $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) $pdf->SetAutoPageBreak(1,0); if (class_exists('TCPDF'))