Merge pull request #18260 from FHenry/fix_addhook_addmoractionbutton_productprice

fix: add hook addMoreActionButton product price
This commit is contained in:
Laurent Destailleur 2021-07-28 15:30:37 +02:00 committed by GitHub
commit 8dca7d2b35
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1108,10 +1108,16 @@ print dol_get_fiche_end();
/* /*
* Action bar * Action bar
*/ */
if (!$action || $action == 'delete' || $action == 'showlog_customer_price' || $action == 'showlog_default_price' || $action == 'add_customer_price' 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') { || $action == 'activate_price_by_qty' || $action == 'disable_price_by_qty') {
print "\n".'<div class="tabsAction">'."\n"; print "\n".'<div class="tabsAction">'."\n";
$parameters = array();
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been
if (empty($reshook)) {
if ($object->isVariant()) { if ($object->isVariant()) {
if ($user->rights->produit->creer || $user->rights->service->creer) { if ($user->rights->produit->creer || $user->rights->service->creer) {
print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="' . dol_escape_htmltag($langs->trans("NoEditVariants")) . '">' . $langs->trans("UpdateDefaultPrice") . '</a></div>'; print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="' . dol_escape_htmltag($langs->trans("NoEditVariants")) . '">' . $langs->trans("UpdateDefaultPrice") . '</a></div>';
@ -1139,6 +1145,7 @@ if (!$action || $action == 'delete' || $action == 'showlog_customer_price' || $a
} }
} }
} }
}
print "\n</div>\n"; print "\n</div>\n";
} }