Displays group member count.
[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 != '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   }
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 {profile user=$user groupperms=false sex=false promo=true}
51   <a href="mailto:{$user->bestEmail()}">{icon name=email title="mail"}</a>
52 </h2>
53
54 <form method="post" action="{$platal->ns}member/{$platal->argv[1]}">
55   {xsrf_token_field}
56   <table cellpadding="0" cellspacing="0" class='tinybicol'>
57     <tr class="pair">
58       <td class="titre">
59         Permissions&nbsp;:
60       </td>
61       <td>
62         <select name="group_perms">
63           <option value="membre" {if $user->group_perms eq 'membre'}selected="selected"{/if}>Membre</option>
64           <option value="admin" {if $user->group_perms eq 'admin'}selected="selected"{/if}>Animateur</option>
65         </select>
66       </td>
67     </tr>
68     {if !$user->profile()}
69     <tr class="impair">
70       <td class="titre">
71         Type d'utilisateur&nbsp;:
72       </td>
73       <td>
74         <select name="type" onchange="showInformations(this); return true"{if $user->profile()} disabled="disabled"{/if}>
75           <option value="xnet" {if $user->type neq 'virtual'}selected="selected"{/if}>Personne physique</option>
76           <option value="virtual" {if $user->type eq "virtual"}selected="selected"{/if}>Personne morale</option>
77         </select>
78       </td>
79     </tr>
80       <tr id="prenom" class="impair" {if $user->type eq "virtual"}style="display: none"{/if}>
81       <td class="titre">
82         Nom affiché&nbsp;:
83       </td>
84       <td>
85         <input type="text" value="{$user->displayName()}" name="display_name" size="40"{if $user->profile()} disabled="disabled"{/if} />
86       </td>
87     </tr>
88     <tr class="impair">
89       <td class="titre">
90         Nom complet&nbsp;:
91       </td>
92       <td>
93         <input type="text" value="{$user->fullName()}" name="full_name" size="40"{if $user->profile()} disabled="disabled"{/if} />
94       </td>
95     </tr>
96     <tr id="sexe" class="impair" {if $user->type eq "virtual"}style="display: none"{/if}>
97       <td class="titre">
98         Sexe&nbsp;:
99       </td>
100       <td>
101         <select name="sex"{if $user->profile()} disabled="disabled"{/if}>
102           <option value="male"{if !$user->isFemale()} selected="selected"{/if}>Homme</option>
103           <option value="female"{if $user->isFemale()} selected="selected"{/if}>Femme</option>
104         </select>
105       </td>
106     </tr>
107     <tr class="impair">
108       <td class="titre">
109         Email&nbsp;:
110       </td>
111       <td>
112         <input type="text" value="{$user->forlifeEmail()}" name="email" size="40"{if $user->profile()} disabled="disabled"{/if} />
113       </td>
114     </tr>
115     {/if}
116     <tr class="impair">
117       <td class="titre">
118         Commentaire&nbsp;:
119       </td>
120       <td>
121         <input type="text" name="comm" value="{$user->group_comm}" size="40" maxlength="255" /><br />
122         <small>Poste, origine&hellip; (accessible à toutes les personnes autorisées à consulter l'annuaire)</small>
123       </td>
124     </tr>
125     {if $user->type eq 'xnet'}
126     <tr id="make_X">
127       <td colspan="2">
128         <span id="make_X_cb">
129           <input type="checkbox" name="is_x" id="is_x" onclick="showXInput(this);" onchange="showXInput(this);" />
130           <label for="is_x">coche cette case s'il s'agit d'un X</label>
131         </span>
132         <span id="make_X_login" style="display: none">
133           <span class="titre">Identifiant (prenom.nom.promo)&nbsp;:</span>
134           <input type="text" name="login_X" value="" />
135         </span>
136       </td>
137     </tr>
138     {/if}
139   </table>
140
141   <h2>Abonnement aux listes</h2>
142
143   <table cellpadding="0" cellspacing="0" class='large'>
144     <tr>
145       <th>&nbsp;</th>
146       <th>Liste</th>
147       <th>Description</th>
148       <th>Nb</th>
149     </tr>
150     {foreach from=$listes item=liste}
151     <tr>
152       <td class='right'>
153         <input type='hidden' name='ml1[{$liste.list}]' value='{$liste.sub}' />
154         <input type='checkbox' name='ml2[{$liste.list}]' {if $liste.sub eq 2}checked="checked"{/if} />
155       </td>
156       <td>
157         <a href='{$platal->ns}lists/members/{$liste.list}'>{$liste.list}</a>
158       </td>
159       <td>{$liste.desc|smarty:nodefaults}</td>
160       <td class='right'>{$liste.nbsub}</td>
161     </tr>
162     {foreachelse}
163     <tr><td colspan='4'>Pas de listes pour ce groupe</td></tr>
164     {/foreach}
165   </table>
166
167   <h2>Abonnement aux alias</h2>
168
169   <table cellpadding="0" cellspacing="0" class='large'>
170     <tr>
171       <th>&nbsp;</th>
172       <th>Alias</th>
173     </tr>
174
175     {foreach from=$alias key=address item=sub}
176     <tr>
177       <td align='right'>
178         <input type='hidden' name='ml3[{$address}]' value='{$sub}' />
179         <input type='checkbox' name='ml4[{$address}]' {if $sub}checked="checked"{/if} />
180       </td>
181       <td>
182         <a href='{$platal->ns}alias/admin/{$address}'>{$address}</a>
183       </td>
184     </tr>
185     {foreachelse}
186     <tr><td colspan='2'>Pas d'alias pour ce groupe</td></tr>
187     {/foreach}
188   </table>
189
190   <div class="center">
191     <br />
192     <input type="submit" name='change' value="Valider ces changements" />
193     &nbsp;
194     <input type="reset" value="Annuler ces changements" />
195   </div>                                                                      
196
197 </form>
198
199
200 {* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}