From cb3104220ed9a7cd5295840c8f32fbd75ebd0c2d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 2 Mar 2012 19:36:43 +0100 Subject: [PATCH] Fix: Instantiate if not already done --- .../core/modules/commande/doc/pdf_edison.modules.php | 10 +++++----- .../core/modules/commande/doc/pdf_einstein.modules.php | 8 ++++---- htdocs/core/modules/facture/doc/pdf_crabe.modules.php | 2 +- htdocs/core/modules/facture/doc/pdf_oursin.modules.php | 4 ++-- htdocs/core/modules/propale/doc/pdf_azur.modules.php | 6 +++--- htdocs/core/modules/propale/doc/pdf_jaune.modules.php | 2 +- .../supplier_invoice/pdf/pdf_canelle.modules.php | 2 +- .../supplier_order/pdf/pdf_muscadet.modules.php | 2 +- 8 files changed, 18 insertions(+), 18 deletions(-) diff --git a/htdocs/core/modules/commande/doc/pdf_edison.modules.php b/htdocs/core/modules/commande/doc/pdf_edison.modules.php index 438fe3307e3..0d0a68086f5 100644 --- a/htdocs/core/modules/commande/doc/pdf_edison.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_edison.modules.php @@ -298,7 +298,7 @@ class pdf_edison extends ModelePDFCommandes $pdf->Output($file,'F'); // Actions on extra fields (by external module or standard code) - if (is_object($hookmanager)) + if (! is_object($hookmanager)) { include_once(DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'); $hookmanager=new HookManager($this->db); @@ -635,7 +635,7 @@ class pdf_edison extends ModelePDFCommandes $pdf->SetXY($posx+2,$posy+4+(dol_nboflines_bis($carac_client_name,50)*4)); $pdf->MultiCell(86,4, $carac_client, 0, 'L'); } - + $curY = 80; $posy=$curY; @@ -647,10 +647,10 @@ class pdf_edison extends ModelePDFCommandes $pdf->MultiCell(100, 4, $outputlangs->transnoentities("Date")." : " . dol_print_date($object->date,'day',false,$outputlangs), 0, 'L'); $pdf->SetXY(11, $posy); $pdf->MultiCell(100, 4, $outputlangs->transnoentities("Order")." ".$outputlangs->convToOutputCharset($object->ref), 0, 'L'); - - + + $posy+=1; - + // Show list of linked objects $posy = pdf_writeLinkedObjects($pdf, $object, $outputlangs, $posx, $posy, 'L', $default_font_size, $hookmanager); } diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index 4ba7bd8ca31..a6dd2189605 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -407,7 +407,7 @@ class pdf_einstein extends ModelePDFCommandes $pdf->Output($file,'F'); // Actions on extra fields (by external module or standard code) - if (is_object($hookmanager)) + if (! is_object($hookmanager)) { include_once(DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'); $hookmanager=new HookManager($this->db); @@ -926,12 +926,12 @@ class pdf_einstein extends ModelePDFCommandes $pdf->SetXY($posx,$posy); $pdf->SetTextColor(0,0,60); $pdf->MultiCell(100, 4, $outputlangs->transnoentities("OrderDate")." : " . dol_print_date($object->date,"%d %b %Y",false,$outputlangs,true), '', 'R'); - + $posy+=2; - + // Show list of linked objects $posy = pdf_writeLinkedObjects($pdf, $object, $outputlangs, $posx, $posy, 'R', $default_font_size, $hookmanager); - + if ($showaddress) { // Sender properties diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 14a450e8491..fc16f446890 100755 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -412,7 +412,7 @@ class pdf_crabe extends ModelePDFFactures $pdf->Output($file,'F'); // Add pdfgeneration hook - if (is_object($hookmanager)) + if (! is_object($hookmanager)) { include_once(DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'); $hookmanager=new HookManager($this->db); diff --git a/htdocs/core/modules/facture/doc/pdf_oursin.modules.php b/htdocs/core/modules/facture/doc/pdf_oursin.modules.php index 07efe8f3a62..d70e2bfea7c 100755 --- a/htdocs/core/modules/facture/doc/pdf_oursin.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_oursin.modules.php @@ -300,7 +300,7 @@ class pdf_oursin extends ModelePDFFactures $pdf->Output($file,'F'); // Actions on extra fields (by external module or standard code) - if (is_object($hookmanager)) + if (! is_object($hookmanager)) { include_once(DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'); $hookmanager=new HookManager($this->db); @@ -1001,7 +1001,7 @@ class pdf_oursin extends ModelePDFFactures } $posy+=1; - + // Show list of linked objects $posy = pdf_writeLinkedObjects($pdf, $object, $outputlangs, $posx, $posy, 'L', $default_font_size, $hookmanager); diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 0208eec114f..c4d4b5cbef9 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -393,7 +393,7 @@ class pdf_azur extends ModelePDFPropales $pdf->Output($file,'F'); // Actions on extra fields (by external module or standard code) - if (is_object($hookmanager)) + if (! is_object($hookmanager)) { include_once(DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'); $hookmanager=new HookManager($this->db); @@ -967,9 +967,9 @@ class pdf_azur extends ModelePDFPropales $pdf->SetTextColor(0,0,60); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("CustomerCode")." : " . $outputlangs->transnoentities($object->client->code_client), '', 'R'); } - + $posy+=2; - + // Show list of linked objects $posy = pdf_writeLinkedObjects($pdf, $object, $outputlangs, $posx, $posy, 'R', $default_font_size, $hookmanager); diff --git a/htdocs/core/modules/propale/doc/pdf_jaune.modules.php b/htdocs/core/modules/propale/doc/pdf_jaune.modules.php index 74df21eb178..6f916f4a470 100644 --- a/htdocs/core/modules/propale/doc/pdf_jaune.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_jaune.modules.php @@ -393,7 +393,7 @@ class pdf_jaune extends ModelePDFPropales $pdf->Output($file,'F'); // Actions on extra fields (by external module or standard code) - if (is_object($hookmanager)) + if (! is_object($hookmanager)) { include_once(DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'); $hookmanager=new HookManager($this->db); 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 ee9599cfeaf..46f3bb96904 100755 --- a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php @@ -398,7 +398,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $pdf->Output($file,'F'); // Actions on extra fields (by external module or standard code) - if (is_object($hookmanager)) + if (! is_object($hookmanager)) { include_once(DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'); $hookmanager=new HookManager($this->db); 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 5cd9ae7ad70..36632cde0bf 100644 --- a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php @@ -406,7 +406,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders // Add pdfgeneration hook - if (is_object($hookmanager)) + if (! is_object($hookmanager)) { include_once(DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'); $hookmanager=new HookManager($this->db);