Merge remote branch 'origin/xorg/maint' into xorg/1.0.2/master
[platal.git] / modules / payment.php
index 8f928a5..39f8193 100644 (file)
@@ -334,13 +334,13 @@ class PaymentModule extends PLModule
         echo "Paiement stored.\n";
 
         // We check if it is an Xnet payment and then update the related ML.
-        $res = XDB::query('SELECT  eid
+        $res = XDB::query('SELECT  eid, asso_id
                              FROM  group_events
                             WHERE  paiement_id = {?}', $ref);
         if ($res->numRows() == 1) {
-            $eid = $res->fetchOneCell();
+            list($eid, $asso_id) = $res->fetchOneRow();
             require_once dirname(__FILE__) . '/xnetevents/xnetevents.inc.php';
-            $evt = get_event_detail($eid);
+            $evt = get_event_detail($eid, false, $asso_id);
             subscribe_lists_event($user->id(), $evt, 1, $amount, true);
         }
 
@@ -483,7 +483,7 @@ class PaymentModule extends PLModule
             }
             $res = XDB::query("SELECT  1
                                  FROM  group_events AS e
-                           INNER JOIN  group_event_participants AS ep ON (ep.eid = e.eid AND uid = {?})
+                           INNER JOIN  group_event_participants AS ep ON (ep.eid = e.eid AND e.uid = {?})
                                 WHERE  e.paiement_id = {?} AND e.asso_id = {?}",
                               S::i('uid'), $pid, $globals->asso('id'));
             if ($res->numRows() == 0) {