Merge branch 'xorg/master' into xorg/f/xnet-accounts
[platal.git] / templates / xnetgrp / membres-edit.tpl
1 {**************************************************************************}
2 {*                                                                        *}
3 {*  Copyright (C) 2003-2011 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 != 'virtual') ? '' : 'none';
28       document.getElementById('prenom').style.display = state;
29       document.getElementById('sexe').style.display = state;
30       document.getElementById('make_X').style.display = state;
31       document.getElementById('password').style.display = state;
32   }
33
34   function showXInput(box)
35   {
36      if (box.checked) {
37        document.getElementById('make_X_cb').style.display = 'none';
38        document.getElementById('make_X_login').style.display = '';
39      }
40   }
41 {/literal}
42 </script>
43
44 <h1>{$asso->nom}&nbsp;: gestion des membres</h1>
45
46 <p>
47 [<a href='{$platal->ns}annuaire'>Retour à l'annuaire</a>]
48 </p>
49
50 <h2>
51   Édition du profil de {profile user=$user groupperms=false sex=false promo=true}
52   <a href="mailto:{$user->bestEmail()}">{icon name=email title="mail"}</a>
53 </h2>
54
55 <form method="post" action="{$platal->ns}member/{$platal->argv[1]}">
56   {xsrf_token_field}
57   <table cellpadding="0" cellspacing="0" class='tinybicol'>
58     {if hasPerm('admin')}
59     <tr class="pair">
60       <td class="titre">
61         Identifiant unique&nbsp;:
62       </td>
63       <td>
64         {$user->hruid}
65         <a href="https://www.polytechnique.org/admin/user/{$user->hruid}">{icon name="user_edit" title="Administer"}</a>
66       </td>
67     </tr>
68     {/if}
69     <tr class="pair">
70       <td class="titre">
71         Permissions&nbsp;:
72       </td>
73       <td>
74         <select name="group_perms">
75           <option value="membre" {if $user->group_perms eq 'membre'}selected="selected"{/if}>Membre</option>
76           <option value="admin" {if $user->group_perms eq 'admin'}selected="selected"{/if}>Animateur</option>
77         </select>
78       </td>
79     </tr>
80     <tr class="pair">
81       <td class="titre">
82         Poste&nbsp;:
83       </td>
84       <td>
85         <select name="group_position">
86           <option value=""{if $user->group_position eq ''} selected="selected"{/if}></option>
87           {foreach from=$positions item=position}
88           <option value="{$position}"{if $user->group_position eq $position} selected="selected"{/if}>{$position}</option>
89           {/foreach}
90         </select>
91       </td>
92     </tr>
93     {if $user->type eq 'virtual' || $user->type eq 'xnet'}
94     <tr class="impair">
95       <td class="titre">
96         Type d'utilisateur&nbsp;:
97       </td>
98       <td>
99         <select name="type" onchange="showInformations(this); return true">
100           <option value="xnet" {if $user->type neq 'virtual'}selected="selected"{/if}>Personne physique</option>
101           <option value="virtual" {if $user->type eq "virtual"}selected="selected"{/if}>Personne morale</option>
102         </select>
103       </td>
104     </tr>
105       <tr id="prenom" class="impair" {if $user->type eq "virtual"}style="display: none"{/if}>
106       <td class="titre">
107         Nom affiché&nbsp;:
108       </td>
109       <td>
110         <input type="text" value="{$user->displayName()}" name="display_name" size="40" />
111       </td>
112     </tr>
113     <tr class="impair">
114       <td class="titre">
115         Nom complet&nbsp;:
116       </td>
117       <td>
118         <input type="text" value="{$user->fullName()}" name="full_name" size="40" />
119       </td>
120     </tr>
121     <tr class="impair">
122       <td class="titre">
123         Nom annuaire&nbsp;:
124       </td>
125       <td>
126         <input type="text" value="{$user->directoryName()}" name="directory_name" size="40" />
127       </td>
128     </tr>
129     <tr id="sexe" class="impair" {if $user->type eq "virtual"}style="display: none"{/if}>
130       <td class="titre">
131         Sexe&nbsp;:
132       </td>
133       <td>
134         <select name="sex">
135           <option value="male"{if !$user->isFemale()} selected="selected"{/if}>Homme</option>
136           <option value="female"{if $user->isFemale()} selected="selected"{/if}>Femme</option>
137         </select>
138       </td>
139     </tr>
140     {if !$user->perms}
141     <tr class="impair">
142       <td class="titre">
143         Email&nbsp;:
144       </td>
145       <td>
146         <input type="text" value="{$user->forlifeEmail()}" name="email" size="40" />
147       </td>
148     </tr>
149     {/if}
150     {/if}
151     <tr class="impair">
152       <td class="titre">
153         Commentaire&nbsp;:
154       </td>
155       <td>
156         <input type="text" name="comm" value="{$user->group_comm}" size="40" maxlength="255" /><br />
157         <small>Poste, origine&hellip; (accessible à toutes les personnes autorisées à consulter l'annuaire)</small>
158       </td>
159     </tr>
160     {if $user->type eq 'xnet'}
161     <tr class="impair" id="password">
162       <td class="titre">Mot de passe&nbsp;:</td>
163       <td>
164         <div style="float: left">
165           <input type="text" name="new_plain_password" size="10" maxlength="256" value="********" />
166           <input type="hidden" name="pwhash" value="" />
167         </div>
168         <div style="float: left; margin-top: 5px;">
169           {checkpasswd prompt="new_plain_password" submit="dummy_none"}
170         </div>
171         {if !$onlyGroup}
172         <div style="clear: both">
173           <small class="error">
174             Attention, cet utilisateur est inscrit à d'autres groupes, changer son mot de passe modifiera aussi ses accès aux autres groupes.
175           </small>
176         </div>
177         {/if}
178       </td>
179     </tr>
180     <tr id="make_X">
181       <td colspan="2">
182         <span id="make_X_cb">
183           <input type="checkbox" name="is_x" id="is_x" onclick="showXInput(this);" onchange="showXInput(this);" />
184           <label for="is_x">coche cette case s'il s'agit d'un X</label>
185         </span>
186         <span id="make_X_login" style="display: none">
187           <span class="titre">Identifiant (prenom.nom.promo)&nbsp;:</span>
188           <input type="text" name="login_X" value="" />
189         </span>
190       </td>
191     </tr>
192     {/if}
193   </table>
194
195   <h2>Abonnement aux listes</h2>
196
197   <table cellpadding="0" cellspacing="0" class='large'>
198     <tr>
199       <th>&nbsp;</th>
200       <th>Liste</th>
201       <th>Description</th>
202       <th>Nb</th>
203     </tr>
204     {foreach from=$listes item=liste}
205     <tr>
206       <td class='right'>
207         <input type='hidden' name='ml1[{$liste.list}]' value='{$liste.sub}' />
208         <input type='checkbox' name='ml2[{$liste.list}]' {if $liste.sub eq 2}checked="checked"{/if} />
209       </td>
210       <td>
211         <a href='{$platal->ns}lists/members/{$liste.list}'>{$liste.list}</a>
212       </td>
213       <td>{$liste.desc|smarty:nodefaults}</td>
214       <td class='right'>{$liste.nbsub}</td>
215     </tr>
216     {foreachelse}
217     <tr><td colspan='4'>Pas de listes pour ce groupe</td></tr>
218     {/foreach}
219   </table>
220
221   <h2>Abonnement aux alias</h2>
222
223   <table cellpadding="0" cellspacing="0" class='large'>
224     <tr>
225       <th>&nbsp;</th>
226       <th>Alias</th>
227     </tr>
228
229     {foreach from=$alias key=address item=sub}
230     <tr>
231       <td align='right'>
232         <input type='hidden' name='ml3[{$address}]' value='{$sub}' />
233         <input type='checkbox' name='ml4[{$address}]' {if $sub}checked="checked"{/if} />
234       </td>
235       <td>
236         <a href='{$platal->ns}alias/admin/{$address}'>{$address}</a>
237       </td>
238     </tr>
239     {foreachelse}
240     <tr><td colspan='2'>Pas d'alias pour ce groupe</td></tr>
241     {/foreach}
242   </table>
243
244   <div class="center">
245     <br />
246     <input type="submit" name='change' value="Valider ces changements" onclick="return hashResponse('new_plain_password', false, false);" />
247     &nbsp;
248     <input type="reset" value="Annuler ces changements" />
249   </div>
250
251 </form>
252
253
254 {* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}