83a36efae73d8deeb3209532b78009e8354c5cf5
[platal.git] / templates / xnetgrp / membres-edit.tpl
1 {**************************************************************************}
2 {*                                                                        *}
3 {*  Copyright (C) 2003-2010 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 <script type="text/javascript">
24 {literal}
25   function showInformations(box)
26   {
27       var state = (box.value == 'ext') ? '' : 'none';
28       document.getElementById('prenom').style.display = state;
29       document.getElementById('sexe').style.display = state;
30       document.getElementById('make_X').style.display = state;
31   }
32
33   function showXInput(box)
34   {
35      if (box.checked) {
36        document.getElementById('make_X_cb').style.display = 'none';
37        document.getElementById('make_X_login').style.display = '';
38      }
39   }
40 {/literal}
41 </script>
42
43 <h1>{$asso.nom}&nbsp;: gestion des membres</h1>
44
45 <p>
46 [<a href='{$platal->ns}annuaire'>Retour à l'annuaire</a>]
47 </p>
48
49 <h2>
50   Édition du profil de {if "`$user.prenom` `$user.nom`"|trim}{$user.prenom} {$user.nom}{else}{$user.email}{/if}
51   {if $user.origine eq 'X'}
52   &nbsp;(X{$user.promo})
53   <a href="https://www.polytechnique.org/profile/{$user.alias}">{icon name=user_suit title="fiche"}</a>
54   {/if}
55   <a href="{$platal->ns}member/del/{$user.email}">{icon name=delete title="Suppression du compte"}</a>
56   <a href="mailto:{$user.email}">{icon name=email title="mail"}</a>
57 </h2>
58
59 <form method="post" action="{$platal->ns}member/{$platal->argv[1]}">
60   {xsrf_token_field}
61   <table cellpadding="0" cellspacing="0" class='tinybicol'>
62     <tr class="pair">
63       <td class="titre">
64         Permissions&nbsp;:
65       </td>
66       <td>
67         <select name="is_admin">
68           <option value="0" {if !$user.perms}selected="selected"{/if}>Membre</option>
69           <option value="1" {if $user.perms}selected="selected"{/if}>Animateur</option>
70         </select>
71       </td>
72     </tr>
73     {if $user.origine neq X}
74     <tr class="impair">
75       <td class="titre">
76         Type d'utilisateur&nbsp;:
77       </td>
78       <td>
79         <select name="origine" onchange="showInformations(this); return true">
80           <option value="ext" {if $user.origine eq "ext"}selected="selected"{/if}>Personne physique</option>
81           <option value="groupe" {if $user.origine eq "groupe"}selected="selected"{/if}>Personne morale</option>
82         </select>
83       </td>
84     </tr>
85     <tr id="prenom" class="impair" {if $user.origine eq "groupe"}style="display: none"{/if}>
86       <td class="titre">
87         Prénom&nbsp;:
88       </td>
89       <td>
90         <input type="text" value="{$user.prenom}" name="prenom" size="40" />
91       </td>
92     </tr>
93     <tr class="impair">
94       <td class="titre">
95         Nom&nbsp;:
96       </td>
97       <td>
98         <input type="text" value="{$user.nom}" name="nom" size="40" />
99       </td>
100     </tr>
101     <tr id="sexe" class="impair" {if $user.origine eq "groupe"}style="display: none"{/if}>
102       <td class="titre">
103         Sexe&nbsp;:
104       </td>
105       <td>
106         <select name="sexe">
107           <option value="0"{if $user.sexe eq 0} selected="selected"{/if}>Homme</option>
108           <option value="1"{if $user.sexe eq 1} selected="selected"{/if}>Femme</option>
109         </select>
110       </td>
111     </tr>
112     <tr class="impair">
113       <td class="titre">
114         Email&nbsp;:
115       </td>
116       <td>
117         <input type="text" value="{$user.email}" name="email" size="40" />
118       </td>
119     </tr>
120     {/if}
121     <tr class="impair">
122       <td class="titre">
123         Commentaire&nbsp;:
124       </td>
125       <td>
126         <input type="text" name="comm" value="{$user.comm}" size="40" maxlength="255" /><br />
127         <small>Poste, origine&hellip; (accessible à toutes les personnes autorisées à consulter l'annuaire)</small>
128       </td>
129     </tr>
130     {if $user.origine neq X}
131     <tr id="make_X" {if $user.origine eq "groupe"}style="display: none"{/if}>
132       <td colspan="2">
133         <span id="make_X_cb">
134           <input type="checkbox" name="is_x" id="is_x" onclick="showXInput(this);" onchange="showXInput(this);" />
135           <label for="is_x">coche cette case s'il s'agit d'un X</label>
136         </span>
137         <span id="make_X_login" style="display: none">
138           <span class="titre">Identifiant (prenom.nom.promo)&nbsp;:</span>
139           <input type="text" name="login_X" value="" />
140         </span>
141       </td>
142     </tr>
143     {/if}
144   </table>
145
146   <h2>Abonnement aux listes</h2>
147
148   <table cellpadding="0" cellspacing="0" class='large'>
149     <tr>
150       <th>&nbsp;</th>
151       <th>Liste</th>
152       <th>Description</th>
153       <th>Nb</th>
154     </tr>
155     {foreach from=$listes item=liste}
156     <tr>
157       <td class='right'>
158         <input type='hidden' name='ml1[{$liste.list}]' value='{$liste.sub}' />
159         <input type='checkbox' name='ml2[{$liste.list}]' {if $liste.sub eq 2}checked="checked"{/if} />
160       </td>
161       <td>
162         <a href='{$platal->ns}lists/members/{$liste.list}'>{$liste.list}</a>
163       </td>
164       <td>{$liste.desc|smarty:nodefaults}</td>
165       <td class='right'>{$liste.nbsub}</td>
166     </tr>
167     {foreachelse}
168     <tr><td colspan='4'>Pas de listes pour ce groupe</td></tr>
169     {/foreach}
170   </table>
171
172   <h2>Abonnement aux alias</h2>
173
174   <table cellpadding="0" cellspacing="0" class='large'>
175     <tr>
176       <th>&nbsp;</th>
177       <th>Alias</th>
178     </tr>
179
180     {foreach from=$alias item=a}
181     <tr>
182       <td align='right'>
183         <input type='hidden' name='ml3[{$a.alias}]' value='{$a.sub}' />
184         <input type='checkbox' name='ml4[{$a.alias}]' {if $a.sub}checked="checked"{/if} />
185       </td>
186       <td>
187         <a href='{$platal->ns}alias/admin/{$a.alias}'>{$a.alias}</a>
188       </td>
189     </tr>
190     {foreachelse}
191     <tr><td colspan='2'>Pas d'alias pour ce groupe</td></tr>
192     {/foreach}
193   </table>
194
195   <div class="center">
196     <br />
197     <input type="submit" name='change' value="Valider ces changements" />
198     &nbsp;
199     <input type="reset" value="Annuler ces changements" />
200   </div>                                                                      
201
202 </form>
203
204
205 {* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}