suppress mpay_tprefix (now payment tables are in x5dat)
authorDamien Bobillot <damien.bobillot+gitxorg@m4x.org>
Wed, 23 Jun 2010 01:23:19 +0000 (03:23 +0200)
committerDamien Bobillot <damien.bobillot+gitxorg@m4x.org>
Wed, 23 Jun 2010 01:24:23 +0000 (03:24 +0200)
convert montant > amount

Schmurtz

configs/platal.ini
modules/payment.php
modules/xnetevents.php
modules/xnetevents/xnetevents.inc.php
templates/payment/xnet.tpl

index 2e9f08a..77330c0 100644 (file)
@@ -63,7 +63,6 @@ manageurs_pass       = ""
 mpay_enable   = 1
 mpay_def_id   = 0
 mpay_def_meth = 0
-mpay_tprefix  = "paiement."
 paypal_site   = ""
 paypal_compte = ""
 
index 3685e78..acd8bce 100644 (file)
@@ -159,8 +159,6 @@ class PaymentModule extends PLModule
         $page->assign('meth', $meth);
         $page->assign('pay',  $pay);
         $page->assign('evtlink', $pay->event());
-
-        $page->assign('prefix', $globals->money->mpay_tprefix);
     }
 
     function handler_cyber_return(&$page, $uid = null)
@@ -487,17 +485,17 @@ class PaymentModule extends PLModule
         foreach($tit as $foo) {
             $pid = $foo['id'];
             if (may_update()) {
-                $res = XDB::query('SELECT  t.uid, timestamp AS `date`, t.comment, montant
+                $res = XDB::query('SELECT  t.uid, timestamp AS `date`, t.comment, amount
                                      FROM  payment_transactions AS t
                                     WHERE  t.ref = {?}', $pid);
                 $trans[$pid] = User::getBulkUsersWithUIDs($res->fetchAllAssoc(), 'uid', 'user');
                 $sum = 0;
                 foreach ($trans[$pid] as $i => $t) {
-                    $sum += strtr(substr($t['montant'], 0, strpos($t['montant'], 'EUR')), ',', '.');
-                    $trans[$pid][$i]['montant'] = str_replace('EUR', '€', $t['montant']);
+                    $sum += strtr(substr($t['amount'], 0, strpos($t['amount'], 'EUR')), ',', '.');
+                    $trans[$pid][$i]['amount'] = str_replace('EUR', '€', $t['amount']);
                 }
                 $trans[$pid][] = array('nom' => 'somme totale',
-                                       'montant' => strtr($sum, '.', ',').' €');
+                                       'amount' => strtr($sum, '.', ',').' €');
             }
             $res = XDB::iterRow("SELECT e.eid, e.short_name, e.intitule, ep.nb, ei.montant, ep.paid
                                    FROM group_events AS e
@@ -518,7 +516,7 @@ class PaymentModule extends PLModule
                     $event[$pid]['paid']      = $paid;
                 }
             }
-            $res = XDB::query("SELECT montant
+            $res = XDB::query("SELECT amount
                                  FROM payment_transactions AS t
                                 WHERE ref = {?} AND uid = {?}", $pid, S::v('uid'));
             $montants = $res->fetchColumn();
index 708bdd1..0523d5e 100644 (file)
@@ -154,8 +154,8 @@ class XnetEventsModule extends PLModule
             }
 
             $query = XDB::query(
-                "SELECT montant
-                   FROM {$globals->money->mpay_tprefix}transactions AS t
+                "SELECT amount
+                   FROM payment_transactions AS t
                  WHERE ref = {?} AND uid = {?}", $e['paiement_id'], S::v('uid'));
             $montants = $query->fetchColumn();
 
@@ -477,7 +477,7 @@ class XnetEventsModule extends PLModule
 
         // get a list of all the payment for this asso
         $res = XDB::iterator("SELECT id, text
-                                FROM {$globals->money->mpay_tprefix}paiements
+                                FROM payments
                                WHERE asso_id = {?}", $globals->asso('id'));
         $paiements = array();
         while ($a = $res->next()) $paiements[$a['id']] = $a['text']; {
@@ -600,8 +600,8 @@ class XnetEventsModule extends PLModule
 
         if ($evt['paiement_id']) {
             $infos = User::getBulkUsersWithUIDs(
-                            XDB::fetchAllAssoc('SELECT  t.uid, t.montant
-                                                  FROM  ' . $globals->money->mpay_tprefix . 'transactions AS t
+                            XDB::fetchAllAssoc('SELECT  t.uid, t.amount
+                                                  FROM  payment_transactions AS t
                                              LEFT JOIN  group_event_participants AS ep ON(ep.uid = t.uid AND ep.eid = {?})
                                                  WHERE  t.ref = {?} AND ep.uid IS NULL',
                                                $evt['eid'], $evt['paiement_id']),
index 5c0a868..f3e012d 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;
@@ -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) {
index 61ddb31..4c7f794 100644 (file)
@@ -100,7 +100,7 @@ Voici la liste des paiements en ligne possible pour le groupe {$asso->nom}&nbsp;
       {/if}Commentaire</a>
     </th>
     <th>
-      {if $order eq 'montant'}
+      {if $order eq 'amount'}
         <a href='{$platal->ns}payment?order={$order}&order_inv={$order_inv}'>
           <img src="{$platal->baseurl}images/{if $order_inv}dn{else}up{/if}.png" alt="" title="Tri {if !$order_inv}dé{/if}croissant" />
       {else}
@@ -121,7 +121,7 @@ Voici la liste des paiements en ligne possible pour le groupe {$asso->nom}&nbsp;
     </td>
     <td class="center">{$p.user->promo()}</td>
     <td>{$p.comment|comment_decode}</td>
-    <td class="right">{$p.montant}</td>
+    <td class="right">{$p.amount}</td>
   </tr>
   {elseif $smarty.foreach.people.first}
   <tr>
@@ -130,7 +130,7 @@ Voici la liste des paiements en ligne possible pour le groupe {$asso->nom}&nbsp;
   {else}
   <tr class="pair">
     <td class="right" colspan="5"><strong>Total </strong></td>
-    <th class="right">{$p.montant}</th>
+    <th class="right">{$p.amount}</th>
   </tr>
   {/if}
   {/foreach}