From 880d763abe6ae151868a34045065ea4a6b51f65e Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Thu, 15 Apr 2021 11:55:28 +0200 Subject: [PATCH] wip on payment page --- .../attendee_subscription.php | 1 - htdocs/public/payment/newpayment.php | 72 ++++++++++--------- 2 files changed, 37 insertions(+), 36 deletions(-) diff --git a/htdocs/public/eventorganization/attendee_subscription.php b/htdocs/public/eventorganization/attendee_subscription.php index 3af50ecd8a2..a40c836f0b3 100644 --- a/htdocs/public/eventorganization/attendee_subscription.php +++ b/htdocs/public/eventorganization/attendee_subscription.php @@ -95,7 +95,6 @@ if ($resultproject < 0) { $error++; $errmsg .= $project->error; } -var_dump($conference->fk_project); // Getting 'securekey'.'id' from Post and decoding it $encodedsecurekeyandid = GETPOST('securekey', 'alpha'); diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index 53b75b0b3a1..9fba38962b4 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -109,6 +109,41 @@ if (!$action) { } } +if ($source == 'conferencesubscription') { + // Finding the Attendee + $attendee = new ConferenceOrBoothAttendee($db); + $result = $attendee->fetch('', $ref); + if ($result <= 0) { + $mesg = $attendee->error; + $error++; + } + $object = $attendee; + + // Finding the thirdparty associated to the Attendee + $thirdparty = new Societe($db); + $resultthirdparty = $thirdparty->fetch($attendee->fk_soc); + if ($resultthirdparty <= 0) { + $mesg = $thirdparty->error; + $error++; + } + + // Finding the conference + $conference = new ConferenceOrBooth($db); + $resultconf = $conference->fetch($attendee->fk_actioncomm); + if ($resultconf <= 0) { + $mesg = $conference->error; + $error++; + } + + // Finding the project + $project = new Project($db); + $resultproj = $project->fetch($conference->fk_project); + if ($resultproj <= 0) { + $mesg = $project->error; + $error++; + } +} + $paymentmethod = GETPOST('paymentmethod', 'alphanohtml') ?GETPOST('paymentmethod', 'alphanohtml') : ''; // Empty in most cases. Defined when a payment mode is forced $validpaymentmethod = array(); @@ -712,6 +747,7 @@ if ($action == 'charge' && !empty($conf->stripe->enabled)) { header("Location: ".$urlko); exit; } else { + $attendee->setStatut(1); header("Location: ".$urlok); exit; } @@ -1728,43 +1764,9 @@ if ($source == 'donation') { } if ($source == 'conferencesubscription') { - // @todo cas paiement de conferenceattendee $found = true; $langs->load("members"); - // Finding the Attendee - $attendee = new ConferenceOrBoothAttendee($db); - $result = $attendee->fetch('', $ref); - if ($result <= 0) { - $mesg = $attendee->error; - $error++; - } - $object = $attendee; - - // Finding the thirdparty associated to the Attendee - $thirdparty = new Societe($db); - $resultthirdparty = $thirdparty->fetch($attendee->fk_soc); - if ($resultthirdparty <= 0) { - $mesg = $thirdparty->error; - $error++; - } - - // Finding the conference - $conference = new ConferenceOrBooth($db); - $resultconf = $conference->fetch($attendee->fk_actioncomm); - if ($resultconf <= 0) { - $mesg = $conference->error; - $error++; - } - - // Finding the project - $project = new Project($db); - $resultproj = $project->fetch($conference->fk_project); - if ($resultproj <= 0) { - $mesg = $project->error; - $error++; - } - if ($action != 'dopayment') { // Do not change amount if we just click on first dopayment $amount = $project->price_registration; if (GETPOST("amount", 'alpha')) { @@ -1804,7 +1806,7 @@ if ($source == 'conferencesubscription') { print ''.$langs->trans("Designation"); print ''.$text; print ''; - print ''; + print ''; print ''."\n"; // Amount