diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php index 9e34f4ba39fb5..9c32e49b2259d 100644 --- a/htdocs/core/tpl/objectline_view.tpl.php +++ b/htdocs/core/tpl/objectline_view.tpl.php @@ -124,6 +124,12 @@
$line, 'i' =>& $i, 'coldisplay' =>& $coldisplay]; +$reshook = $hookmanager->executeHooks('objectLineView_BeforeProduct', $parameters, $object, $action); // Note that $action and $object may have been modified by hook +print $hookmanager->resPrint; + if (($line->info_bits & 2) == 2) { print ''; $txt = ''; @@ -265,8 +271,12 @@ } } + + $parameters = ['line' => $line, 'i' =>& $i, 'coldisplay' =>& $coldisplay]; + $reshook = $hookmanager->executeHooks('objectLineView_BeforeProductExtrafield', $parameters, $object, $action); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; // Line extrafield - if (!empty($extrafields)) { + if (!empty($extrafields) && empty($reshook)) { $temps = $line->showOptionals($extrafields, 'view', array(), '', '', 1, 'line'); if (!empty($temps)) { print '
'; @@ -276,19 +286,29 @@ } } -if ($user->hasRight('fournisseur', 'lire') && isset($line->fk_fournprice) && $line->fk_fournprice > 0 && !getDolGlobalString('SUPPLIER_HIDE_SUPPLIER_OBJECTLINES')) { - require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php'; - $productfourn = new ProductFournisseur($this->db); - $productfourn->fetch_product_fournisseur_price($line->fk_fournprice); - print '
'; - print ''.$langs->trans('Supplier').' : '.$productfourn->getSocNomUrl(1, 'supplier').' - '.$langs->trans('Ref').' : '; - // Supplier ref - if ($user->hasRight('produit', 'creer') || $user->hasRight('service', 'creer')) { // change required right here - print $productfourn->getNomUrl(); - } else { - print $productfourn->ref_supplier; + + + $parameters = ['line' => $line, 'i' =>& $i, 'coldisplay' =>& $coldisplay]; + $reshook = $hookmanager->executeHooks('objectLineView_ProductSupplier', $parameters, $object, $action); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + if (empty($reshook)) { + if ($user->hasRight('fournisseur', 'lire') && isset($line->fk_fournprice) && $line->fk_fournprice > 0 && !getDolGlobalString('SUPPLIER_HIDE_SUPPLIER_OBJECTLINES')) { + require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php'; + $productfourn = new ProductFournisseur($this->db); + $productfourn->fetch_product_fournisseur_price($line->fk_fournprice); + print '
'; + print ''.$langs->trans('Supplier').' : '.$productfourn->getSocNomUrl(1, 'supplier').' - '.$langs->trans('Ref').' : '; + // Supplier ref + if ($user->hasRight('produit', 'creer') || $user->hasRight('service', 'creer')) { // change required right here + print $productfourn->getNomUrl(); + } else { + print $productfourn->ref_supplier; + } + } } -} + + + if (isModEnabled('accounting') && !empty($line->fk_accounting_account) && $line->fk_accounting_account > 0) { $accountingaccount = new AccountingAccount($this->db);