From 765893f9e6afff8617e8cf89a2b85410005cee5e Mon Sep 17 00:00:00 2001 From: abb Date: Sun, 21 Feb 2021 18:25:45 +0100 Subject: [PATCH 1/2] new:hook doActions for subscriptions with possibility to modify values of variables $datefrom,$dateto,$paymentdate inside hook --- htdocs/adherents/subscription.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php index a00c52b88e5..2a366ba0705 100644 --- a/htdocs/adherents/subscription.php +++ b/htdocs/adherents/subscription.php @@ -111,6 +111,13 @@ $hideref = (GETPOST('hideref', 'int') ? GETPOST('hideref', 'int') : (!empty($con * Actions */ +$datefrom = 0; +$dateto = 0; +$paymentdate = -1; + +$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); +if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + // Create third party from a member if ($action == 'confirm_create_thirdparty' && $confirm == 'yes' && $user->rights->societe->creer) { if ($result > 0) { @@ -826,9 +833,6 @@ if ($rowid > 0) { print ''; $today = dol_now(); - $datefrom = 0; - $dateto = 0; - $paymentdate = -1; // Date payment if (GETPOST('paymentyear') && GETPOST('paymentmonth') && GETPOST('paymentday')) { From b4e301893c9777c0a6e50e09e212a8020ff05535 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 22 Feb 2021 11:22:48 +0100 Subject: [PATCH 2/2] Update subscription.php --- htdocs/adherents/subscription.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php index 2a366ba0705..a532c8c7e55 100644 --- a/htdocs/adherents/subscription.php +++ b/htdocs/adherents/subscription.php @@ -106,15 +106,15 @@ $hidedetails = (GETPOST('hidedetails', 'int') ? GETPOST('hidedetails', 'int') : $hidedesc = (GETPOST('hidedesc', 'int') ? GETPOST('hidedesc', 'int') : (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC) ? 1 : 0)); $hideref = (GETPOST('hideref', 'int') ? GETPOST('hideref', 'int') : (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF) ? 1 : 0)); +$datefrom = 0; +$dateto = 0; +$paymentdate = -1; + /* * Actions */ -$datefrom = 0; -$dateto = 0; -$paymentdate = -1; - $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');