Do not display email info on xnet group member edition if user has no email.
[platal.git] / templates / xnetgrp / membres-edit.tpl
... / ...
CommitLineData
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 {if $user->bestEmail()}
53 <a href="mailto:{$user->bestEmail()}">{icon name=email title="mail"}</a>
54 {/if}
55</h2>
56
57<form method="post" action="{$platal->ns}member/{$platal->argv[1]}">
58 {xsrf_token_field}
59 <table cellpadding="0" cellspacing="0" class='tinybicol'>
60 {if hasPerm('admin')}
61 <tr class="pair">
62 <td class="titre">
63 Identifiant unique&nbsp;:
64 </td>
65 <td>
66 {$user->hruid}
67 <a href="https://www.polytechnique.org/admin/user/{$user->hruid}">{icon name="user_edit" title="Administer"}</a>
68 </td>
69 </tr>
70 {/if}
71 <tr class="pair">
72 <td class="titre">
73 Permissions&nbsp;:
74 </td>
75 <td>
76 <select name="group_perms">
77 <option value="membre" {if $user->group_perms eq 'membre'}selected="selected"{/if}>Membre</option>
78 <option value="admin" {if $user->group_perms eq 'admin'}selected="selected"{/if}>Animateur</option>
79 </select>
80 </td>
81 </tr>
82 <tr class="pair">
83 <td class="titre">
84 Poste&nbsp;:
85 </td>
86 <td>
87 <select name="group_position">
88 <option value=""{if $user->group_position eq ''} selected="selected"{/if}></option>
89 {foreach from=$positions item=position}
90 <option value="{$position}"{if $user->group_position eq $position} selected="selected"{/if}>{$position}</option>
91 {/foreach}
92 </select>
93 </td>
94 </tr>
95 {if $user->type eq 'virtual' || ($user->type eq 'xnet' && !$user->perms)}
96 <tr class="impair">
97 <td class="titre">
98 Type d'utilisateur&nbsp;:
99 </td>
100 <td>
101 <select name="type" onchange="showInformations(this); return true">
102 <option value="xnet" {if $user->type neq 'virtual'}selected="selected"{/if}>Personne physique</option>
103 <option value="virtual" {if $user->type eq "virtual"}selected="selected"{/if}>Personne morale</option>
104 </select>
105 </td>
106 </tr>
107 <tr class="impair">
108 <td class="titre">Nom complet&nbsp;:</td>
109 <td>{$user->fullName()}</td>
110 </tr>
111 <tr class="impair">
112 <td class="titre">Nom annuaire&nbsp;:</td>
113 <td>{$user->directoryName()}</td>
114 </tr>
115 <tr class="impair">
116 <td class="titre">Nom&nbsp;:</td>
117 <td>
118 <input type="text" value="{$user->lastname}" name="lastname" size="40" />
119 </td>
120 </tr>
121 {if $user->type neq "virtual"}
122 <tr class="impair">
123 <td class="titre">Prénom&nbsp;:</td>
124 <td>
125 <input type="text" value="{$user->firstname}" name="firstname" size="40" />
126 </td>
127 </tr>
128 <tr class="impair">
129 <td class="titre">Nom affiché&nbsp;:</td>
130 <td>
131 <input type="text" value="{$user->displayName()}" name="display_name" size="40" />
132 </td>
133 </tr>
134 {/if}
135 <tr id="sexe" class="impair" {if $user->type eq "virtual"}style="display: none"{/if}>
136 <td class="titre">
137 Sexe&nbsp;:
138 </td>
139 <td>
140 <select name="sex">
141 <option value="male"{if !$user->isFemale()} selected="selected"{/if}>Homme</option>
142 <option value="female"{if $user->isFemale()} selected="selected"{/if}>Femme</option>
143 </select>
144 </td>
145 </tr>
146 {if !$user->perms}
147 <tr class="impair">
148 <td class="titre">
149 Email&nbsp;:
150 </td>
151 <td>
152 <input type="text" value="{$user->forlifeEmail()}" name="email" size="40" />
153 </td>
154 </tr>
155 {/if}
156 {/if}
157 <tr class="impair">
158 <td class="titre">
159 Commentaire&nbsp;:
160 </td>
161 <td>
162 <input type="text" name="comm" value="{$user->group_comm}" size="40" maxlength="255" /><br />
163 <small>Poste, origine&hellip; (accessible à toutes les personnes autorisées à consulter l'annuaire)</small>
164 </td>
165 </tr>
166 {if $asso->has_nl}
167 <tr class="impair">
168 <td class="titre">
169 Newsletter&nbsp;:
170 </td>
171 <td>
172 <label>Inscrit<input type="radio" name="newsletter" value="1" {if $nl_registered eq 1}checked="checked"{/if} /></label>
173 &nbsp;-&nbsp;
174 <label><input type="radio" name="newsletter" value="0" {if $nl_registered eq 0}checked="checked"{/if} />Non inscrit</label>
175 </td>
176 </tr>
177 {/if}
178 {if $user->type eq 'xnet'}
179 <tr id="make_X">
180 <td colspan="2">
181 <span id="make_X_cb">
182 <input type="checkbox" name="is_x" id="is_x" onclick="showXInput(this);" onchange="showXInput(this);" />
183 <label for="is_x">coche cette case s'il s'agit d'un X ou un master ou doctorant de l'X</label>
184 </span>
185 <span id="make_X_login" style="display: none">
186 <span class="titre">Identifiant (prenom.nom.promo)&nbsp;:</span>
187 <input type="text" name="login_X" value="" />
188 </span>
189 </td>
190 </tr>
191 {/if}
192 {if $user->type eq 'xnet' && $suggest}
193 <tr>
194 <td colspan="2">
195 <label>
196 <input type="checkbox" name="suggest" />
197 coche cette case si tu souhaites qu'un compte «&nbsp;Extérieur&nbsp;» soit créé
198 pour cette personne et que nous lui envoyions un email afin qu'il ait
199 accès aux nombreuses fonctionnalités de Polytechnique.net (inscription
200 aux évènements, télépaiement, modération des listes de diffusion&hellip;)
201 </label>
202 </td>
203 </tr>
204 {/if}
205 {if $user->type eq 'xnet' && $pending_xnet_account}
206 <tr>
207 <td colspan="2">
208 <label>
209 <input type="checkbox" name="again" />
210 Cette personne a un compte «&nbsp;Extérieur&nbsp;» en attente d'activation de sa part. Pour la relancer, il suffit
211 de cocher la case ci-contre.
212 </label>
213 </td>
214 </tr>
215 {/if}
216 </table>
217
218 {if $user->bestEmail()}
219 <h2>Abonnement aux listes</h2>
220
221 <table cellpadding="0" cellspacing="0" class='large'>
222 <tr>
223 <th>&nbsp;</th>
224 <th>Liste</th>
225 <th>Description</th>
226 <th>Nb</th>
227 </tr>
228 {foreach from=$listes item=liste}
229 <tr>
230 <td class='right'>
231 <input type='hidden' name='ml1[{$liste.list}]' value='{$liste.sub}' />
232 <input type='checkbox' name='ml2[{$liste.list}]' {if $liste.sub eq 2}checked="checked"{/if} />
233 </td>
234 <td>
235 <a href='{$platal->ns}lists/members/{$liste.list}'>{$liste.list}</a>
236 </td>
237 <td>{$liste.desc|smarty:nodefaults}</td>
238 <td class='right'>{$liste.nbsub}</td>
239 </tr>
240 {foreachelse}
241 <tr><td colspan='4'>Pas de listes pour ce groupe</td></tr>
242 {/foreach}
243 </table>
244
245 <h2>Abonnement aux alias</h2>
246
247 <table cellpadding="0" cellspacing="0" class='large'>
248 <tr>
249 <th>&nbsp;</th>
250 <th>Alias</th>
251 </tr>
252
253 {foreach from=$alias key=address item=sub}
254 <tr>
255 <td align='right'>
256 <input type='hidden' name='ml3[{$address}]' value='{$sub}' />
257 <input type='checkbox' name='ml4[{$address}]' {if $sub}checked="checked"{/if} />
258 </td>
259 <td>
260 <a href='{$platal->ns}alias/admin/{$address}'>{$address}</a>
261 </td>
262 </tr>
263 {foreachelse}
264 <tr><td colspan='2'>Pas d'alias pour ce groupe</td></tr>
265 {/foreach}
266 </table>
267 {else}
268 <p>Cette personne n'a pas d'email renseigné sur le site et ne peut donc pas être inscrite aux listes de diffusions et aux alias du groupe.</p>
269 {/if}
270
271 <div class="center">
272 <br />
273 <input type="submit" name='change' value="Valider ces changements" onclick="return hashResponse('new_plain_password', false, false, false);" />
274 &nbsp;
275 <input type="reset" value="Annuler ces changements" />
276 </div>
277
278</form>
279
280
281{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}