From 467595ce60a4291f581746088cf2200ebfaa773e Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Thu, 22 Apr 2021 14:53:32 +0200 Subject: [PATCH] an already subscribed attendee will not be redirected to a payment page, now --- htdocs/public/eventorganization/attendee_subscription.php | 8 ++++++-- htdocs/public/payment/paymentok.php | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/htdocs/public/eventorganization/attendee_subscription.php b/htdocs/public/eventorganization/attendee_subscription.php index 1a17f13c2b4..6c069122d65 100644 --- a/htdocs/public/eventorganization/attendee_subscription.php +++ b/htdocs/public/eventorganization/attendee_subscription.php @@ -72,6 +72,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/paymentterm.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; global $dolibarr_main_instance_unique_id; +global $dolibarr_main_url_root; // Init vars $errmsg = ''; @@ -246,7 +247,11 @@ if (empty($reshook) && $action == 'add') { $errmsg .= $confattendee->error; } } - + if($confattendee->status == 1) { + $redirection = $dolibarr_main_url_root.'/public/eventorganization/subscriptionok.php?securekey='.dol_encode($conf->global->EVENTORGANIZATION_SECUREKEY, $dolibarr_main_instance_unique_id); + Header("Location: ".$redirection); + exit; + } // Getting the thirdparty or creating it $thirdparty = new Societe($db); // Fetch using fk_soc of the existing attendee @@ -320,7 +325,6 @@ if (empty($reshook) && $action == 'add') { if (!$error) { $db->commit(); - global $dolibarr_main_url_root; if (!empty(floatval($project->price_registration))) { $productforinvoicerow = new Product($db); $resultprod = $productforinvoicerow->fetch($conf->global->SERVICE_CONFERENCE_ATTENDEE_SUBSCRIPTION); diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php index 27b00fec402..d4946ce0ac7 100644 --- a/htdocs/public/payment/paymentok.php +++ b/htdocs/public/payment/paymentok.php @@ -944,7 +944,7 @@ if ($ispaymentok) { $ispostactionok = -1; } } elseif (array_key_exists('BOO', $tmptag) && $tmptag['BOO'] > 0) { - // BOOTH CASE (to copy and adapt from above) + // @todo BOOTH CASE (to copy and adapt from above) } else { // Nothing done }