Adds XSRF protection to the XnetEvents module.
[platal.git] / templates / xnetevents / admin.tpl
1 {**************************************************************************}
2 {*                                                                        *}
3 {*  Copyright (C) 2003-2008 Polytechnique.org                             *}
4 {*  http://opensource.polytechnique.org/                                  *}
5 {*                                                                        *}
6 {*  This program is free software; you can redistribute it and/or modify  *}
7 {*  it under the terms of the GNU General Public License as published by  *}
8 {*  the Free Software Foundation; either version 2 of the License, or     *}
9 {*  (at your option) any later version.                                   *}
10 {*                                                                        *}
11 {*  This program is distributed in the hope that it will be useful,       *}
12 {*  but WITHOUT ANY WARRANTY; without even the implied warranty of        *}
13 {*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *}
14 {*  GNU General Public License for more details.                          *}
15 {*                                                                        *}
16 {*  You should have received a copy of the GNU General Public License     *}
17 {*  along with this program; if not, write to the Free Software           *}
18 {*  Foundation, Inc.,                                                     *}
19 {*  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA               *}
20 {*                                                                        *}
21 {**************************************************************************}
22
23 <h1>{$asso.nom}&nbsp;: <a href='{$platal->ns}events'>Événements</a> </h1>
24
25 <p>
26 L'événement {$evt.intitule}
27 {if $evt.titre} - {$evt.titre}
28 {/if}
29 {if $evt.titre || count($moments) eq 1}
30 comptera {$evt.nb_tot} personne{if $evt.nb_tot > 1}s{/if}.
31 {else}
32 ({$evt.nb} personne{if $evt.nb > 1}s ont réalisé leur{else} a réalisé son{/if} inscription).
33 {/if}
34 </p>
35
36 {if $evt.participant_list && $is_admin}
37 <p class="center">
38 [<a href="mailto:?bcc={$evt.short_name}-participants@{#globals.xnet.evts_domain#}">envoyer un mail à ceux qui viennent</a>]
39 -
40 [<a href="mailto:?bcc={$evt.short_name}-absents@{#globals.xnet.evts_domain#}">envoyer un mail aux membres non inscrits</a>]
41 </p>
42 {/if}
43
44 {if count($moments) > 1}
45 <p class="center">
46 [<a href="{$platal->ns}events/admin/{$evt.short_name|default:$evt.eid}"{if
47 !$platal->argv[2]}class="erreur"{/if}>Vue générale</a>]
48 {foreach from=$moments item=m}
49 [<a href="{$platal->ns}events/admin/{$evt.short_name|default:$evt.eid}/{$m.item_id}" {if $platal->argv[2] eq $m.item_id}class="erreur"{/if}>{$m.titre}</a>]
50 {/foreach}
51 </p>
52 {/if}
53
54 <p class="center">
55 [<a href="{$platal->pl_self()}" {if !$smarty.request.initiale}class="erreur"{/if}>tout</a>]
56 {foreach from=$alphabet item=c}
57 [<a href="{$platal->pl_self()}?initiale={$c}"{if $smarty.request.initiale eq $c} class="erreur"{/if}>{$c}</a>]
58 {/foreach}
59 </p>
60
61 {if $is_admin}{literal}
62 <script type="text/javascript">
63 function remplitAuto(mail) {
64   document.getElementById('inscription').mail.value=mail;
65   var f = document.getElementById('montant');
66   if (f)
67       f.mail.value=mail;
68 }
69 </script>
70 {/literal}
71
72 {if $oublis}
73 <p class="erreur">
74 Ils ont payé mais ont oublié de s'inscrire&nbsp;:
75 </p>
76
77 <table summary="payé mais non inscrits" class="tinybicol">
78   <tr>
79     <th>Prénom NOM</th>
80     <th>Promo</th>
81     <th>Infos</th>
82     <th>Montant</th>
83   </tr>
84   {iterate from=$oubliinscription item=m}
85   <tr class="pair">
86     <td>
87       <a href="" {if $is_admin}onclick="return remplitAuto('{$m.email}')"{/if}>
88         {if !$m.prenom && !$m.nom}
89         {$m.email}
90         {else}
91         {$m.prenom} {$m.nom}
92         {/if}
93       </a>
94     </td>
95     <td>{$m.promo}</td>
96     <td>
97       <a href="https://www.polytechnique.org/profile/{$m.email}">{icon name=user_suit title="fiche"}</a>
98       <a href="https://www.polytechnique.org/vcard/{$m.email}.vcf">{icon name=vcard title="vcard"}</a>
99       <a href="mailto:{$m.email}@{#globals.mail.domain#}">{icon name=email title="mail"}</a>
100     </td>
101     <td>{$m.montant}</td>
102   </tr>
103   {/iterate}
104 </table>
105
106 <hr />
107 {/if}
108
109 {/if}
110
111 <table summary="participants a l'evenement" class="{if $tout}large{else}tiny{/if}">
112   <tr>
113     {if $is_admin && $evt.paiement_id && $tout}
114       {assign var=height value='rowspan="2"'}
115     {/if}
116     <th {$height|smarty:nodefaults}>Prénom NOM</th>
117     <th {$height|smarty:nodefaults}>Promo</th>
118     <th {$height|smarty:nodefaults}>Info</th>
119     {if $tout}
120       {if $moments}
121         {foreach from=$moments item=m}
122           <th {$height|smarty:nodefaults}>{$m.titre}</th>
123         {/foreach}
124       {else}
125         <th {$height|smarty:nodefaults}>Nombre</th>
126       {/if}
127       {if $is_admin && $evt.money}
128         <th {$height|smarty:nodefaults}>Montant</th>
129         <th colspan="3">Payé</th>
130       {/if}
131     {else}
132     <th {$height|smarty:nodefaults}>Nombre</th>
133     {/if}
134   </tr>
135   {if $is_admin && $evt.paiement_id && $tout}
136   <tr>
137     <th>Télépaiement</th>
138     <th>Autre</th>
139     <th>Total</th>
140   </tr>
141   {/if}
142   {foreach from=$participants item=m}
143   <tr>
144     <td>
145       {if $is_admin}<a href="javascript:remplitAuto('{$m.email}')">{/if}
146         {if $m.femme}&bull;{/if}{if !$m.prenom && !$m.nom}{$m.email}{else}{$m.prenom} {$m.nom}{/if}
147       {if $is_admin}</a>{/if}
148     </td>
149     <td>{$m.promo}</td>
150     <td>
151       {if $m.x}
152       <a href="https://www.polytechnique.org/profile/{$m.email}">{icon name=user_suit title="fiche"}</a>
153       <a href="https://www.polytechnique.org/vcard/{$m.email}.vcf">{icon name=vcard title="vcard"}</a>
154       <a href="mailto:{$m.email}@{#globals.mail.domain#}">{icon name=email title="mail"}</a>
155       {else}
156       <a href="mailto:{$m.email}">{icon name=email title="mail"}</a>
157       {/if}
158     </td>
159     {if $tout}
160       {if $moments}
161         {foreach from=$moments item=i}
162           <td>{$m[$i.item_id]}</td>
163         {/foreach}
164       {else}
165         <td>{$m[1]}</td>
166       {/if}
167       {if $is_admin && $evt.money}
168         <td {if $m.montant > $m.paid}class="erreur"{/if}>{$m.montant}&euro;</td>
169         {if $evt.paiement_id}
170           <td>{$m.telepayment|default:0}&euro;</td>
171           <td>{$m.adminpaid|default:0}&euro;</td>
172         {/if}
173         <td {if $m.montant < $m.paid}class="erreur"{/if}>{$m.paid}&euro;</td>
174       {/if}
175     {else}
176     <td>
177       {$m.nb}
178     </td>
179     {/if}
180   </tr>
181   {/foreach}
182   {if $is_admin && $evt.money && $tout}
183   <tr>
184     {assign var=cols value=$moments|@count}
185     <td colspan="{$cols+3}" class="right"><strong>Total</strong></td>
186     <td>{$evt.topay}&euro;</td>
187     {if $evt.paiement_id}
188     <td>{$evt.telepaid|default:0}&euro;</td>
189     <td>{$evt.adminpaid|default:0}&euro;</td>
190     {/if}
191     <td>{$evt.paid}&euro;</td>
192   </tr>
193   {/if}
194 </table>
195
196 <p class="descr">
197 {foreach from=$links item=ofs key=txt}
198 <a href="{$platal->pl_self()}?offset={$ofs}&amp;initiale={$smarty.request.initiale}"{if $smarty.request.offset eq $ofs} class="erreur"{/if}>{$txt}</a>
199 {/foreach}
200 </p>
201
202 {if $absents->total()}
203
204 <hr />
205
206 <p>Les personnes suivantes ont indiqué qu'elles ne viendraient pas à l'événement&nbsp;:</p>
207
208 <table class="tinybicol">
209   <tr><th>Prénom NOM</th><th>Origine</th></tr>
210   {iterate from=$absents item=m}
211   <tr>
212     <td>
213       {if $is_admin}<a href="javascript:remplitAuto('{$m.email}')">{/if}
214       {if $m.sexe}&bull;{/if}{$m.prenom} {$m.nom}
215       {if $is_admin}</a>{/if}
216     </td>
217     <td>
218       {$m.promo}
219     </td>
220   </tr>
221   {/iterate}
222 </table>
223
224 {/if}
225
226 {if $is_admin}
227
228 <p class="descr">
229   <a href="{$platal->ns}events/csv/{$evt.eid}/{$platal->argv[2]}/{$evt.intitule}{if $evt.titre}.{$evt.titre}{/if}.csv">
230     {icon name=page_excel title="Télécharger au format Excel"} Télécharger le fichier Excel
231   </a>
232 </p>
233
234 <hr />
235
236 <p class="descr">
237 En tant qu'administrateur, tu peux fixer la venue (accompagnée ou pas) d'un des membres du groupe.
238 Donne ici son mail, ainsi que le nombre de participants.
239 </p>
240
241 <form action="{$platal->pl_self()}" method="post" id="inscription">
242   {xsrf_token_field}
243   <p class="descr">
244     <input type="hidden" name="adm" value="nbs" />
245
246     Mail&nbsp;: <input name="mail" size="20" />
247
248     {if $platal->argv[2]}
249     {$evt.titre}&nbsp;: <input name="nb[{$platal->argv[2]}]" size="1" value="1" />
250     {else}
251     {foreach from=$moments item=m}
252     {$m.titre}&nbsp;: <input name="nb[{$m.item_id}]" size="1" value="1"/>
253     {foreachelse}
254     Nombre&nbsp;: <input name="nb[1]" size="1" value="1" />
255     {/foreach}
256     {/if}
257     <input type="submit" />
258   </p>
259 </form>
260
261 {if $evt.money}
262
263 <hr />
264
265 <p class="descr">
266 En tant qu'administrateur, tu peux entrer un paiement reçu par une autre source que le télépaiement
267 du site X.org. Ce montant s'ajoutera aux montants déjà entrés. Si tu as fait une erreur, tu peux
268 entrer un montant négatif.
269 </p>
270
271 <p class="descr">
272 Note que tu peux cliquer sur les noms des membres pour remplir automatiquement la case ci-dessous.
273 </p>
274
275 <form action="{$platal->pl_self()}" method="post" id="montant">
276   {xsrf_token_field}
277   <p class="descr">
278   <input type="hidden" name="adm" value="prix" />
279   Mail&nbsp;: <input name="mail" size="20" />
280   montant&nbsp;: <input name="montant" size="3" value="0,00" /> &euro;
281   <input type="submit" />
282   </p>
283 </form>
284 {/if}
285
286 {/if}
287
288 {* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}