Merge pull request #22972 from jtraulle/hooks-facture-rec

New Add hooks addMoreActionsButtons and formConfirm to card-rec.php
This commit is contained in:
Laurent Destailleur 2022-11-26 00:54:08 +01:00 committed by GitHub
commit 543e80128a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1177,6 +1177,15 @@ if ($action == 'create') {
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteRepeatableInvoice'), $langs->trans('ConfirmDeleteRepeatableInvoice'), 'confirm_deleteinvoice', '', 'no', 1); $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteRepeatableInvoice'), $langs->trans('ConfirmDeleteRepeatableInvoice'), 'confirm_deleteinvoice', '', 'no', 1);
} }
// Call Hook formConfirm
$parameters = array('formConfirm' => $formconfirm);
$reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
if (empty($reshook)) {
$formconfirm .= $hookmanager->resPrint;
} elseif ($reshook > 0) {
$formconfirm = $hookmanager->resPrint;
}
print $formconfirm; print $formconfirm;
$author = new User($db); $author = new User($db);
@ -1653,6 +1662,14 @@ if ($action == 'create') {
*/ */
print '<div class="tabsAction">'; print '<div class="tabsAction">';
$parameters = array();
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
if (empty($reshook)) {
$params = array(
'attr' => array(
'class' => 'classfortooltip',
),
);
if (empty($object->suspended)) { if (empty($object->suspended)) {
if ($user->rights->facture->creer) { if ($user->rights->facture->creer) {
if (!empty($object->frequency) && $object->nb_gen_max > 0 && ($object->nb_gen_done >= $object->nb_gen_max)) { if (!empty($object->frequency) && $object->nb_gen_max > 0 && ($object->nb_gen_done >= $object->nb_gen_max)) {
@ -1679,7 +1696,7 @@ if ($action == 'create') {
// Delete // Delete
print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=delete&token=' . newToken(), 'delete', $user->rights->facture->supprimer); print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=delete&token=' . newToken(), 'delete', $user->rights->facture->supprimer);
}
print '</div>'; print '</div>';