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