{**************************************************************************}
{* *}
-{* 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 *}
<h1>Recherche dans l'annuaire</h1>
-{javascript name="jquery"}
-{javascript name="jquery.autocomplete"}
-<script type="text/javascript">// <!--
- var baseurl = "{#globals.baseurl#}/search/";
- {literal}
- // display an autocomplete row : blabla (nb of found matches)
- function format_autocomplete(row) {
- if (row[1] == 1) {
- return row[0];
- }
- return row[0] + ' ('+ row[1] + ')';
+<script type="text/javascript">// <!--
+ var baseurl = platal_baseurl + "search/";
+ {literal}
+ // display an autocomplete row : blabla (nb of found matches)
+ function make_format_autocomplete(block) {
+ return function(row) {
+ regexp = new RegExp('(' + RegExp.escape(block.value) + ')', 'i');
+
+ name = row[0].replace(regexp, '<strong>$1<\/strong>');
+
+ if (row[1] === "-1") {
+ return '...';
}
-
- // when changing country, open up region choice
- function changeCountry(a2) {
- $(".autocompleteTarget[@name='country']").attr('value',a2);
- if (a2) {
- $(".autocomplete[@name='countryTxt']").addClass('hidden_valid');
- $("[@name='region']").parent().load(baseurl + 'list/region/', { country:a2 }, function() {
- if ($("select[@name='region']").children("option").size() > 1) {
- $("select[@name='region']").attr('value', '{/literal}{$smarty.request.region}{literal}').show();
- } else {
- $("select[@name='region']").attr('value', '').hide();
- }
- });
+
+ return name + '<em> - ' + row[1] + ' camarades<\/em>';
+ };
+ }
+
+ // when changing country, open up region choice
+ function changeCountry(a2) {
+ $(".autocompleteTarget[@name='country']").attr('value',a2);
+
+ if (a2) {
+ $(".autocomplete[@name='countryTxt']").addClass('hidden_valid');
+
+ $("[@name='region']").parent().load(baseurl + 'list/region/', { country:a2 }, function() {
+ if ($("select[@name='region']").children("option").size() > 1) {
+ $("select[@name='region']").attr('value', '{/literal}{$smarty.request.region}{literal}');
+
+ $("tr#region_ln").show();
} else {
- $(".autocomplete[@name='countryTxt']").removeClass('hidden_valid');
- $("select[@name='region']").attr('value', '').hide();
+ $("select[@name='region']").attr('value', '');
+
+ $("tr#region_ln").hide();
}
- }
-
- // 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', '').hide();
- }
- });
+ });
+ } else {
+ $(".autocomplete[@name='countryTxt']").removeClass('hidden_valid');
+
+ $("select[@name='region']").attr('value', '');
+
+ $("tr#region_ln").hide();
+ }
+ }
+
+ // 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}');
+
+ $("tr#diploma_ln").show();
} else {
- $(".autocomplete[@name='schoolTxt']").removeClass('hidden_valid');
- $("select[@name='diploma']").attr('value', '').hide();
+ $("select[@name='diploma']").attr('value', '');
+
+ $("tr#diploma_ln").hide();
}
- }
-
- // 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');
- }
+ });
+ } else {
+ $(".autocomplete[@name='schoolTxt']").removeClass('hidden_valid');
+
+ $("select[@name='diploma']").attr('value', '');
+
+ $("tr#diploma_ln").hide();
+ }
+ }
+
+ // 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]);
}
- $(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:format_autocomplete,
- 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;
+
+ 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;
});
- -->
+ });
+ });
+-->
{/literal}</script>
<form id="recherche" action="search/adv" method="get">
<table class="bicol" cellpadding="3" summary="Recherche">
<option value="<=" {if $smarty.request.egal1 eq "<="}selected="selected"{/if}> <= </option>
</select>
<input type="text" name="promo1" size="4" maxlength="4" value="{$smarty.request.promo1}" />
- ET
+ et
<select name="egal2">
<option value="=" {if $smarty.request.egal2 eq "="}selected="selected"{/if}> = </option>
<option value=">=" {if $smarty.request.egal2 eq ">="}selected="selected"{/if}> >= </option>
<table>
<tr>
<td style="width:100px">
- <input type="radio" name="woman" value="0" {if !$smarty.request.woman}checked="checked"{/if} id="woman0"/><label for="woman0">Indifférent</label>
+ <input type="radio" name="woman" value="0" {if !$smarty.request.woman}checked="checked"{/if} id="woman0"/><label for="woman0">indifférent</label>
</td>
<td style="width:100px">
- <input type="radio" name="woman" value="1" {if $smarty.request.woman eq 1}checked="checked"{/if} id="woman1"/><label for="woman1">Homme</label>
+ <input type="radio" name="woman" value="1" {if $smarty.request.woman eq 1}checked="checked"{/if} id="woman1"/><label for="woman1">homme</label>
</td>
<td style="width:100px">
- <input type="radio" name="woman" value="2" {if $smarty.request.woman eq 2}checked="checked"{/if} id="woman2"/><label for="woman2">Femme</label>
+ <input type="radio" name="woman" value="2" {if $smarty.request.woman eq 2}checked="checked"{/if} id="woman2"/><label for="woman2">femme</label>
</td>
</tr>
</table>
</td>
</tr>
<tr>
- <td>Sur polytechnique.org</td>
+ <td>Sur Polytechnique.org</td>
<td>
<table>
<tr>
<td style="width:100px">
- <input type="radio" name="subscriber" value="0" {if !$smarty.request.subscriber}checked="checked"{/if} id="subscriber0"/><label for="subscriber0">Indifférent</label>
+ <input type="radio" name="subscriber" value="0" {if !$smarty.request.subscriber}checked="checked"{/if} id="subscriber0"/><label for="subscriber0">indifférent</label>
</td>
<td style="width:100px">
- <input type="radio" name="subscriber" value="1" {if $smarty.request.subscriber eq 1}checked="checked"{/if} id="subscriber1"/><label for="subscriber1">Inscrit</label>
+ <input type="radio" name="subscriber" value="1" {if $smarty.request.subscriber eq 1}checked="checked"{/if} id="subscriber1"/><label for="subscriber1">inscrit</label>
</td>
<td style="width:100px">
- <input type="radio" name="subscriber" value="2" {if $smarty.request.subscriber eq 2}checked="checked"{/if} id="subscriber2"/><label for="subscriber2">Non inscrit</label>
+ <input type="radio" name="subscriber" value="2" {if $smarty.request.subscriber eq 2}checked="checked"{/if} id="subscriber2"/><label for="subscriber2">non inscrit</label>
</td>
</tr>
</table>
<table>
<tr>
<td style="width:100px">
- <input type="radio" name="alive" value="0" {if !$smarty.request.alive}checked="checked"{/if} id="alive0"/><label for="alive0">Indifférent</label>
+ <input type="radio" name="alive" value="0" {if !$smarty.request.alive}checked="checked"{/if} id="alive0"/><label for="alive0">indifférent</label>
</td>
<td style="width:100px">
- <input type="radio" name="alive" value="1" {if $smarty.request.alive eq 1}checked="checked"{/if} id="alive1"/><label for="alive1">Vivant</label>
+ <input type="radio" name="alive" value="1" {if $smarty.request.alive eq 1}checked="checked"{/if} id="alive1"/><label for="alive1">vivant</label>
</td>
<td style="width:100px">
- <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>
+ <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>
</td>
</tr>
</table>
<tr>
<td colspan="2">
<input type="checkbox" name="with_soundex" value="1" {if $smarty.request.with_soundex}checked="checked"{/if} id="sdxn" />
- <label for="sdxn">étendre par proximité sonore (uniquement sur nom et prénom)</label>
+ <label for="sdxn">Ã\89tendre par proximité sonore (uniquement sur nom et prénom).</label>
</td>
</tr>
<tr>
<tr>
<td>Pays</td>
<td>
- <input name="countryTxt" type="text" class="autocomplete" style="display:none" size="32"/>
+ <input name="countryTxt" type="text" class="autocomplete" style="display:none" size="32"
+ value="{$smarty.request.countryTxt}"/>
<input name="country" class="autocompleteTarget" type="hidden" value="{$smarty.request.country}"/>
<a href="country" class="autocompleteToSelect">{icon name="table" title="Tous les pays"}</a>
</td>
</tr>
- <tr>
+ <tr id="region_ln">
<td>Région ou département</td>
<td>
<input name="region" type="hidden" size="32" value="{$smarty.request.region}"/>
<tr>
<td colspan="2">
<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>
+checked="checked"{/if}/>Chercher uniquement les adresses où les camarades sont actuellement.</label></td>
</tr>
<tr>
<th colspan="2">Activité</th>
<tr>
<td>Fonction</td>
<td>
- <input name="fonctionTxt" type="text" class="autocomplete" style="display:none" size="32"/>
+ <input name="fonctionTxt" type="text" class="autocomplete" style="display:none" size="32"
+ value="{$smarty.request.fonctionTxt}"/>
<input name="fonction" class="autocompleteTarget" type="hidden" value="{$smarty.request.fonction}"/>
<a href="fonction" class="autocompleteToSelect">{icon name="table" title="Toutes les fonctions"}</a>
</td>
<tr>
<td>Secteur</td>
<td>
- <input name="secteurTxt" type="text" class="autocomplete" style="display:none" size="32"/>
+ <input name="secteurTxt" type="text" class="autocomplete" style="display:none" size="32"
+ value="{$smarty.request.secteurTxt}"/>
<input name="secteur" class="autocompleteTarget" type="hidden" value="{$smarty.request.secteur}"/>
<a href="secteur" class="autocompleteToSelect">{icon name="table" title="Tous les secteurs"}</a>
</td>
<tr>
<td colspan="2">
<input type='checkbox' name='only_referent' {if $smarty.request.only_referent}checked='checked'{/if} id="only_referent"/>
- <label for="only_referent">chercher uniquement parmi les camarades se proposant comme référents</label>
+ <label for="only_referent">Chercher uniquement parmi les camarades se proposant comme référents.</label>
</td>
</tr>
<tr>
<tr>
<td>Nationalité</td>
<td>
- <input name="nationaliteTxt" type="text" class="autocomplete" style="display:none" size="32"/>
+ <input name="nationaliteTxt" type="text" class="autocomplete" style="display:none" size="32"
+ value="{$smarty.request.nationaliteTxt}"/>
<input name="nationalite" class="autocompleteTarget" type="hidden" value="{$smarty.request.nationalite}"/>
<a href="nationalite" class="autocompleteToSelect">{icon name="table" title="Toutes les nationalités"}</a>
</td>
<tr>
<td>Binet</td>
<td>
- <input name="binetTxt" type="text" class="autocomplete" style="display:none" size="32"/>
+ <input name="binetTxt" type="text" class="autocomplete" style="display:none" size="32"
+ value="{$smarty.request.binetTxt}"/>
<input name="binet" class="autocompleteTarget" type="hidden" value="{$smarty.request.binet}"/>
<a href="binet" class="autocompleteToSelect">{icon name="table" title="Tous les binets"}</a>
</td>
<tr>
<td>Groupe X</td>
<td>
- <input name="groupexTxt" type="text" class="autocomplete" style="display:none" size="32"/>
+ <input name="groupexTxt" type="text" class="autocomplete" style="display:none" size="32"
+ value="{$smarty.request.groupexTxt}"/>
<input name="groupex" class="autocompleteTarget" type="hidden" value="{$smarty.request.groupex}"/>
<a href="groupex" class="autocompleteToSelect">{icon name="table" title="Tous les groupes X"}</a>
</td>
<tr>
<td>Section</td>
<td>
- <input name="sectionTxt" type="text" class="autocomplete" style="display:none" size="32"/>
+ <input name="sectionTxt" type="text" class="autocomplete" style="display:none" size="32"
+ value="{$smarty.request.sectionTxt}"/>
<input name="section" class="autocompleteTarget" type="hidden" value="{$smarty.request.section}"/>
<a href="section" class="autocompleteToSelect">{icon name="table" title="Toutes les sections"}</a>
</td>
<tr>
<td>Formation</td>
<td>
- <input name="schoolTxt" type="text" class="autocomplete" style="display:none" size="32"/>
+ <input name="schoolTxt" type="text" class="autocomplete" style="display:none" size="32"
+ value="{$smarty.request.schoolTxt}"/>
<input name="school" class="autocompleteTarget" type="hidden" value="{$smarty.request.school}"/>
<a href="school" class="autocompleteToSelect">{icon name="table" title="Toutes les formations"}</a>
</td>
</tr>
- <tr>
+ <tr id="diploma_ln">
<td>Diplôme</td>
<td>
<input name="diploma" type="hidden" size="32" value="{$smarty.request.diploma}"/>
<td><input type="text" name="free" size="32" value="{$smarty.request.free}" /></td>
</tr>
<tr>
- <td colspan="2" style="padding-top: 1.5em">
- <div style="float: right">
- <input type="button" value="Chercher" />
- </div>
+ <td>Numéro de téléphone</td>
+ <td><input type="text" name="phone_number" size="32" value="{$smarty.request.phone_number}"/></td>
+ </tr>
+ <tr>
+ <td style="vertical-align: middle">
+ <span>Networking et sites webs</span>
+ </td>
+ <td>
+ <table>
+ <tr>
+ <td style="padding-left: 0px;">
+ <input type="text" name="networking_address" size="32" value="{$smarty.request.networking_address}" />
+ </td>
+ <td>
+ <input type="text" name="networking_typeTxt" class="autocomplete" size="10" value="{$smarty.request.networking_typeTxt}" />
+ <input name="networking_type" class="autocompleteTarget" type="hidden" value="{$smarty.request.networking_type}"/>
+ <a href="networking_type" class="autocompleteToSelect">{icon name="table" title="Tous les types d'adresse"}</a>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
{if $smarty.session.auth ge AUTH_COOKIE}
+ <tr>
+ <td colspan="2">
<input type='checkbox' name='order' value='date_mod' {if $smarty.request.order eq "date_mod"}checked='checked'{/if} id="order"/>
- <label for="order">mettre les fiches modifiées récemment en premier</label>
+ <label for="order">Mettre les fiches modifiées récemment en premier.</label>
+ </td>
+ </tr>
{/if}
+ <tr><td colspan="2"></td></tr>
+ <tr>
+ <td colspan="2" style="text-align: center">
+ <input type="submit" value="Chercher" />
</td>
</tr>
</table>
</form>
<p>
- <strong>N.B.</strong> Le caractère joker * peut remplacer une ou plusieurs lettres dans les recherches.
+ <small><strong>N.B. :</strong> le caractère joker * peut remplacer une ou plusieurs lettres dans les recherches.</small>
</p>
{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}