Search UI is more coherent :
[platal.git] / templates / search / adv.form.tpl
1 {**************************************************************************}
2 {*                                                                        *}
3 {*  Copyright (C) 2003-2006 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>Recherche dans l'annuaire</h1>
24
25 <form id="recherche" action="search/adv" method="get">
26   <script type="text/javascript">{literal}
27     function launch_form(url) {
28       var f = document.getElementById('recherche');
29       f.action = url;
30       f.submit();
31     }
32   {/literal}</script>
33   <table class="bicol" cellpadding="3" summary="Recherche">
34     <tr>
35       <th colspan="2">
36         Recherche avancée [<a href="search">&lt;&lt;&lt;&nbsp;Recherche simple</a>]
37       </th>
38     </tr>
39     <tr>
40       <td>Nom</td>
41       <td>
42         <input type="hidden" name="rechercher" value="Chercher"/>
43         <input type="submit" style="display:none"/>
44         <input type="text" name="name" size="32" value="{$smarty.request.name}" />
45         {if $smarty.request.name && !$with_soundex && $smarty.request.recherche}
46         <a class='smaller' href="search/adv?with_soundex=1&amp;{$url_args}">
47           étendre par proximité sonore
48         </a>
49         {/if}
50       </td>
51     </tr>
52     <tr>
53       <td>Prénom</td>
54       <td>
55         <input type="text" name="firstname" size="32" value="{$smarty.request.firstname}" />
56         {if $smarty.request.firstname && !$with_soundex && $smarty.request.recherche}
57         <a class='smaller' href="search/adv?with_soundex=1&amp;{$url_args}">
58           étendre par proximité sonore
59         </a>
60         {/if}
61       </td>
62     </tr>
63     <tr>
64       <td>Surnom</td>
65       <td>
66         <input type="text" name="nickname" size="32" value="{$smarty.request.nickname}" />
67       </td>
68     </tr>
69     <tr>
70       <td>Promotion</td>
71       <td>
72         <select name="egal1">
73           <option value="=" {if $smarty.request.egal1 eq "="}selected="selected"{/if}>&nbsp;=&nbsp;</option>
74           <option value="&gt;=" {if $smarty.request.egal1 eq "&gt;="}selected="selected"{/if}>&nbsp;&gt;=&nbsp;</option>
75           <option value="&lt;=" {if $smarty.request.egal1 eq "&lt;="}selected="selected"{/if}>&nbsp;&lt;=&nbsp;</option>
76         </select>
77         <input type="text" name="promo1" size="4" maxlength="4" value="{$smarty.request.promo1}" />
78         &nbsp;ET&nbsp;
79         <select name="egal2">
80           <option value="=" {if $smarty.request.egal2 eq "="}selected="selected"{/if}>&nbsp;=&nbsp;</option>
81           <option value="&gt;=" {if $smarty.request.egal2 eq "&gt;="}selected="selected"{/if}>&nbsp;&gt;=&nbsp;</option>
82           <option value="&lt;=" {if $smarty.request.egal2 eq "&lt;="}selected="selected"{/if}>&nbsp;&lt;=&nbsp;</option>
83         </select>
84         <input type="text" name="promo2" size="4" maxlength="4" value="{$smarty.request.promo2}" />
85       </td>
86     </tr>
87     <tr>
88       <td>Sexe</td>
89       <td>
90         <table>
91           <tr>
92             <td style="width:100px">
93               <input type="radio" name="woman" value="0" {if !$smarty.request.woman}checked="checked"{/if} />Indifférent
94             </td>
95             <td style="width:100px">
96               <input type="radio" name="woman" value="1" {if $smarty.request.woman eq 1}checked="checked"{/if} />Homme
97             </td>
98             <td style="width:100px">
99               <input type="radio" name="woman" value="2" {if $smarty.request.woman eq 2}checked="checked"{/if} />Femme
100             </td>
101           </tr>
102         </table>
103       </td>
104     </tr>
105     <tr>
106       <td>Sur polytechnique.org</td>
107       <td>
108         <table>
109           <tr>
110             <td style="width:100px">
111               <input type="radio" name="subscriber" value="0" {if !$smarty.request.subscriber}checked="checked"{/if} />Indifférent
112             </td>
113             <td style="width:100px">
114               <input type="radio" name="subscriber" value="1" {if $smarty.request.subscriber eq 1}checked="checked"{/if} />Inscrit
115             </td>
116             <td style="width:100px">
117               <input type="radio" name="subscriber" value="2" {if $smarty.request.subscriber eq 2}checked="checked"{/if} />Non inscrit
118             </td>
119           </tr>
120         </table>
121       </td>
122     </tr>
123     <tr>
124       <td>En vie</td>
125       <td>
126         <table>
127           <tr>
128             <td style="width:100px">
129               <input type="radio" name="alive" value="0" {if !$smarty.request.alive}checked="checked"{/if} />Indifférent
130             </td>
131             <td style="width:100px">
132               <input type="radio" name="alive" value="1" {if $smarty.request.alive eq 1}checked="checked"{/if} />Vivant
133             </td>
134             <td style="width:100px">
135               <input type="radio" name="alive" value="2" {if $smarty.request.alive eq 2}checked="checked"{/if} />Décédé
136             </td>
137           </tr>
138         </table>
139       </td>
140     </tr>
141     <tr>
142       <th colspan="2">Géographie</th>
143     </tr>
144     <tr>
145       <td colspan="2">
146       <label for="only_current"><input name="only_current" id="only_current" type="checkbox"{if $smarty.request.only_current} checked="checked"{/if}/>chercher uniquement les adresses où les camarades sont actuellement.</label></td>
147     </tr>
148     <tr>
149       <td>Ville</td>
150       <td><input type="text" name="city" size="32" value="{$smarty.request.city}" /></td>
151     </tr>
152     <tr>
153       <td>Pays</td>
154       <td>
155         <select name="country" onchange="javascript:document.forms.recherche.submit();">
156         {if $smarty.request.country}
157           {assign var="country" value=$smarty.request.country}
158         {else}
159           {assign var="country" value=""}
160         {/if}
161         {geoloc_country country=$country}
162         </select>
163       </td>
164     </tr>
165     <tr>
166       <td>Région ou département</td>
167       <td>
168         <select name="region">
169         {if $smarty.request.region}
170           {assign var="region" value=$smarty.request.region}
171         {else}
172           {assign var="region" value=""}
173         {/if}
174         {if $smarty.request.country neq ""}
175         {geoloc_region country=$smarty.request.country region=$region}
176         {else}
177         <option value=""></option>
178         {/if}
179         </select>
180       </td>
181     </tr>
182     <tr>
183       <th colspan="2">Activité</th>
184     </tr>
185     <tr>
186       <td>Entreprise</td>
187       <td><input type="text" name="entreprise" size="32" value="{$smarty.request.entreprise}" /></td>
188     </tr>
189     <tr>
190       <td>Fonction</td>
191       <td>
192         <select name="fonction">
193           <option value="0"></option>
194           {iterate from=$choix_postes item=cp}
195           <option value="{$cp.id}" {if $smarty.request.fonction eq $cp.id}selected{/if}>
196             {$cp.fonction_fr}
197           </option>
198           {/iterate}
199         </select>
200       </td>
201     </tr>
202     <tr>
203       <td>Poste</td>
204       <td><input type="text" name="poste" size="32" value="{$smarty.request.poste}" /></td>
205     </tr>
206     <tr>
207       <td>Secteur</td>
208       <td>
209         <select name="secteur">
210           <option value="0"></option>
211           {iterate item=cs from=$choix_secteurs}
212           <option value="{$cs.id}" {if $smarty.request.secteur eq $cs.id}selected{/if}>
213             {$cs.label}
214           </option>
215           {/iterate}
216         </select>
217       </td>
218     </tr>
219     <tr>
220       <td>CV contient</td>
221       <td><input type="text" name="cv" size="32" value="{$smarty.request.cv}" /></td>
222     </tr>
223     <tr>
224       <td colspan="2">
225         <input type='checkbox' name='only_referent' {if $smarty.request.only_referent}checked='checked'{/if} />
226         chercher uniquement parmi les camarades se proposant comme référents
227       </td>
228     </tr>
229     <tr>
230       <th colspan="2">Divers</th>
231     </tr>
232     <tr>
233       <td>Nationalité</td>
234       <td>
235         <select name="nationalite">
236           {iterate from=$choix_nats item=cn}
237           <option value="{$cn.id}" {if $smarty.request.nationalite eq $cn.id}selected="selected"{/if}>
238             {$cn.text}
239           </option>
240           {/iterate}
241         </select>
242       </td>
243     </tr>
244     <tr>
245       <td>Binet</td>
246       <td>
247         <select name="binet">
248         <option value="0"></option>
249         {iterate item=cb from=$choix_binets}
250           <option value="{$cb.id}" {if $smarty.request.binet eq $cb.id}selected="selected"{/if}>
251             {$cb.text}
252           </option>
253         {/iterate}
254         </select>
255       </td>
256     </tr>
257     <tr>
258       <td>Groupe X</td>
259       <td>
260         <select name="groupex">
261         <option value="0"></option>
262         {iterate item=cg from=$choix_groupesx}
263           <option value="{$cg.id}" {if $smarty.request.groupex eq $cg.id}selected="selected"{/if}>
264             {$cg.text}
265           </option>
266         {/iterate}
267         </select>
268       </td>
269     </tr>
270     <tr>
271       <td>Section</td>
272       <td>
273         <select name="section">
274           {iterate item=cs from=$choix_sections}
275           <option value="{$cs.id}" {if $smarty.request.section eq $cs.id}selected="selected"{/if}>
276             {$cs.text}
277           </option>
278           {/iterate}
279         </select>
280       </td>
281     </tr>
282     <tr>
283       <td>Formation</td>
284       <td>
285         <select name="school" onchange="javascript:document.forms.recherche.submit();">
286           <option value="0"></option>
287           {iterate item=cs from=$choix_schools}
288           <option value="{$cs.id}" {if $smarty.request.school eq $cs.id}selected="selected"{/if}>
289             {$cs.text}
290           </option>
291           {/iterate}
292         </select>
293       </td>
294     </tr>
295     <tr>
296       <td></td>
297       <td>
298         <select name="diploma">
299           <option value="0"></option>
300           {section name=diploma loop=$choix_diplomas}
301           <option value="{$choix_diplomas[diploma]}" {if $smarty.request.diploma eq
302           $choix_diplomas[diploma]}selected="selected"{/if}>
303             {$choix_diplomas[diploma]}
304           </option>
305           {/section}
306         </select>
307       </td>
308     </tr>
309     <tr>
310       <td>Commentaire contient</td>
311       <td><input type="text" name="free" size="32" value="{$smarty.request.free}" /></td>
312     </tr>
313     <tr>
314       <td colspan="2" style="padding-top: 1.5em">
315         <div style="float: right">
316           <input type="button" value="Chercher" onclick="launch_form('search/adv')"/>
317         </div>
318         {if $smarty.session.auth ge AUTH_COOKIE}
319           <input type='checkbox' name='order' value='date_mod' {if $smarty.request.order eq "date_mod"}checked='checked'{/if} />
320           mettre les fiches modifiées récemment en premier
321         {/if}
322       </td>
323     </tr>
324   </table>
325 </form>
326 <p class="center">
327   <input type="button" value="Voir les résultats sur une carte" onclick="launch_form('geoloc/')"/>
328 </p>
329 <p>
330   <strong>N.B.</strong> Le caractère joker * peut remplacer une ou plusieurs lettres dans les recherches.
331 </p>
332
333 {* vim:set et sw=2 sts=2 sws=2: *}