mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
New hook to allow module show onlinepaymenturl
This commit is contained in:
parent
4d3d0e9240
commit
69289f5005
|
|
@ -2069,6 +2069,14 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||
// Show online payment link
|
||||
$useonlinepayment = (isModEnabled('paypal') || isModEnabled('stripe') || isModEnabled('paybox'));
|
||||
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('doShowOnlinePaymentUrl', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) {
|
||||
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
} else {
|
||||
$useonlinepayment = $reshook;
|
||||
}
|
||||
|
||||
if ($useonlinepayment) {
|
||||
print '<br>';
|
||||
if (empty($amount)) { // Take the maximum amount among what the member is supposed to pay / has paid in the past
|
||||
|
|
|
|||
|
|
@ -825,6 +825,14 @@ if (($action != 'addsubscription' && $action != 'create_thirdparty')) {
|
|||
// Shon online payment link
|
||||
$useonlinepayment = (isModEnabled('paypal') || isModEnabled('stripe') || isModEnabled('paybox'));
|
||||
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('doShowOnlinePaymentUrl', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook > 0) {
|
||||
if (isset($hookmanager->resArray['showonlinepaymenturl'])) {
|
||||
$useonlinepayment = $hookmanager->resArray['showonlinepaymenturl'];
|
||||
}
|
||||
}
|
||||
|
||||
if ($useonlinepayment) {
|
||||
print '<br>';
|
||||
|
||||
|
|
|
|||
|
|
@ -3090,6 +3090,15 @@ if ($action == 'create' && $usercancreate) {
|
|||
|
||||
// Show online payment link
|
||||
$useonlinepayment = (isModEnabled('paypal') || isModEnabled('stripe') || isModEnabled('paybox'));
|
||||
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('doShowOnlinePaymentUrl', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook > 0) {
|
||||
if (isset($hookmanager->resArray['showonlinepaymenturl'])) {
|
||||
$useonlinepayment = $hookmanager->resArray['showonlinepaymenturl'];
|
||||
}
|
||||
}
|
||||
|
||||
if (getDolGlobalString('ORDER_HIDE_ONLINE_PAYMENT_ON_ORDER')) {
|
||||
$useonlinepayment = 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5993,6 +5993,14 @@ if ($action == 'create') {
|
|||
// Show online payment link
|
||||
$useonlinepayment = (isModEnabled('paypal') || isModEnabled('stripe') || isModEnabled('paybox'));
|
||||
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('doShowOnlinePaymentUrl', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook > 0) {
|
||||
if (isset($hookmanager->resArray['showonlinepaymenturl'])) {
|
||||
$useonlinepayment = $hookmanager->resArray['showonlinepaymenturl'];
|
||||
}
|
||||
}
|
||||
|
||||
if ($object->status != Facture::STATUS_DRAFT && $useonlinepayment) {
|
||||
print '<br><!-- Link to pay -->'."\n";
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
|
||||
|
|
|
|||
|
|
@ -1111,7 +1111,7 @@ class pdf_crabe extends ModelePDFFactures
|
|||
protected function _tableau_info(&$pdf, $object, $posy, $outputlangs, $outputlangsbis)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf, $mysoc;
|
||||
global $conf, $mysoc, $hookmanager;
|
||||
|
||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||
|
||||
|
|
@ -1238,6 +1238,13 @@ class pdf_crabe extends ModelePDFFactures
|
|||
if (isModEnabled('paybox')) {
|
||||
$useonlinepayment++;
|
||||
}
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('doShowOnlinePaymentUrl', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook > 0) {
|
||||
if (isset($hookmanager->resArray['showonlinepaymenturl'])) {
|
||||
$useonlinepayment += $hookmanager->resArray['showonlinepaymenturl'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($object->statut != Facture::STATUS_DRAFT && $useonlinepayment) {
|
||||
|
|
|
|||
|
|
@ -1204,7 +1204,7 @@ class pdf_sponge extends ModelePDFFactures
|
|||
*/
|
||||
protected function drawInfoTable(&$pdf, $object, $posy, $outputlangs, $outputlangsbis)
|
||||
{
|
||||
global $conf, $mysoc;
|
||||
global $conf, $mysoc, $hookmanager;
|
||||
|
||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||
|
||||
|
|
@ -1333,6 +1333,13 @@ class pdf_sponge extends ModelePDFFactures
|
|||
if (isModEnabled('paybox')) {
|
||||
$useonlinepayment++;
|
||||
}
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('doShowOnlinePaymentUrl', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook > 0) {
|
||||
if (isset($hookmanager->resArray['showonlinepaymenturl'])) {
|
||||
$useonlinepayment += $hookmanager->resArray['showonlinepaymenturl'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -974,6 +974,14 @@ if (!empty($id) && $action != 'edit') {
|
|||
// Show online payment link
|
||||
$useonlinepayment = (isModEnabled('paypal') || isModEnabled('stripe') || isModEnabled('paybox'));
|
||||
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('doShowOnlinePaymentUrl', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook > 0) {
|
||||
if (isset($hookmanager->resArray['showonlinepaymenturl'])) {
|
||||
$useonlinepayment += $hookmanager->resArray['showonlinepaymenturl'];
|
||||
}
|
||||
}
|
||||
|
||||
if ($useonlinepayment) { //$object->statut != Facture::STATUS_DRAFT &&
|
||||
print '<br><!-- Link to pay -->'."\n";
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user