diff --git a/htdocs/compta/facture/card-rec.php b/htdocs/compta/facture/card-rec.php index 2a15c74c948..aad41d10ec9 100644 --- a/htdocs/compta/facture/card-rec.php +++ b/htdocs/compta/facture/card-rec.php @@ -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); } + // 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; $author = new User($db); @@ -1653,33 +1662,41 @@ if ($action == 'create') { */ print '
'; - if (empty($object->suspended)) { - if ($user->rights->facture->creer) { - if (!empty($object->frequency) && $object->nb_gen_max > 0 && ($object->nb_gen_done >= $object->nb_gen_max)) { - print '
'.$langs->trans("CreateBill").'
'; - } else { - if (empty($object->frequency) || $object->date_when <= $nowlasthour) { - print '
'.$langs->trans("CreateBill").'
'; - } else { - print '
'.$langs->trans("CreateBill").'
'; - } - } - } else { - print '
'.$langs->trans("CreateBill").'
'; - } - } - - if ($user->rights->facture->creer) { + $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)) { - print '
id.'&token='.newToken().'">'.$langs->trans("Disable").'
'; - } else { - print '
id.'&token='.newToken().'">'.$langs->trans("Enable").'
'; + if ($user->rights->facture->creer) { + if (!empty($object->frequency) && $object->nb_gen_max > 0 && ($object->nb_gen_done >= $object->nb_gen_max)) { + print '
' . $langs->trans("CreateBill") . '
'; + } else { + if (empty($object->frequency) || $object->date_when <= $nowlasthour) { + print '
' . $langs->trans("CreateBill") . '
'; + } else { + print '
' . $langs->trans("CreateBill") . '
'; + } + } + } else { + print '
' . $langs->trans("CreateBill") . '
'; + } } + + if ($user->rights->facture->creer) { + if (empty($object->suspended)) { + print '
id.'&token='.newToken().'">'.$langs->trans("Disable").'
'; + } else { + print '
id.'&token='.newToken().'">'.$langs->trans("Enable").'
'; + } + } + + // Delete + print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=delete&token=' . newToken(), 'delete', $user->rights->facture->supprimer); } - - // Delete - print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $user->rights->facture->supprimer); - print '
';