X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=templates%2Fsearch%2Fadv.form.tpl;h=6f38815530d6e7e1a2094e6ec11b0297b923699d;hb=166ae27cbb59e826d23b34fc5c73dce3572e8122;hp=ff73a1c77fc078490bea29bef7f07b6684ef4912;hpb=aab2ffddfc8597dfce114b18c737b791e949b6ea;p=platal.git
diff --git a/templates/search/adv.form.tpl b/templates/search/adv.form.tpl
index ff73a1c..6f38815 100644
--- a/templates/search/adv.form.tpl
+++ b/templates/search/adv.form.tpl
@@ -1,6 +1,6 @@
{**************************************************************************}
{* *}
-{* Copyright (C) 2003-2010 Polytechnique.org *}
+{* Copyright (C) 2003-2011 Polytechnique.org *}
{* http://opensource.polytechnique.org/ *}
{* *}
{* This program is free software; you can redistribute it and/or modify *}
@@ -22,155 +22,16 @@
Recherche dans l'annuaire
-
- if (row[1] === "-1") {
- return '…';
- }
-
- camarades = (row[1] > 1) ? "camarades" : "camarade";
-
- return name + ' - ' + 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 {
- $("select[name='region']").attr('value', '');
-
- $("tr#region_ln").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');
- } else {
- $(".autocomplete[name='schoolTxt']").removeClass('hidden_valid');
- }
-
- $("[name='diploma']").parent().load(baseurl + 'list/diploma/', { school:schoolId }, function() {
- $("select[name='diploma']").attr('value', '{/literal}{$smarty.request.diploma}{literal}');
- });
- }
-
- // 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}
[Revenir à la recherche simple]
-
-
- 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: *}