X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=templates%2Fsearch%2Fadv.form.tpl;h=3aba3c23fa559dc7e8bb1cc833051c3b5a31d921;hb=904a82deab29093fa466256194db8527450efd27;hp=ef19e5a1e1a11e1bc8bf781557a1d760385c4bda;hpb=b536b5ae1e894669fb43d17d467ab1f0da4b75a1;p=platal.git diff --git a/templates/search/adv.form.tpl b/templates/search/adv.form.tpl index ef19e5a..3aba3c2 100644 --- a/templates/search/adv.form.tpl +++ b/templates/search/adv.form.tpl @@ -1,6 +1,6 @@ {**************************************************************************} {* *} -{* Copyright (C) 2003-2007 Polytechnique.org *} +{* Copyright (C) 2003-2008 Polytechnique.org *} {* http://opensource.polytechnique.org/ *} {* *} {* This program is free software; you can redistribute it and/or modify *} @@ -22,14 +22,160 @@

Recherche dans l'annuaire

-
- + } + + // when changing school, open diploma choice + function changeSchool(schoolId) { + $(".autocompleteTarget[@name='school']").attr('value',schoolId); + + if (schoolId) { + $(".autocomplete[@name='schoolTxt']").addClass('hidden_valid'); + + $("[@name='diploma']").parent().load(baseurl + 'list/diploma/', { school:schoolId }, function() { + if ($("select[@name='diploma']").children("option").size() > 1) { + $("select[@name='diploma']").attr('value', '{/literal}{$smarty.request.diploma}{literal}'); + } else { + $("select[@name='diploma']").attr('value', ''); + } + }); + } else { + $(".autocomplete[@name='schoolTxt']").removeClass('hidden_valid'); + + $("select[@name='diploma']").attr('value', ''); + } + } + + // when choosing autocomplete from list, must validate + function select_autocomplete(name) { + nameRealField = name.replace(/Txt$/, ''); + + // nothing to do if field is not a text field for a list + if (nameRealField == name) + return null; + + // if changing country, might want to open region choice + if (nameRealField == 'country') + return function(i) { + changeCountry(i.extra[1]); + } + + if (nameRealField == 'school') + return function(i) { + changeSchool(i.extra[1]); + } + + // change field in list and display text field as valid + return function(i) { + nameRealField = this.field.replace(/Txt$/, ''); + + $(".autocompleteTarget[@name='"+nameRealField+"']").attr('value',i.extra[1]); + + $(".autocomplete[@name='"+this.field+"']").addClass('hidden_valid'); + } + } + + $(document).ready(function() { + $(".autocompleteTarget").hide(); + $(".autocomplete").show().each(function() { + targeted = $("../.autocompleteTarget",this)[0]; + + if (targeted && targeted.value) { + me = $(this); + + $.get(baseurl + 'list/'+ targeted.name +'/'+targeted.value, {},function(textValue) { + me.attr('value', textValue); + me.addClass('hidden_valid'); + }); + } + + $(this).autocomplete(baseurl + "autocomplete/"+this.name,{ + selectOnly:1, + formatItem:make_format_autocomplete(this), + field:this.name, + onItemSelect:select_autocomplete(this.name), + matchSubset:0, + width:$(this).width()}); + }); + + $(".autocomplete").change(function() { $(this).removeClass('hidden_valid'); }); + + $(".autocomplete[@name='countryTxt']").change(function() { changeCountry(''); }); + + changeCountry({/literal}'{$smarty.request.country}'{literal}); + + $(".autocomplete[@name='schoolTxt']").change(function() { changeSchool(''); }); + + changeSchool({/literal}'{$smarty.request.school}'{literal}); + + $(".autocompleteToSelect").each(function() { + var fieldName = $(this).attr('href'); + + $(this).attr('href', baseurl + 'list/'+fieldName).click(function() { + var oldval = $("input.autocompleteTarget[@name='"+fieldName+"']")[0].value; + + $(".autocompleteTarget[@name='"+fieldName+"']").parent().load(baseurl + 'list/'+fieldName,{}, + function(selectBox) { + $(".autocompleteTarget[@name='"+fieldName+"']").remove(); + $(".autocomplete[@name='"+fieldName+"Txt']").remove(); + $("select[@name='"+fieldName+"']").attr('value', oldval); + }); + + return false; + }); + }).parent().find('.autocomplete').change(function() { + // If we change the value in the type="text" field, then the value in the 'integer id' field must not be used, + // to ensure that, we unset it + $(this).parent().find('.autocompleteTarget').val(''); + }); + }); +--> +{/literal} + @@ -75,11 +211,11 @@ -  ET  +  et  @@ -90,31 +226,31 @@
@@ -39,31 +185,21 @@
Nom - - - - {if $smarty.request.name && !$with_soundex && $smarty.request.recherche} - - étendre par proximité sonore - - {/if} + + +
Prénom - - {if $smarty.request.firstname && !$with_soundex && $smarty.request.recherche} - - étendre par proximité sonore - - {/if} +
Surnom - +
- Indifférent + - Homme + - Femme +
- Sur polytechnique.org + Sur Polytechnique.org
- Indifférent + - Inscrit + - Non inscrit +
@@ -126,88 +262,78 @@
- Indifférent + - Vivant + - Décédé +
- Géographie + + + + - - + Géographie - Ville - + Ville ou code postal + Pays - + + + {icon name="table" title="Tous les pays"} - + Région ou département - - {if $smarty.request.region} - {assign var="region" value=$smarty.request.region} - {else} - {assign var="region" value=""} - {/if} - {include file="search/adv.region.form.tpl" country=$smarty.request.country} + + + + + + Activité Entreprise - + Fonction - + + + {icon name="table" title="Toutes les fonctions"} Poste - + Secteur - + + + {icon name="table" title="Tous les secteurs"} @@ -216,8 +342,8 @@ - - chercher uniquement parmi les camarades se proposant comme référents + + @@ -226,94 +352,82 @@ Nationalité - + + + {icon name="table" title="Toutes les nationalités"} Binet - + + + {icon name="table" title="Tous les binets"} Groupe X - + + + {icon name="table" title="Tous les groupes X"} Section - + + + {icon name="table" title="Toutes les sections"} Formation - + + + {icon name="table" title="Toutes les formations"} - - - {include file="search/adv.grade.form.tpl" grade=$smarty.request.diploma} + Diplôme + + Commentaire contient - - -
- -
{if $smarty.session.auth ge AUTH_COOKIE} - - mettre les fiches modifiées récemment en premier + + + + + + + + + + + + {/if} + + + +
-

- -

- N.B. Le caractère joker * peut remplacer une ou plusieurs lettres dans les recherches. + N.B. : le caractère joker * peut remplacer une ou plusieurs lettres dans les recherches.

{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}