Add job infos in xnetevents .csv ; Rewording in xnetevents.
authorAnne Limoges <anne.limoges_git@polytechnique.org>
Wed, 19 Dec 2012 14:57:31 +0000 (15:57 +0100)
committerAnne Limoges <anne.limoges_git@polytechnique.org>
Wed, 19 Dec 2012 14:57:40 +0000 (15:57 +0100)
modules/xnetevents.php
modules/xnetevents/xnetevents.inc.php
templates/payment/payment.tpl
templates/xnetevents/index.tpl
templates/xnetevents/subscribe.tpl

index f99a4b6..20e3b76 100644 (file)
@@ -222,7 +222,7 @@ class XnetEventsModule extends PLModule
                     $page->trigError("Tu dois choisir un nombre d'invités correct&nbsp;!");
                     return;
                 }
-                $subs[$j] = 1 + $pers[$j];
+                $subs[$j] = $pers[$j];
             }
         }
 
@@ -308,6 +308,9 @@ class XnetEventsModule extends PLModule
 
         $participants = get_event_participants($evt, $item_id, $tri);
         $title = 'Nom;Prénom;Promotion';
+        if ($admin) {
+            $title .=';Société;Poste';
+        }
         if ($all) {
             foreach ($evt['moments'] as $moment) {
                 $title .= ';' . $moment['titre'];
@@ -321,13 +324,18 @@ class XnetEventsModule extends PLModule
             $title .= 'Payé';
         } else {
             $title .= ';Nombre';
-        }
+        } 
         echo utf8_decode($title) . "\n";
 
         if ($participants) {
             foreach ($participants as $participant) {
                 $user = $participant['user'];
                 $line = $user->lastName() . ';' . $user->firstName() . ';' . $user->promo();
+                if ($admin && $user->hasProfile()) {
+                    $line .= ';' . $user->profile()->getMainJob()->company->name . ';' . $user->profile()->getMainJob()->description;
+                } else  {
+                    $line .= ';;';
+                }
                 if ($all) {
                     foreach ($evt['moments'] as $moment) {
                         $line .= ';' . $participant[$moment['item_id']];
@@ -495,7 +503,7 @@ class XnetEventsModule extends PLModule
             // request for a new payment
             if (Post::v('paiement_id') == -1 && $money_defaut >= 0) {
                 $p = new PayReq(S::user(),
-                                Post::v('intitule')." - ".$globals->asso('nom'),
+                                $globals->asso('nom')." - ".Post::v('intitule'),
                                 Post::v('site'), $money_defaut,
                                 Post::v('confirmation'), 0, 999,
                                 $globals->asso('id'), $eid, Post::v('payment_public') == 'yes');
index 608bf42..fdc46c0 100644 (file)
@@ -140,7 +140,7 @@ function get_event_participants(&$evt, $item_id, array $tri = array(), $limit =
     $evt['topay']     = 0;
     $evt['paid']      = 0;
     foreach ($tab as $uid=>&$u) {
-        $u['adminpaid'] = $u['paid'];
+        $u['adminpaid'] = (float)$u['paid'];
         $u['montant'] = 0;
         if ($money && $pay_id) {
             $montant = XDB::fetchOneCell('SELECT  SUM(amount)
index d926a91..5f036c0 100644 (file)
     <td>{$comment}</td>
   </tr>
 {/if}
+{if $meth->id == 1}
+  <tr>
+    <td><span class="erreur">Remarque pour les utilisateurs de Paypal</span></td>
+    <td><span class="erreur">Merci de cliquer sur "revenir au site marchant" à la fin de la transaction, sinon celle-ci n'apparaitra pas sur polytechnique.net.</span></td>
+  </tr>
+{/if}
   <tr>
     <td>&nbsp;</td>
     <td>
index f08f09f..a4b6a01 100644 (file)
         {foreach from=$e.moments item=m}
         {if !$m.nb}
         Tu ne viendras pas
-        {elseif $m.nb eq 1}
-        Tu viendras seul
         {else}
-        Tu viendras avec {$m.nb-1} personne{if $m.nb > 2}s{/if}
+        Tu as inscrit {$m.nb} personne{if $m.nb > 1}s{/if}
         {/if} à <em>{$m.titre}</em>.<br />
         {/foreach}
       {/if}
index 8146bbd..c7d96f1 100644 (file)
               <label><input type="radio" name="moment[{$m.item_id}]" value="1"
               {if $m.nb eq 1}checked="checked"{/if}/>Je m'inscris</label>
           {else}
-              <label><input type="radio" name="moment[{$m.item_id}]" value="1"
-              {if $m.nb eq 1}checked="checked"{/if}/>Je m'inscris seul</label><br />
               <label><input type="radio" name="moment[{$m.item_id}]" value="2" id="avec"
-              {if $m.nb > 1}checked="checked"{/if}/>Je m'inscris moi et</label>
-                <input size="2" name="personnes[{$m.item_id}]"
-                  value="{if $m.nb > 1}{math equation='x - 1' x=$m.nb}{else}1{/if}"/><label for="avec"> invités</label>
+              {if $m.nb > 0}checked="checked"{/if}/>J'inscris</label>
+                  <input size="2" name="personnes[{$m.item_id}]"
+                  value="{if $m.nb > 1}{$m.nb}{else}1{/if}"/><label for="avec"> personnes</label>
           {/if}
         {else}
           {if !$m.nb}
             Je ne viendrai pas.
-          {elseif $m.nb eq 1}
-            Je viendrai{if !$event.noinvite} seul{/if}.
           {else}
-            Je viendrai moi et {$m.nb} invité{if $m.nb > 2}s{/if}.
+            J'ai inscrit {$m.nb} personne{if $m.nb > 1}s{/if}.
           {/if}
         {/if}
       </td>