Fix listing of xnetevent participants.
[platal.git] / modules / xnetevents / xnetevents.inc.php
index 5c0a868..237e3f7 100644 (file)
@@ -90,8 +90,8 @@ function get_event_detail($eid, $item_id = false, $asso_id = null)
         $evt['notify_payment'] = $evt['notify_payment'] || $m['notify_payment'];
     }
 
-    $montants = XDB::fetchColumn('SELECT  montant
-                                    FROM  ' . $globals->money->mpay_tprefix . 'transactions AS t
+    $montants = XDB::fetchColumn('SELECT  amount
+                                    FROM  payment_transactions AS t
                                    WHERE  ref = {?} AND uid = {?}',
                                    $evt['paiement_id'], S::v('uid'));
     $evt['telepaid'] = 0;
@@ -109,7 +109,7 @@ function get_event_detail($eid, $item_id = false, $asso_id = null)
 // }}}
 
 // {{{ function get_event_participants()
-function get_event_participants(&$evt, $item_id, array $tri = array(), $count = null, $offset = null)
+function get_event_participants(&$evt, $item_id, array $tri = array(), $limit = null)
 {
     global $globals;
 
@@ -124,7 +124,7 @@ function get_event_participants(&$evt, $item_id, array $tri = array(), $count =
                                          WHERE  ep.eid = {?} AND nb > 0 ' . $append . '
                                       GROUP BY  ep.uid', $eid);
     $uf = new UserFilter(new PFC_True(), $tri);
-    $users = User::getBulkUsersWithUIDs($uf->filter(array_keys($query), $count, $offset));
+    $users = User::getBulkUsersWithUIDs($uf->filter(array_keys($query), $limit));
     $tab = array();
     foreach ($users as $user) {
         $uid = $user->id();
@@ -144,8 +144,8 @@ function get_event_participants(&$evt, $item_id, array $tri = array(), $count =
         $u['adminpaid'] = $u['paid'];
         $u['montant'] = 0;
         if ($money && $pay_id) {
-            $montants = XDB::fetchColumn('SELECT  montant
-                                            FROM  ' . $globals->money->mpay_tprefix . 'transactions AS t
+            $montants = XDB::fetchColumn('SELECT  amount
+                                            FROM  payment_transactions AS t
                                            WHERE  ref = {?} AND uid = {?}',
                                          $pay_id, $uid);
             foreach ($montants as $m) {
@@ -184,15 +184,7 @@ function subscribe_lists_event($participate, $uid, $evt, $paid, $payment = null)
     $payed_list        = $evt['payed_list'];
 
     $user = User::getSilent($uid);
-    if ($user) {
-        $email = $user->forlifeEmail();
-    } else {
-        $res = XDB::query("SELECT  email
-                             FROM  group_members
-                            WHERE  uid = {?} AND asso_id = {?}",
-                          $uid, $globals->asso('id'));
-        $email = $res->fetchOneCell();
-    }
+    $email = $user->forlifeEmail();
 
     function subscribe($list, $email)
     {