From 222195aa503167e7c2f323f642d643d4acd11bcf Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rapha=C3=ABl=20Barrois?= Date: Sun, 10 Jul 2011 23:35:07 +0200 Subject: [PATCH] Fix deltaten. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Raphaël Barrois --- htdocs/javascript/search.js | 4 +- include/ufbuilder.inc.php | 9 +- modules/deltaten.php | 1 + templates/deltaten/index.tpl | 266 +++--------------------------------------- templates/search/adv.form.tpl | 2 +- 5 files changed, 24 insertions(+), 258 deletions(-) diff --git a/htdocs/javascript/search.js b/htdocs/javascript/search.js index dc11a4c..798c97e 100644 --- a/htdocs/javascript/search.js +++ b/htdocs/javascript/search.js @@ -123,7 +123,7 @@ function display_list(field_name) var default_form_values = [ /&woman=0(&|$)/, /&subscriber=0(&|$)/, /&alive=0(&|$)/, /&egal[12]=[^&]*&promo[12]=(&|$)/g, /&networking_type=0(&|$)/, /&[^&=]+=(&|$)/g ]; /** Uses javascript to clean form from all empty fields */ -function cleanForm(f) +function cleanForm(f, targeturl) { var query = $(f).formSerialize(); var old_query; @@ -141,7 +141,7 @@ function cleanForm(f) alert("Aucun critère n'a été spécifié."); return false; } - document.location = baseurl + 'adv?' + query; + document.location = targeturl + '?' + query; return false; } diff --git a/include/ufbuilder.inc.php b/include/ufbuilder.inc.php index bb0a33a..1543b15 100644 --- a/include/ufbuilder.inc.php +++ b/include/ufbuilder.inc.php @@ -411,11 +411,10 @@ class UFB_DeltaTenSearch extends UserFilterBuilder $fields = array( new UFBF_DeltaTenMessage('deltaten_message'), - new UFBF_Town('city', 'Ville / Code Postal'), - new UFBF_Country('countryTxt', 'country', 'Pays'), - new UFBF_AdminArea('administrativearea', 'Région'), - new UFBF_SubAdminArea('subadministrativearea', 'Département'), - + new UFBF_AddressIndex('administrative_area_level_2', 'Département', 'ADMNISTRATIVEAREAS2'), + new UFBF_AddressIndex('administrative_area_level_1', 'Région', 'ADMNISTRATIVEAREAS1'), + new UFBF_AddressMixed('locality_text', 'locality', 'Ville', 'LOCALITIES'), + new UFBF_AddressMixed('country_text', 'country', 'Pays', 'COUNTRIES'), new UFBF_EducationSchool('schoolTxt', 'school', "École d'application"), new UFBF_EducationDegree('diplomaTxt', 'diploma', 'Diplôme'), diff --git a/modules/deltaten.php b/modules/deltaten.php index 5695382..006aa83 100644 --- a/modules/deltaten.php +++ b/modules/deltaten.php @@ -64,6 +64,7 @@ class DeltaTenModule extends PLModule require_once 'ufbuilder.inc.php'; $ufb = new UFB_DeltaTenSearch(); + $page->addJsLink('search.js'); if (!$ufb->isEmpty()) { require_once 'userset.inc.php'; $ufc = $ufb->getUFC(); diff --git a/templates/deltaten/index.tpl b/templates/deltaten/index.tpl index 375449a..a636caf 100644 --- a/templates/deltaten/index.tpl +++ b/templates/deltaten/index.tpl @@ -29,232 +29,11 @@ - -
+ - - - - - - - - - - - - - - - + {include file="search/adv.form.autocomplete_select.tpl" description="Pays" name="country" + value_text=$smarty.request.country_text value=$smarty.request.country title="Tous les pays"} + {include file="search/adv.form.address_component.tpl" description="Région, province, état…" name="administrative_area_level_1" + value=$smarty.request.administrative_area_level_1} + {include file="search/adv.form.address_component.tpl" description="Département, comté…" name="administrative_area_level_2" + value=$smarty.request.administrative_area_level_2} + + + + {include file="search/adv.form.address_component.tpl" description="Ville" name="locality" value=$smarty.request.locality} + {include file="search/adv.form.address_component.tpl" description="Code postal" name="postal_code" value=$smarty.request.postal_code} diff --git a/templates/search/adv.form.tpl b/templates/search/adv.form.tpl index d1e8d20..6f38815 100644 --- a/templates/search/adv.form.tpl +++ b/templates/search/adv.form.tpl @@ -31,7 +31,7 @@ //]]>

[Revenir à la recherche simple]

- +
@@ -269,36 +48,23 @@ function cleanForm(f) {
Géographie
Ville ou code postal
Pays - - - {icon name="table" title="Tous les pays"} -
Région, province, état… - -
Département, comté… - -
Ville
-- 2.1.4