diff --git a/htdocs/public/onlinesign/newonlinesign.php b/htdocs/public/onlinesign/newonlinesign.php index c47bbd7f734..cd793a91bfc 100644 --- a/htdocs/public/onlinesign/newonlinesign.php +++ b/htdocs/public/onlinesign/newonlinesign.php @@ -2,6 +2,7 @@ /* Copyright (C) 2001-2002 Rodolphe Quiedeville * Copyright (C) 2006-2017 Laurent Destailleur * Copyright (C) 2009-2012 Regis Houssin + * Copyright (C) 2023 anthony Berton * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -156,6 +157,8 @@ if ($source == 'proposal') { httponly_accessforbidden($langs->trans('ErrorBadParameters')." - Bad value for source", 400, 1); } +// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +$hookmanager->initHooks(array('onlinesign')); /* * Actions @@ -346,10 +349,21 @@ if ($source == 'proposal') { print ''."\n"; // Amount - print ''.$langs->trans("Amount"); - print ''; - print ''.price($object->total_ttc, 0, $langs, 1, -1, -1, $conf->currency).''; - print ''."\n"; + $amount = ''.$langs->trans("Amount"); + $amount .= ''; + $amount .= ''.price($object->total_ttc, 0, $langs, 1, -1, -1, $conf->currency).''; + $amount .= ''."\n"; + + // Call Hook amountPropalSign + $parameters = array('source' => $source); + $reshook = $hookmanager->executeHooks('amountPropalSign', $parameters, $object, $action); // Note that $action and $object may have been modified by hook + if (empty($reshook)) { + $amount .= $hookmanager->resPrint; + } elseif ($reshook > 0) { + $amount = $hookmanager->resPrint; + } + + print $amount; // Object $text = ''.$langs->trans("SignatureProposalRef", $object->ref).''; @@ -457,6 +471,7 @@ if ($source == 'proposal') { $langs->load("fichinter"); $result = $object->fetch_thirdparty($object->socid); + // Proposer print ''.$langs->trans("Proposer"); print ''; @@ -496,13 +511,14 @@ if ($source == 'proposal') { print $langs->trans("DownloadDocument").''; } } - - print ''; print ''; print ''."\n"; } +// Call Hook addFormSign +$parameters = array('source' => $source); +$reshook = $hookmanager->executeHooks('addFormSign', $parameters, $object, $action); // Note that $action and $object may have been modified by hook if (!$found && !$mesg) { $mesg = $langs->transnoentitiesnoconv("ErrorBadParameters");