From 614199d8cd3b1c99c61de5455beb29ec27495147 Mon Sep 17 00:00:00 2001 From: Florent Bruneau Date: Wed, 3 Oct 2007 20:50:54 +0200 Subject: [PATCH] Fix paiement association to event in prompt just before being redirected to the bank site. Signed-off-by: Florent Bruneau --- modules/payment/money.inc.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/modules/payment/money.inc.php b/modules/payment/money.inc.php index a79f03a..4a46fc7 100644 --- a/modules/payment/money.inc.php +++ b/modules/payment/money.inc.php @@ -87,8 +87,14 @@ class Payment function event() { if ($this->asso_id) { - $res = XDB::query("SELECT eid, a.diminutif FROM groupex.evenements AS e, groupex.asso AS a WHERE e.asso_id = {?} AND a.id = {?}", $this->asso_id, $this->asso_id); - return $res->fetchOneAssoc(); + $res = XDB::query("SELECT e.eid, a.diminutif + FROM groupex.evenements AS e + INNER JOIN groupex.asso AS a ON (e.asso_id = a.id) + LEFT JOIN groupex.evenements_participants AS p ON (p.eid = e.eid AND p.uid = {?}) + WHERE e.paiement_id = {?} AND p.uid IS NULL", S::i('uid'), $this->id); + if ($res->numRows()) { + return $res->fetchOneAssoc(); + } } return null; } -- 2.1.4