Integrate payment directly in Xnet
[platal.git] / templates / xnetevents / index.tpl
index ca5c415..aed7bd2 100644 (file)
@@ -20,7 +20,7 @@
 {*                                                                        *}
 {**************************************************************************}
 
-{if !$admin}
+{if !$is_admin}
 <h1>{$asso.nom} : Evénements</h1>
 {else}
 <h1>
 {if $updated}
 <p class='error'>
   La modification de l'inscription a été prise en compte !
-  {if $updated.topay}
-    <br/>N'oublie pas de payer {$updated.topay|replace:'.':','}&nbsp;&euro;
+  {if $updated.topay > $updated.paid}
+    <br/>N'oublie pas de payer {math equation="a-b" a=$updated.topay b=$updated.paid}&nbsp;&euro;
     {if $updated.paid > 0}
     (tu as déjà payé {$updated.paid|replace:'.':','}&nbsp;&euro;)
     {/if}
     {if $updated.paiement_id}
-    [<a href="https://www.polytechnique.org/payment/{$updated.paiement_id}?montant={$updated.topay}">
+    [<a href="{$platal->ns}payment/{$updated.paiement_id}?montant={math equation="a-b" a=$updated.topay b=$updated.paid}">
     Payer en ligne</a>]
     {/if}
   {/if}
@@ -67,7 +67,7 @@
       {if !$e.inscr_open}
       (<span class="error">Inscriptions closes</span>)
       {/if}
-      {if $admin}
+      {if $is_admin}
       <br />
       [<a href="{$platal->ns}events/edit/{$e.short_name|default:$e.eid}">
         modifier
     </td>
   </tr>
 
-  {if $admin || $e.show_participants || ($e.deadline_inscription && $e.inscr_open)}
+  {if $is_admin || $e.show_participants || ($e.deadline_inscription && $e.inscr_open)}
   <tr>
     <td class="titre">Informations :</td>
     <td class='actions'>
-      {if $admin || $e.show_participants}
+      {if $is_admin || $e.show_participants}
       <a href="{$platal->ns}events/admin/{$e.short_name|default:$e.eid}">
         consulter la liste des participants
         {icon name=group title="Liste des participants"}
 
       {if $e.topay}
       <span class="error">
-      Tu dois payer {$e.topay|replace:'.':','}&nbsp;&euro;
-      {if $e.paid > 0}
-      (tu as déjà payé {$e.paid|replace:'.':','}&nbsp;&euro;)
-      {/if}
-      {if $e.paiement_id}
-        [<a href="https://www.polytechnique.org/payment/{$e.paiement_id}?montant={$e.topay}}">
+        {if !$e.paid}
+        Tu dois payer {$e.topay|replace:'.':','}&nbsp;&euro;.
+        {elseif $e.paid < $e.topay}
+        Tu dois encore payer {math equation="a-b" a=$e.topay b=$e.paid|replace:'.':','}&nbsp;&euro;
+        (tu as déjà payé {$e.paid|replace:'.':','}&nbsp;&euro;)
+        {else}
+        Tu as déjà payé {$e.paid|replace:'.':','}&nbsp;&euro; pour ton inscription.
+        {/if}
+        {if $e.paiement_id &&  $e.paid < $e.topay}
+        [<a href="{$platal->ns}payment/{$e.paiement_id}?montant={math equation="a-b" a=$e.topay b=$e.paid}">
         Payer en ligne</a>]
-      {/if}
+        {/if}
       </span>
       {/if}
     </td>