From 84d221988f777bced8372e3f486d6217e79658d8 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Wed, 28 Jul 2021 11:17:07 +0200 Subject: [PATCH] fix: add hook addMoreActionButton product price --- htdocs/product/price.php | 45 +++++++++++++++++++++++----------------- 1 file changed, 26 insertions(+), 19 deletions(-) diff --git a/htdocs/product/price.php b/htdocs/product/price.php index aad0311502d..bb46839e588 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -1108,34 +1108,41 @@ print dol_get_fiche_end(); /* * Action bar */ + + if (!$action || $action == 'delete' || $action == 'showlog_customer_price' || $action == 'showlog_default_price' || $action == 'add_customer_price' || $action == 'activate_price_by_qty' || $action == 'disable_price_by_qty') { print "\n".'
'."\n"; - if ($object->isVariant()) { - if ($user->rights->produit->creer || $user->rights->service->creer) { - print ''; - } - } else { - if (empty($conf->global->PRODUIT_MULTIPRICES) && empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) { - if ($user->rights->produit->creer || $user->rights->service->creer) { - print ''; - } - } - if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { + $parameters = array(); + $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been + if (empty($reshook)) { + if ($object->isVariant()) { if ($user->rights->produit->creer || $user->rights->service->creer) { - print ''; + print ''; } - } - - if (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) { - if ($user->rights->produit->creer || $user->rights->service->creer) { - print ''; + } else { + if (empty($conf->global->PRODUIT_MULTIPRICES) && empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) { + if ($user->rights->produit->creer || $user->rights->service->creer) { + print ''; + } } - if ($user->rights->produit->creer || $user->rights->service->creer) { - print ''; + if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { + if ($user->rights->produit->creer || $user->rights->service->creer) { + print ''; + } + } + + if (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) { + if ($user->rights->produit->creer || $user->rights->service->creer) { + print ''; + } + + if ($user->rights->produit->creer || $user->rights->service->creer) { + print ''; + } } } }