Merge pull request #19415 from OPEN-DSI/new-compta-paiement-form-confirm

NEW add form confirm hook in paiement card
This commit is contained in:
Laurent Destailleur 2021-11-18 20:24:36 +01:00 committed by GitHub
commit 4d78f8fdc2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -802,6 +802,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
dol_print_error($db);
}
$formconfirm = '';
// Save button
if ($action != 'add_paiement') {
@ -840,9 +841,21 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
$text .= '<br>'.$langs->trans("AllCompletelyPayedInvoiceWillBeClosed");
print '<input type="hidden" name="closepaidinvoices" value="'.GETPOST('closepaidinvoices').'">';
}
print $form->formconfirm($_SERVER['PHP_SELF'].'?facid='.$facture->id.'&socid='.$facture->socid.'&type='.$facture->type, $langs->trans('ReceivedCustomersPayments'), $text, 'confirm_paiement', $formquestion, $preselectedchoice);
$formconfirm = $form->formconfirm($_SERVER['PHP_SELF'].'?facid='.$facture->id.'&socid='.$facture->socid.'&type='.$facture->type, $langs->trans('ReceivedCustomersPayments'), $text, 'confirm_paiement', $formquestion, $preselectedchoice);
}
// 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 form confirm
print $formconfirm;
print "</form>\n";
}
}