From 6b83ce0632d45c18c7c81cb00d700aecc2aa8e0c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rapha=C3=ABl=20Barrois?= Date: Mon, 15 Feb 2010 00:43:37 +0100 Subject: [PATCH] Fetch fixed and fax for profile addresses MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Raphaël Barrois --- classes/profile.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/classes/profile.php b/classes/profile.php index 496b14d..a801efc 100644 --- a/classes/profile.php +++ b/classes/profile.php @@ -271,7 +271,7 @@ class Profile return XDB::iterator('SELECT pa.text, pa.postalCode, pa.type, pa.latitude, pa.longitude, gl.name AS locality, gas.name AS subAdministrativeArea, ga.name AS administrativeArea, gc.countryFR AS country, - pp.tel_type, pp.display_tel, + ppfix.display_tel AS fixed_tel, ppfax.display_tel AS fax_tel, FIND_IN_SET(\'current\', pa.flags) AS current, FIND_IN_SET(\'temporary\', pa.flags) AS temporary, FIND_IN_SET(\'secondary\', pa.flags) AS secondary, @@ -281,7 +281,8 @@ class Profile LEFT JOIN geoloc_administrativeareas AS ga ON (ga.id = pa.administrativeAreaId) LEFT JOIN geoloc_administrativeareas AS gas ON (gas.id = pa.subAdministrativeAreaId) LEFT JOIN geoloc_countries AS gc ON (gc.iso_3166_1_a2 = pa.countryId) - LEFT JOIN profile_phones AS pp ON (pp.link_type = \'address\' AND pp.uid = pa.pid AND pp.link_id = pa.id) + LEFT JOIN profile_phones AS ppfix ON (ppfix.link_type = \'address\' AND ppfix.uid = pa.pid AND ppfix.link_id = pa.id AND ppfix.tel_type = \'fixed\') + LEFT JOIN profile_phones AS ppfax ON (ppfax.link_type = \'address\' AND ppfax.uid = pa.pid AND ppfax.link_id = pa.id AND ppfax.tel_type = \'fax\') WHERE ' . $where . ' ORDER BY pa.id ' . $limit); -- 2.1.4