From 65594d88a0255769f4609fe3268b8baeae0f93ce Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 24 Oct 2012 22:50:19 +0200 Subject: [PATCH 1/5] Fix: strict mode --- htdocs/admin/modules.php | 4 ++-- htdocs/core/boxes/box_members.php | 4 ++-- htdocs/core/modules/modAccounting.class.php | 16 ++++++++++++---- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 917c6cebbef..b8e02fcca21 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -3,7 +3,7 @@ * Copyright (C) 2003 Jean-Louis Bergamo * Copyright (C) 2004-2012 Laurent Destailleur * Copyright (C) 2004 Eric Seigne - * Copyright (C) 2005-2011 Regis Houssin + * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2011 Juanjo Menent * * This program is free software; you can redistribute it and/or modify @@ -268,6 +268,7 @@ $h++; dol_fiche_head($head, $mode, $langs->trans("Modules")); +$var=true; if ($mode != 'marketplace') { @@ -286,7 +287,6 @@ if ($mode != 'marketplace') // Show list of modules - $var=true; $oldfamily=''; $familylib=array( diff --git a/htdocs/core/boxes/box_members.php b/htdocs/core/boxes/box_members.php index ab41c8dbacc..c931b6f7d34 100755 --- a/htdocs/core/boxes/box_members.php +++ b/htdocs/core/boxes/box_members.php @@ -1,7 +1,7 @@ * Copyright (C) 2004-2012 Laurent Destailleur - * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2005-2012 Regis Houssin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -73,7 +73,7 @@ class box_members extends ModeleBoxes if ($user->rights->societe->lire) { - $sql = "SELECT a.rowid, a.nom as lastname, a.prenom as firstname, a.societe, a.fk_soc,"; + $sql = "SELECT a.rowid, a.nom as lastname, a.prenom as firstname, a.societe as company, a.fk_soc,"; $sql.= " a.datec, a.tms, a.statut as status, a.datefin as date_end_subscription,"; $sql.= " t.cotisation"; $sql.= " FROM ".MAIN_DB_PREFIX."adherent as a, ".MAIN_DB_PREFIX."adherent_type as t"; diff --git a/htdocs/core/modules/modAccounting.class.php b/htdocs/core/modules/modAccounting.class.php index 5fbc95f8dc5..dd09fd2756a 100644 --- a/htdocs/core/modules/modAccounting.class.php +++ b/htdocs/core/modules/modAccounting.class.php @@ -1,8 +1,9 @@ - * Copyright (C) 2004-2009 Laurent Destailleur - * Copyright (C) 2004 Sebastien Di Cintio - * Copyright (C) 2004 Benoit Mortier +/* Copyright (C) 2003 Rodolphe Quiedeville + * Copyright (C) 2004-2009 Laurent Destailleur + * Copyright (C) 2004 Sebastien Di Cintio + * Copyright (C) 2004 Benoit Mortier + * Copyright (C) 2005-2012 Regis Houssin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -83,6 +84,7 @@ class modAccounting extends DolibarrModules // Permissions $this->rights = array(); $this->rights_class = 'accounting'; + $r=0; $this->rights[$r][0] = 50401; $this->rights[$r][1] = 'Lire le plan de compte'; @@ -90,6 +92,7 @@ class modAccounting extends DolibarrModules $this->rights[$r][3] = 1; $this->rights[$r][4] = 'plancompte'; $this->rights[$r][5] = 'lire'; + $r++; $this->rights[$r][0] = 50402; $this->rights[$r][1] = 'Creer/modifier un plan de compte'; @@ -97,6 +100,7 @@ class modAccounting extends DolibarrModules $this->rights[$r][3] = 0; $this->rights[$r][4] = 'plancompte'; $this->rights[$r][5] = 'creer'; + $r++; $this->rights[$r][0] = 50403; $this->rights[$r][1] = 'Cloturer plan de compte'; @@ -104,6 +108,7 @@ class modAccounting extends DolibarrModules $this->rights[$r][3] = 0; $this->rights[$r][4] = 'plancompte'; $this->rights[$r][5] = 'cloturer'; + $r++; $this->rights[$r][0] = 50411; $this->rights[$r][1] = 'Lire les mouvements comptables'; @@ -111,6 +116,7 @@ class modAccounting extends DolibarrModules $this->rights[$r][3] = 1; $this->rights[$r][4] = 'mouvements'; $this->rights[$r][5] = 'lire'; + $r++; $this->rights[$r][0] = 50412; $this->rights[$r][1] = 'Creer/modifier/annuler les mouvements comptables'; @@ -118,6 +124,7 @@ class modAccounting extends DolibarrModules $this->rights[$r][3] = 0; $this->rights[$r][4] = 'mouvements'; $this->rights[$r][5] = 'creer'; + $r++; $this->rights[$r][0] = 50415; $this->rights[$r][1] = 'Lire CA, bilans, resultats, journaux, grands livres'; @@ -125,6 +132,7 @@ class modAccounting extends DolibarrModules $this->rights[$r][3] = 0; $this->rights[$r][4] = 'comptarapport'; $this->rights[$r][5] = 'lire'; + $r++; } From 1cbd2a1b1cfe4f480bd347525d55429c91a59ad3 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 25 Oct 2012 08:43:26 +0200 Subject: [PATCH 2/5] Fix: broken feature --- htdocs/core/ajax/saveinplace.php | 16 ++++++++-------- htdocs/fourn/facture/fiche.php | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/htdocs/core/ajax/saveinplace.php b/htdocs/core/ajax/saveinplace.php index da4642c19b8..2854c30f0fa 100644 --- a/htdocs/core/ajax/saveinplace.php +++ b/htdocs/core/ajax/saveinplace.php @@ -66,21 +66,21 @@ if (! empty($field) && ! empty($element) && ! empty($table_element) && ! empty($ $subelement = $regs[2]; } - if ($element == 'propal') $element = 'propale'; - else if ($element == 'fichinter') $element = 'ficheinter'; - else if ($element == 'product') $element = 'produit'; - else if ($element == 'member') $element = 'adherent'; + if ($element == 'propal') $newelement = 'propale'; + else if ($element == 'fichinter') $newelement = 'ficheinter'; + else if ($element == 'product') $newelement = 'produit'; + else if ($element == 'member') $newelement = 'adherent'; else if ($element == 'order_supplier') { - $element = 'fournisseur'; + $newelement = 'fournisseur'; $subelement = 'commande'; } else if ($element == 'invoice_supplier') { - $element = 'fournisseur'; + $newelement = 'fournisseur'; $subelement = 'facture'; } - if (! empty($user->rights->$element->creer) || ! empty($user->rights->$element->write) - || (isset($subelement) && (! empty($user->rights->$element->$subelement->creer) || ! empty($user->rights->$element->$subelement->write))) + if (! empty($user->rights->$newelement->creer) || ! empty($user->rights->$newelement->write) + || (isset($subelement) && (! empty($user->rights->$newelement->$subelement->creer) || ! empty($user->rights->$newelement->$subelement->write))) || ($element == 'payment' && $user->rights->facture->paiement) || ($element == 'payment_supplier' && $user->rights->fournisseur->facture->creer)) { diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php index 9aca380a9fa..4ffc87831f8 100644 --- a/htdocs/fourn/facture/fiche.php +++ b/htdocs/fourn/facture/fiche.php @@ -1522,7 +1522,7 @@ else } // Other options - $parameters=array(); + $parameters=array('colspan' => ' colspan="3"'); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook print ''; @@ -2053,4 +2053,4 @@ else // End of page llxFooter(); $db->close(); -?> \ No newline at end of file +?> From f8f1d3a0df1410566cfcab2faf2961deded823d7 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 25 Oct 2012 09:24:05 +0200 Subject: [PATCH 3/5] Fix: borken feature, add PROPALE_PDF_PAIEMENT_ENABLED for view paiement mode and paiement method in pdf --- htdocs/core/modules/propale/doc/pdf_azur.modules.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 9691c04e307..3fd320a1991 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -525,7 +525,7 @@ class pdf_azur extends ModelePDFPropales } // Show payments conditions - if (isset($object->type) && $object->type != 2 && ($object->cond_reglement_code || $object->cond_reglement)) + if (! empty($conf->global->PROPALE_PDF_PAIEMENT_ENABLED) && ($object->cond_reglement_code || $object->cond_reglement)) { $pdf->SetFont('','B', $default_font_size - 2); $pdf->SetXY($this->marge_gauche, $posy); @@ -542,7 +542,7 @@ class pdf_azur extends ModelePDFPropales } - if (isset($object->type) && $object->type != 2) + if (! empty($conf->global->PROPALE_PDF_PAIEMENT_ENABLED)) { // Check a payment mode is defined if (empty($object->mode_reglement_code) From 144b08cac185759a79179afd2cc37bc95f7e7d07 Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Thu, 25 Oct 2012 11:26:36 +0200 Subject: [PATCH 4/5] fix wrong test for product type in order->getNbProductsLines() also add getNbServicesLines() function in order class. --- htdocs/commande/class/commande.class.php | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 5306e8866be..fe3c9bfd424 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -1521,7 +1521,22 @@ class Commande extends CommonOrder $nb=0; foreach($this->lines as $line) { - if ($line->fk_product_type == 0) $nb++; + if ($line->product_type == 0) $nb++; + } + return $nb; + } + + /** + * Return number of line with type service. + * + * @return int <0 if KO, Nbr of service lines if OK + */ + function getNbOfServicesLines() + { + $nb=0; + foreach($this->lines as $line) + { + if ($line->product_type == 1) $nb++; } return $nb; } From 9d95e8bffbf59d277bec9c723a1c9a7ba8a3ca38 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 25 Oct 2012 11:41:55 +0200 Subject: [PATCH 5/5] Fix: missing hookmanager --- htdocs/core/class/html.form.class.php | 2 +- .../modules_facturefournisseur.php | 5 +++-- .../pdf/pdf_canelle.modules.php | 19 +++++++++++++------ .../modules_commandefournisseur.php | 7 ++++--- .../pdf/pdf_muscadet.modules.php | 15 ++++++++++----- htdocs/fourn/commande/fiche.php | 14 +++++++------- htdocs/fourn/facture/fiche.php | 6 +++--- 7 files changed, 41 insertions(+), 27 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 32f76d60eeb..d3e80221e12 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -89,7 +89,7 @@ class Form // TODO change for compatibility if (! empty($conf->global->MAIN_USE_JQUERY_JEDITABLE) && ! preg_match('/^select;/',$typeofdata)) { - if ($perm) + if (! empty($perm)) { $tmp=explode(':',$typeofdata); $ret.= '
'; diff --git a/htdocs/core/modules/supplier_invoice/modules_facturefournisseur.php b/htdocs/core/modules/supplier_invoice/modules_facturefournisseur.php index fdcddaf6df1..cc31c234d49 100755 --- a/htdocs/core/modules/supplier_invoice/modules_facturefournisseur.php +++ b/htdocs/core/modules/supplier_invoice/modules_facturefournisseur.php @@ -65,9 +65,10 @@ abstract class ModelePDFSuppliersInvoices extends CommonDocGenerator * @param int $hidedetails Hide details of lines * @param int $hidedesc Hide description * @param int $hideref Hide ref + * @param HookManager $hookmanager Hook manager instance * @return int 0 if KO, 1 if OK */ -function supplier_invoice_pdf_create($db, $object, $modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0) +function supplier_invoice_pdf_create($db, $object, $modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0, $hookmanager=false) { global $conf, $user, $langs; @@ -136,7 +137,7 @@ function supplier_invoice_pdf_create($db, $object, $modele, $outputlangs, $hided // We save charset_output to restore it because write_file can change it if needed for // output format that does not support UTF8. $sav_charset_output=$outputlangs->charset_output; - if ($obj->write_file($object, $outputlangs, $srctemplatepath, $hidedetails, $hidedesc) > 0) + if ($obj->write_file($object, $outputlangs, $srctemplatepath, $hidedetails, $hidedesc, $hideref, $hookmanager) > 0) { $outputlangs->charset_output=$sav_charset_output; 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 2ccbdf031ff..71d385f7786 100755 --- a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php @@ -132,7 +132,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices * @param object $hookmanager Hookmanager object * @return int 1=OK, 0=KO */ - function write_file($object,$outputlangs='',$srctemplatepath='',$hidedetails=0,$hidedesc=0,$hideref=0,$hookmanager=false) + function write_file($object, $outputlangs='', $srctemplatepath='', $hidedetails=0, $hidedesc=0, $hideref=0, $hookmanager=false) { global $user,$langs,$conf,$mysoc; @@ -284,10 +284,10 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $pdf->setTopMargin($this->marge_haute); $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. -// We suppose that a too long description is moved completely on next page -if ($pageposafter > $pageposbefore) { - $pdf->setPage($pageposafter); $curY = $tab_top_newpage; -} + // We suppose that a too long description is moved completely on next page + if ($pageposafter > $pageposbefore) { + $pdf->setPage($pageposafter); $curY = $tab_top_newpage; + } $pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut @@ -809,9 +809,10 @@ if ($pageposafter > $pageposbefore) { * @param Object $object Object to show * @param int $showaddress 0=no, 1=yes * @param Translate $outputlangs Object lang for output + * @param object $hookmanager Hookmanager object * @return void */ - function _pagehead(&$pdf, $object, $showaddress, $outputlangs) + function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $hookmanager) { global $langs,$conf,$mysoc; @@ -887,6 +888,12 @@ if ($pageposafter > $pageposbefore) { $pdf->MultiCell(100, 4, strtolower($outputlangs->transnoentities("OrderToProcess")), '', 'R'); } + $posy+=2; + $pdf->SetTextColor(0,0,60); + + // Show list of linked objects + $posy = pdf_writeLinkedObjects($pdf, $object, $outputlangs, $posx, $posy, 100, 3, 'R', $default_font_size, $hookmanager); + if ($showaddress) { // Sender properties diff --git a/htdocs/core/modules/supplier_order/modules_commandefournisseur.php b/htdocs/core/modules/supplier_order/modules_commandefournisseur.php index 7c437a751cd..e7b7a1ad8f8 100644 --- a/htdocs/core/modules/supplier_order/modules_commandefournisseur.php +++ b/htdocs/core/modules/supplier_order/modules_commandefournisseur.php @@ -147,9 +147,10 @@ abstract class ModeleNumRefSuppliersOrders * @param int $hidedetails Hide details of lines * @param int $hidedesc Hide description * @param int $hideref Hide ref + * @param HookManager $hookmanager Hook manager instance * @return int 0 if KO, 1 if OK */ -function supplier_order_pdf_create($db, $object, $modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0) +function supplier_order_pdf_create($db, $object, $modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0, $hookmanager=false) { global $conf, $user, $langs; $langs->load("suppliers"); @@ -217,14 +218,14 @@ function supplier_order_pdf_create($db, $object, $modele, $outputlangs, $hidedet // We save charset_output to restore it because write_file can change it if needed for // output format that does not support UTF8. $sav_charset_output=$outputlangs->charset_output; - if ($obj->write_file($object, $outputlangs, $srctemplatepath, $hidedetails, $hidedesc) > 0) + if ($obj->write_file($object, $outputlangs, $srctemplatepath, $hidedetails, $hidedesc, $hideref, $hookmanager) > 0) { $outputlangs->charset_output=$sav_charset_output; // we delete preview files require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; dol_delete_preview($object); - + // Appel des triggers include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; $interface=new Interfaces($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 1644955bfd4..64e3b4024f6 100644 --- a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php @@ -296,10 +296,10 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $pdf->setTopMargin($this->marge_haute); $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. -// We suppose that a too long description is moved completely on next page -if ($pageposafter > $pageposbefore) { - $pdf->setPage($pageposafter); $curY = $tab_top_newpage; -} + // We suppose that a too long description is moved completely on next page + if ($pageposafter > $pageposbefore) { + $pdf->setPage($pageposafter); $curY = $tab_top_newpage; + } $pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut @@ -908,9 +908,10 @@ if ($pageposafter > $pageposbefore) { * @param Object $object Object to show * @param int $showaddress 0=no, 1=yes * @param Translate $outputlangs Object lang for output + * @param object $hookmanager Hookmanager object * @return void */ - function _pagehead(&$pdf, $object, $showaddress, $outputlangs) + function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $hookmanager) { global $langs,$conf,$mysoc; @@ -992,6 +993,10 @@ if ($pageposafter > $pageposbefore) { } $posy+=2; + $pdf->SetTextColor(0,0,60); + + // Show list of linked objects + $posy = pdf_writeLinkedObjects($pdf, $object, $outputlangs, $posx, $posy, 100, 3, 'R', $default_font_size, $hookmanager); if ($showaddress) { diff --git a/htdocs/fourn/commande/fiche.php b/htdocs/fourn/commande/fiche.php index 937e2156561..26203b23027 100644 --- a/htdocs/fourn/commande/fiche.php +++ b/htdocs/fourn/commande/fiche.php @@ -307,7 +307,7 @@ else if ($action == 'addline' && $user->rights->fournisseur->commande->creer) } $ret=$object->fetch($id); // Reload to get new records - supplier_order_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); + supplier_order_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref, $hookmanager); } unset($_POST['qty']); unset($_POST['type']); @@ -369,7 +369,7 @@ else if ($action == 'updateligne' && $user->rights->fournisseur->commande->creer if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { $ret=$object->fetch($id); // Reload to get new records - supplier_order_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); + supplier_order_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref, $hookmanager); } } else @@ -395,7 +395,7 @@ else if ($action == 'confirm_deleteproductline' && $confirm == 'yes' && $user->r if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { $ret=$object->fetch($id); // Reload to get new records - supplier_order_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); + supplier_order_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref, $hookmanager); } } else @@ -429,7 +429,7 @@ else if ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->fourn if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { $ret=$object->fetch($id); // Reload to get new records - supplier_order_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); + supplier_order_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref, $hookmanager); } } else @@ -582,7 +582,7 @@ else if ($action == 'up' && $user->rights->fournisseur->commande->creer) $outputlangs = new Translate("",$conf); $outputlangs->setDefaultLang($_REQUEST['lang_id']); } - if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) supplier_order_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); + if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) supplier_order_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref, $hookmanager); header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id.(empty($conf->global->MAIN_JUMP_TAG)?'':'#'.$_GET['rowid'])); exit; } @@ -597,7 +597,7 @@ else if ($action == 'down' && $user->rights->fournisseur->commande->creer) $outputlangs = new Translate("",$conf); $outputlangs->setDefaultLang($_REQUEST['lang_id']); } - if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) supplier_order_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); + if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) supplier_order_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref, $hookmanager); header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id.(empty($conf->global->MAIN_JUMP_TAG)?'':'#'.$_GET['rowid'])); exit; } @@ -621,7 +621,7 @@ else if ($action == 'builddoc' && $user->rights->fournisseur->commande->creer) / $outputlangs = new Translate("",$conf); $outputlangs->setDefaultLang($_REQUEST['lang_id']); } - $result=supplier_order_pdf_create($db, $object,$object->modelpdf,$outputlangs, $hidedetails, $hidedesc, $hideref); + $result=supplier_order_pdf_create($db, $object,$object->modelpdf,$outputlangs, $hidedetails, $hidedesc, $hideref, $hookmanager); if ($result <= 0) { dol_print_error($db,$result); diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php index 4ffc87831f8..9f9a90333b3 100644 --- a/htdocs/fourn/facture/fiche.php +++ b/htdocs/fourn/facture/fiche.php @@ -542,7 +542,7 @@ elseif ($action == 'addline') $outputlangs = new Translate("",$conf); $outputlangs->setDefaultLang($newlang); } - //if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) supplier_invoice_pdf_create($db, $object->id, $object->modelpdf, $outputlangs); + //if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) supplier_invoice_pdf_create($db, $object->id, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref, $hookmanager); unset($_POST['qty']); unset($_POST['type']); @@ -593,7 +593,7 @@ elseif ($action == 'edit' && $user->rights->fournisseur->facture->creer) $outputlangs = new Translate("",$conf); $outputlangs->setDefaultLang($_REQUEST['lang_id']); } - //if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) supplier_invoice_pdf_create($db, $object->id, $object->modelpdf, $outputlangs); + //if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) supplier_invoice_pdf_create($db, $object->id, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref, $hookmanager); } } @@ -817,7 +817,7 @@ elseif ($action == 'builddoc') $outputlangs = new Translate("",$conf); $outputlangs->setDefaultLang($_REQUEST['lang_id']); } - $result=supplier_invoice_pdf_create($db,$object,$object->modelpdf,$outputlangs); + $result=supplier_invoice_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref, $hookmanager); if ($result <= 0) { dol_print_error($db,$result);