Finishes advanced search on addresses to our new geocoding engine (gmaps v3).
[platal.git] / templates / search / adv.form.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 <h1>Recherche dans l'annuaire</h1>
24
25 {if hasPerm('edit_directory,admin') && t($suggestAddresses)}
26 <p class="center"><strong>Voulez-vous télécharger le <a href="{$globals->baseurl}/search/adv/addresses{$plset_args}">tableau des adresses postales</a> pour la recette précédente&nbsp;?</strong></p>
27 {/if}
28
29 <script type="text/javascript">// <!--
30   var baseurl = $.plURL("search/");
31   {literal}
32
33   // display an autocomplete row : blabla (nb of found matches)
34   function make_format_autocomplete(block) {
35     return function(row) {
36         regexp = new RegExp('(' + RegExp.escape(block.value) + ')', 'i');
37
38         name = row[0].htmlEntities().replace(regexp, '<strong>$1<\/strong>');
39
40         if (row[1] === "-1") {
41           return '&hellip;';
42         }
43
44         if (row[1] === "-2") {
45           return '<em>aucun camarade trouvé pour '+row[0].htmlEntities()+'<\/em>';
46         }
47
48         camarades = (row[1] > 1) ? "camarades" : "camarade";
49
50         return name + '<em>&nbsp;&nbsp;-&nbsp;&nbsp;' + row[1].htmlEntities() + '&nbsp;' + camarades + '<\/em>';
51       };
52   }
53
54   function setAddress(i, j, values)
55   {
56     var types = new Array('country', 'administrative_area_level_1', 'administrative_area_level_2', 'administrative_area_level_3', 'locality', 'sublocality');
57     var prev_type = types[i];
58     var next_type = types[j];
59     var next_list = next_type + '_list';
60
61     if (j == 3) {
62       $('tr#locality_text').hide()
63       $("select[name='localityTxt']").attr('value', '');
64     }
65
66     $("[name='" + next_type + "']").parent().load(baseurl + 'list/' + next_type, { previous:prev_type, value:values[i] }, function() {
67       if ($("select[name='" + next_type + "']").children("option").size() > 1) {
68         $("tr#" + next_list).show();
69         $("select[name='" + next_type + "']").attr('value', values[j]);
70         if (j < 6) {
71           setAddress(j, j + 1, values);
72         }
73       } else {
74         $("tr#" + next_list).hide();
75         $("select[name='" + next_type + "']").attr('value', '');
76         if (j < 6) {
77           setAddress(i, j + 1, values);
78         }
79       }
80     });
81
82   }
83
84   function displayNextAddressComponent(i, j, value)
85   {
86     var types = new Array('country', 'administrative_area_level_1', 'administrative_area_level_2', 'administrative_area_level_3', 'locality', 'sublocality');
87     var prev_type = types[i];
88     var next_type = types[j];
89     var next_list = next_type + '_list';
90
91     if (j == 3) {
92       $('tr#locality_text').hide()
93       $("select[name='localityTxt']").attr('value', '');
94     }
95
96     $("[name='" + next_type + "']").parent().load(baseurl + 'list/' + next_type, { previous:prev_type, value:value }, function() {
97       $("select[name='" + next_type + "']").attr('value', '');
98       if ($("select[name='" + next_type + "']").children("option").size() > 1) {
99         $("tr#" + next_list).show();
100       } else {
101         $("tr#" + next_list).hide();
102         if (j < 6) {
103           displayNextAddressComponent(i, j + 1, value);
104         }
105       }
106     });
107   }
108
109   function changeAddressComponents(type, value)
110   {
111     var types = new Array('country', 'administrative_area_level_1', 'administrative_area_level_2', 'administrative_area_level_3', 'locality', 'sublocality');
112     var i = 0, j = 0;
113
114     while (types[i] != type && i < 6) {
115       ++i;
116     }
117
118     j = i + 1;
119     while (j < 6) {
120       $("select[name='" + types[j] + "']").attr('value', '');
121       $("tr#" + types[j] + "_list").hide();
122       ++j;
123     }
124
125     if (value != '' && i < 5) {
126       $("select[name='" + type + "']").attr('value', value);
127       displayNextAddressComponent(i, i + 1, value);
128     }
129   }
130
131   // when changing school, open diploma choice
132   function changeSchool(schoolId) {
133     $(".autocompleteTarget[name='school']").attr('value',schoolId);
134
135     if (schoolId) {
136       $(".autocomplete[name='schoolTxt']").addClass('hidden_valid');
137     } else {
138       $(".autocomplete[name='schoolTxt']").removeClass('hidden_valid');
139     }
140
141     $("[name='diploma']").parent().load(baseurl + 'list/diploma/', { school:schoolId }, function() {
142         $("select[name='diploma']").attr('value', '{/literal}{$smarty.request.diploma}{literal}');
143       });
144   }
145
146   // when checking/unchecking "only_referent", disable/enable some fields
147   function changeOnlyReferent() {
148     if ($("#only_referent").is(':checked')) {
149       $("input[name='entreprise']").attr('disabled', true);
150     } else {
151       $("input[name='entreprise']").removeAttr('disabled');
152     }
153   }
154
155   // when choosing a job term in tree, hide tree and set job term field
156   function searchForJobTerm(treeid, jtid, full_name) {
157     $(".term_tree").remove();
158     $("input[name='jobtermTxt']").val(full_name).addClass("hidden_valid").show();
159     $("input[name='jobterm']").val(jtid);
160   }
161
162   function cancel_autocomplete(field, realfield) {
163     $(".autocomplete[name='"+field+"']").removeClass('hidden_valid').val('').focus();
164     if (typeof(realfield) != "undefined") {
165       $(".autocompleteTarget[name='"+realfield+"']").val('');
166     }
167     return;
168   }
169
170   // when choosing autocomplete from list, must validate
171   function select_autocomplete(name) {
172       nameRealField = name.replace(/Txt$/, '');
173
174       // nothing to do if field is not a text field for a list
175       if (nameRealField == name)
176         return null;
177
178       // When changing country or locality, open next address component.
179       if (nameRealField == 'country' || nameRealField == 'locality') {
180         return function(i) {
181             nameRealField = name.replace(/Txt$/, '');
182             if (i.extra[0] < 0) {
183               cancel_autocomplete(name, nameRealField);
184               i.extra[1] = '';
185             }
186             $("[name='" + nameRealField + "']").parent().load(baseurl + 'list/' + nameRealField, function() {
187               $("select[name='" + nameRealField + "']").attr('value', i.extra[1]);
188             });
189             changeAddressComponents(nameRealField, i.extra[1]);
190           }
191       }
192
193       if (nameRealField == 'school')
194         return function(i) {
195             if (i.extra[0] < 0) {
196               cancel_autocomplete('schoolTxt', 'school');
197               i.extra[1] = '';
198             }
199             changeSchool(i.extra[1]);
200           }
201
202       // change field in list and display text field as valid
203       return function(i) {
204         nameRealField = this.field.replace(/Txt$/, '');
205
206         if (i.extra[0] < 0) {
207           cancel_autocomplete(this.field, nameRealField);
208           return;
209         }
210
211         $(".autocompleteTarget[name='"+nameRealField+"']").attr('value',i.extra[1]);
212
213         $(".autocomplete[name='"+this.field+"']").addClass('hidden_valid');
214       }
215     }
216
217   $(function() {
218       $(".autocompleteTarget").hide();
219       $(".autocomplete").show().each(function() {
220         targeted = $("../.autocompleteTarget",this)[0];
221
222         if (targeted && targeted.value) {
223           me = $(this);
224
225           $.get(baseurl + 'list/'+ targeted.name +'/'+targeted.value, {},function(textValue) {
226             me.attr('value', textValue);
227             me.addClass('hidden_valid');
228           });
229         }
230
231         $(this).autocomplete(baseurl + "autocomplete/"+this.name,{
232           selectOnly:1,
233           formatItem:make_format_autocomplete(this),
234           field:this.name,
235           onItemSelect:select_autocomplete(this.name),
236           matchSubset:0,
237           width:$(this).width()});
238         });
239
240       $(".autocomplete").change(function() { $(this).removeClass('hidden_valid'); });
241
242       if ({/literal}'{$smarty.request.country}'{literal} != '') {
243         $("[name='country']").parent().load(baseurl + 'list/country', function() {
244           $("select[name='country']").attr('value', {/literal}'{$smarty.request.country}'{literal});
245         });
246         setAddress(0, 1, new Array({/literal}'{$smarty.request.country}'{literal},
247                                    {/literal}'{$smarty.request.administrative_area_level_1}'{literal},
248                                    {/literal}'{$smarty.request.administrative_area_level_2}'{literal},
249                                    {/literal}'{$smarty.request.administrative_area_level_3}'{literal},
250                                    {/literal}'{$smarty.request.locality}'{literal},
251                                    {/literal}'{$smarty.request.sublocality}'{literal})
252         );
253       } else {
254         var types = new Array('administrative_area_level_1', 'administrative_area_level_2', 'administrative_area_level_3', 'locality', 'sublocality');
255         for (var i = 0; i < 5; ++i) {
256           $("tr#" + types[i] + '_list').hide();
257         }
258       }
259
260       $(".autocomplete[name='schoolTxt']").change(function() { changeSchool(''); });
261
262       changeSchool({/literal}'{$smarty.request.school}'{literal});
263
264       $(".autocompleteToSelect").each(function() {
265           var fieldName = $(this).attr('href');
266
267           $(this).attr('href', baseurl + 'list/'+fieldName).click(function() {
268               var oldval = $("input.autocompleteTarget[name='"+fieldName+"']")[0].value;
269
270               $(".autocompleteTarget[name='"+fieldName+"']").parent().load(baseurl + 'list/'+fieldName,{},
271                 function(selectBox) {
272                   $(".autocompleteTarget[name='"+fieldName+"']").remove();
273                   $(".autocomplete[name='"+fieldName+"Txt']").remove();
274                   $("select[name='"+fieldName+"']").attr('value', oldval);
275                 });
276
277               return false;
278             });
279         }).parent().find('.autocomplete').change(function() {
280           // If we change the value in the type="text" field, then the value in the 'integer id' field must not be used,
281           // to ensure that, we unset it
282           $(this).parent().find('.autocompleteTarget').val('');
283         });
284
285       $("#only_referent").change(function() { changeOnlyReferent(); });
286
287     });
288 /** Regexps to wipe out from search queries */
289 var default_form_values = [ /&woman=0(&|$)/, /&subscriber=0(&|$)/, /&alive=0(&|$)/, /&egal[12]=[^&]*&promo[12]=(&|$)/g, /&networking_type=0(&|$)/, /&[^&=]+=(&|$)/g ];
290 /** Uses javascript to clean form from all empty fields */
291 function cleanForm(f) {
292   var query = $(f).formSerialize();
293   var old_query;
294   for (var i in default_form_values) {
295     var reg = default_form_values[i];
296     if (typeof(reg) != "undefined") {
297       do {
298         old_query = query;
299         query = query.replace(reg, '$1');
300       } while (old_query != query);
301     }
302   }
303   query = query.replace(/^&*(.*)&*$/, '$1');
304   if (query == "rechercher=Chercher") {
305     alert("Aucun critère n'a été spécifié");
306     return false;
307   }
308   document.location = baseurl + 'adv?' + query;
309   return false;
310 }
311 -->
312 {/literal}</script>
313 <p class="center">[<a href="search">Revenir à la recherche simple</a>]</p>
314 <form id="recherche" action="search/adv" method="get" onsubmit="return cleanForm(this)">
315   <table class="bicol" cellpadding="3" summary="Recherche">
316     <tr>
317       <th colspan="2">
318         Recherche avancée
319       </th>
320     </tr>
321     <tr>
322       <td>Nom, prénom, surnom...</td>
323       <td>
324         <input type="hidden" name="rechercher" value="Chercher"/>
325         <input type="submit" style="display:none"/>
326         <input type="text" name="name" size="32" value="{$smarty.request.name}" />
327         <select name="name_type">
328           <option value="" {if $smarty.request.name_type eq ''}selected="selected"{/if}>&nbsp;-&nbsp;</option>
329           <option value="lastname" {if $smarty.request.name_type eq 'lastname'}selected="selected"{/if}>nom</option>
330           <option value="firstname" {if $smarty.request.name_type eq 'firstname'}selected="selected"{/if}>prénom</option>
331           <option value="nickname" {if $smarty.request.name_type eq 'nickname'}selected="selected"{/if}>surnom</option>
332         </select>
333       </td>
334     </tr>
335     <tr>
336       <td>Promotion</td>
337       <td>
338         <script type="text/javascript">/*<![CDATA[*/
339           {literal}
340           function updatepromofields(egal1) {
341             var f = egal1.form;
342             f.egal2.disabled = f.promo2.disabled = egal1.value == '=';
343             f.egal2.readOnly = true;
344             if (f.egal1.value == '>=') {
345               f.egal2.value = '<=';
346             } else {
347               f.egal2.value = '>=';
348             }
349           }
350           $(function() { updatepromofields($('select[name=egal1]')[0]); });
351           {/literal}
352         /*]]>*/</script>
353         <select name="egal1" onchange="updatepromofields(this)" style="text-align:center">
354           <option value="=" {if $smarty.request.egal1 eq "="}selected="selected"{/if}>&nbsp;=&nbsp;</option>
355           <option value="&gt;=" {if $smarty.request.egal1 eq "&gt;="}selected="selected"{/if}>&nbsp;&gt;=&nbsp;</option>
356           <option value="&lt;=" {if $smarty.request.egal1 eq "&lt;="}selected="selected"{/if}>&nbsp;&lt;=&nbsp;</option>
357         </select>
358         <input type="text" name="promo1" size="4" maxlength="4" value="{$smarty.request.promo1}" />
359         &nbsp;et&nbsp;
360         <input type="text" name="egal2" size="1" style="text-align:center" value="{if t($smarty.request.egal2) eq '&lt;'}&lt;{else}&gt;{/if}" readonly="readonly" />
361         <input type="text" name="promo2" size="4" maxlength="4" value="{$smarty.request.promo2}" />
362         <select name="edu_type" style="text-align:center">
363           <option value="{#UserFilter::GRADE_ING#}" {if $smarty.request.edu_type eq #UserFilter::GRADE_ING#}selected="selected"{/if}>X</option>
364           <option value="{#UserFilter::GRADE_MST#}" {if $smarty.request.edu_type eq #UserFilter::GRADE_MST#}selected="selected"{/if}>Master</option>
365           <option value="{#UserFilter::GRADE_PHD#}" {if $smarty.request.edu_type eq #UserFilter::GRADE_PHD#}selected="selected"{/if}>Docteur</option>
366         </select>
367       </td>
368     </tr>
369     <tr>
370       <td>Sexe</td>
371       <td>
372         <table>
373           <tr>
374             <td style="width:100px">
375               <input type="radio" name="woman" value="0" {if !$smarty.request.woman}checked="checked"{/if} id="woman0"/><label for="woman0">indifférent</label>
376             </td>
377             <td style="width:100px">
378               <input type="radio" name="woman" value="1" {if $smarty.request.woman eq 1}checked="checked"{/if} id="woman1"/><label for="woman1">homme</label>
379             </td>
380             <td style="width:100px">
381               <input type="radio" name="woman" value="2" {if $smarty.request.woman eq 2}checked="checked"{/if} id="woman2"/><label for="woman2">femme</label>
382             </td>
383           </tr>
384         </table>
385       </td>
386     </tr>
387     <tr>
388       <td>Sur Polytechnique.org</td>
389       <td>
390         <table>
391           <tr>
392             <td style="width:100px">
393               <input type="radio" name="subscriber" value="0" {if !$smarty.request.subscriber}checked="checked"{/if} id="subscriber0"/><label for="subscriber0">indifférent</label>
394             </td>
395             <td style="width:100px">
396               <input type="radio" name="subscriber" value="1" {if $smarty.request.subscriber eq 1}checked="checked"{/if} id="subscriber1"/><label for="subscriber1">inscrit</label>
397             </td>
398             <td style="width:100px">
399               <input type="radio" name="subscriber" value="2" {if $smarty.request.subscriber eq 2}checked="checked"{/if} id="subscriber2"/><label for="subscriber2">non inscrit</label>
400             </td>
401           </tr>
402         </table>
403       </td>
404     </tr>
405     <tr>
406       <td>A une redirection active</td>
407       <td>
408         <table>
409           <tr>
410             <td style="width:100px">
411               <input type="radio" name="has_email_redirect" value="0" {if !$smarty.request.has_email_redirect}checked="checked"{/if}
412                 id="has_email_redirect0" /><label for="has_email_redirect0">indifférent</label>
413             </td>
414             <td style="width:100px">
415               <input type="radio" name="has_email_redirect" value="1" {if $smarty.request.has_email_redirect eq 1}checked="checked"{/if}
416                 id="has_email_redirect1" /><label for="has_email_redirect1">oui</label>
417             </td>
418             <td style="width:100px">
419               <input type="radio" name="has_email_redirect" value="2" {if $smarty.request.has_email_redirect eq 2}checked="checked"{/if}
420                 id="has_email_redirect2" /><label for="has_email_redirect2">non</label>
421             </td>
422           </tr>
423         </table>
424       </td>
425     </tr>
426     <tr>
427       <td>En vie</td>
428       <td>
429         <table>
430           <tr>
431             <td style="width:100px">
432               <input type="radio" name="alive" value="0" {if !$smarty.request.alive}checked="checked"{/if} id="alive0"/><label for="alive0">indifférent</label>
433             </td>
434             <td style="width:100px">
435               <input type="radio" name="alive" value="1" {if $smarty.request.alive eq 1}checked="checked"{/if} id="alive1"/><label for="alive1">vivant</label>
436             </td>
437             <td style="width:100px">
438               <input type="radio" name="alive" value="2" {if $smarty.request.alive eq 2}checked="checked"{/if} id="alive2"/><label for="alive2">décédé</label>
439             </td>
440           </tr>
441         </table>
442       </td>
443     </tr>
444     <tr>
445       <td colspan="2">
446         <input type="checkbox" name="with_soundex" value="1" {if $smarty.request.with_soundex}checked="checked"{/if} id="sdxn" />
447         <label for="sdxn">Étendre par proximité sonore (uniquement sur nom et prénom).</label>
448       </td>
449     </tr>
450     <tr>
451       <th colspan="2">Géographie</th>
452     </tr>
453     <tr>
454       <td>Pays</td>
455       <td>
456         <input name="countryTxt" type="text" class="autocomplete" style="display:none" size="32"
457                value="{$smarty.request.countryTxt}"/>
458         <input name="country" class="autocompleteTarget" type="hidden" value="{$smarty.request.country}"/>
459         <a href="country" class="autocompleteToSelect">{icon name="table" title="Tous les pays"}</a>
460       </td>
461     </tr>
462     <tr id="administrative_area_level_1_list">
463       <td>Région, province, état&hellip;</td>
464       <td>
465         <input name="administrative_area_level_1" type="hidden" size="32" value="{$smarty.request.administrative_area_level_1}" />
466       </td>
467     </tr>
468     <tr id="administrative_area_level_2_list">
469       <td>Département, comté&hellip;</td>
470       <td>
471         <input name="administrative_area_level_2" type="hidden" size="32" value="{$smarty.request.administrative_area_level_2}" />
472       </td>
473     </tr>
474     <tr id="administrative_area_level_3_list">
475       <td>Canton&hellip;</td>
476       <td>
477         <input name="administrative_area_level_3" type="hidden" size="32" value="{$smarty.request.administrative_area_level_3}" />
478       </td>
479     </tr>
480     <tr id="locality_text">
481       <td>Ville</td>
482       <td><input type="text" class="autocomplete" name="localityTxt" size="32" value="{$smarty.request.locality}" /></td>
483     </tr>
484     <tr id="locality_list">
485       <td>Ville</td>
486       <td>
487         <input name="locality" type="hidden" size="32" value="{$smarty.request.locality}" />
488       </td>
489     </tr>
490     <tr id="sublocality_list">
491       <td>Arrondissement, quartier&hellip;</td>
492       <td>
493         <input name="sublocality" type="hidden" size="32" value="{$smarty.request.sublocality}" />
494       </td>
495     </tr>
496     <tr>
497       <td colspan="2">
498         <label for="only_current">
499           <input name="only_current" id="only_current" type="checkbox"{if $smarty.request.only_current} checked="checked"{/if}/>
500           Chercher uniquement les adresses où les camarades sont actuellement.
501         </label>
502       </td>
503     </tr>
504     <tr>
505       <th colspan="2">Activité</th>
506     </tr>
507     <tr>
508       <td>Entreprise</td>
509       <td><input type="text" class="autocomplete" name="entreprise" size="32" value="{$smarty.request.entreprise}" /></td>
510     </tr>
511     <tr>
512       <td>Description</td>
513       <td><input type="text" class="autocomplete" name="jobdescription" size="32" value="{$smarty.request.jobdescription}" /></td>
514     </tr>
515     <tr>
516       <td>Mots-clefs</td>
517       <td>
518         <input name="jobtermTxt" type="text" class="autocomplete{if $smarty.request.jobterm} hidden_valid{/if}" style="display:none" size="32"
519                value="{$smarty.request.jobtermTxt}"/>
520         <input name="jobterm" class="autocompleteTarget" type="hidden" value="{$smarty.request.jobterm}"/>
521         <a href="jobterm" class="autocompleteToSelect">{icon name="table" title="Tous les mots-clefs"}</a>
522       </td>
523     </tr>
524     {if hasPerm('directory_private')}
525     <tr>
526       <td>CV contient</td>
527       <td><input type="text" name="cv" size="32" value="{$smarty.request.cv}" /></td>
528     </tr>
529     {/if}
530     <tr>
531       <td colspan="2">
532         <input type='checkbox' name='only_referent' {if $smarty.request.only_referent}checked='checked'{/if} id="only_referent"/>
533         <label for="only_referent">Chercher uniquement parmi les camarades se proposant comme référents.</label>
534       </td>
535     </tr>
536     <tr>
537       <th colspan="2">Divers</th>
538     </tr>
539     <tr>
540       <td>Nationalité</td>
541       <td>
542         <input name="nationaliteTxt" type="text" class="autocomplete" style="display:none" size="32"
543                value="{$smarty.request.nationaliteTxt}"/>
544         <input name="nationalite" class="autocompleteTarget" type="hidden" value="{$smarty.request.nationalite}"/>
545         <a href="nationalite" class="autocompleteToSelect">{icon name="table" title="Toutes les nationalités"}</a>
546       </td>
547     </tr>
548     {if hasPerm('directory_private')}
549     <tr>
550       <td>Binet</td>
551       <td>
552         <input name="binetTxt" type="text" class="autocomplete" style="display:none" size="32"
553                value="{$smarty.request.binetTxt}"/>
554         <input name="binet" class="autocompleteTarget" type="hidden" value="{$smarty.request.binet}"/>
555         <a href="binet" class="autocompleteToSelect">{icon name="table" title="Tous les binets"}</a>
556       </td>
557     </tr>
558     {/if}
559     <tr>
560       <td>Groupe X</td>
561       <td>
562         <input name="groupexTxt" type="text" class="autocomplete" style="display:none" size="32"
563                value="{$smarty.request.groupexTxt}"/>
564         <input name="groupex" class="autocompleteTarget" type="hidden" value="{$smarty.request.groupex}"/>
565         <a href="groupex" class="autocompleteToSelect">{icon name="table" title="Tous les groupes X"}</a>
566       </td>
567     </tr>
568     {if hasPerm('directory_private')}
569     <tr>
570       <td>Section</td>
571       <td>
572         <input name="sectionTxt" type="text" class="autocomplete" style="display:none" size="32"
573                value="{$smarty.request.sectionTxt}"/>
574         <input name="section" class="autocompleteTarget" type="hidden" value="{$smarty.request.section}"/>
575         <a href="section" class="autocompleteToSelect">{icon name="table" title="Toutes les sections"}</a>
576       </td>
577     </tr>
578     {/if}
579     <tr>
580       <td>Formation</td>
581       <td>
582         <input name="schoolTxt" type="text" class="autocomplete" style="display:none" size="32"
583                value="{$smarty.request.schoolTxt}"/>
584         <input name="school" class="autocompleteTarget" type="hidden" value="{$smarty.request.school}"/>
585         <a href="school" class="autocompleteToSelect">{icon name="table" title="Toutes les formations"}</a>
586       </td>
587     </tr>
588     <tr>
589       <td>Diplôme</td>
590       <td>
591         <input name="diploma" size="32" value="{$smarty.request.diploma}"/>
592       </td>
593     </tr>
594     <tr>
595       <td>Corps d'origine</td>
596       <td>
597         <select name="origin_corps">
598         {foreach from=$origin_corps_list key=id item=corps}
599           <option value="{$id}" {if $smarty.request.origin_corps eq $id}selected="selected"{/if}>{$corps}</option>
600         {/foreach}
601         </select>
602       </td>
603     </tr>
604     <tr>
605       <td>Corps actuel</td>
606       <td>
607         <select name="current_corps">
608         {foreach from=$current_corps_list key=id item=corps}
609           <option value="{$id}" {if $smarty.request.current_corps eq $id}selected="selected"{/if}>{$corps}</option>
610         {/foreach}
611         </select>
612       </td>
613     </tr>
614     <tr>
615       <td>Grade</td>
616       <td>
617         <select name="corps_rank">
618         {foreach from=$corps_rank_list key=id item=corps}
619           <option value="{$id}" {if $smarty.request.corps_rank eq $id}selected="selected"{/if}>{$corps}</option>
620         {/foreach}
621         </select>
622       </td>
623     </tr>
624     <tr>
625       <td>Commentaire contient</td>
626       <td><input type="text" name="free" size="32" value="{$smarty.request.free}" /></td>
627     </tr>
628     <tr>
629       <td>Numéro de téléphone</td>
630       <td><input type="text" name="phone_number" size="32" value="{$smarty.request.phone_number}"/></td>
631     </tr>
632     <tr>
633       <td style="vertical-align: middle">
634         <span>Networking et sites webs</span>
635       </td>
636       <td>
637         <table>
638           <tr>
639             <td style="padding-left: 0px;">
640               <input type="text" name="networking_address" size="32" value="{$smarty.request.networking_address}" />
641             </td>
642             <td>
643               <select name="networking_type">
644               {foreach from=$networking_types key=id item=network}
645                 <option value="{$id}" {if $smarty.request.networking_type eq $id}selected="selected"{/if}>{$network}</option>
646               {/foreach}
647               </select>
648             </td>
649           </tr>
650         </table>
651       </td>
652     </tr>
653         {if hasPerm('admin,edit_directory')}
654     <tr>
655       <td>Matricule AX</td>
656       <td>
657         <textarea name="schoolid_ax" rows="10" cols="12">{$smarty.request.schoolid_ax}</textarea>
658         <br />
659         <i>Entrer une liste de matricules AX (un par ligne)</i>
660       </td>
661         {/if}
662         {if $smarty.session.auth ge AUTH_COOKIE}
663     </tr>
664     <tr>
665       <td colspan="2">
666           <input type='checkbox' name='order' value='date_mod' {if $smarty.request.order eq "date_mod"}checked='checked'{/if} id="order"/>
667           <label for="order">Mettre les fiches modifiées récemment en premier.</label>
668       </td>
669     </tr>
670     <tr>
671       <td colspan="2">
672            <input type='checkbox' name='exact' id="exact" {if $smarty.request.exact}checked='checked'{/if} value='1'/>
673            <label for="exact">Faire une recherche exacte.</label>
674       </td>
675     </tr>
676         {/if}
677     <tr><td colspan="2"></td></tr>
678     <tr>
679       <td colspan="2" style="text-align: center">
680           <input type="submit" value="Chercher" />
681       </td>
682     </tr>
683   </table>
684 </form>
685
686 {* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}