From 46e9eb99a29eb205d35f49214d595f5dad6be66f Mon Sep 17 00:00:00 2001 From: Florent Bruneau Date: Thu, 5 Mar 2009 08:35:16 +0100 Subject: [PATCH] Fetch mobile in profile default query. Signed-off-by: Florent Bruneau --- classes/profile.php | 9 +++++++-- templates/include/minifiche.tpl | 6 +++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/classes/profile.php b/classes/profile.php index b856508..22f4833 100644 --- a/classes/profile.php +++ b/classes/profile.php @@ -153,6 +153,9 @@ class Profile Platal::page()->kill("Visibility invalide: " . $visibility); } $this->visibility = self::$v_values[$visibility]; + if ($this->mobile && !in_array($this->modbile_pub, $this->visibility)) { + unset($this->data['mobile']); + } } @@ -258,7 +261,8 @@ class Profile pn_f.name AS firstname, pn_l.name AS lastname, pn_n.name AS nickname, IF(pn_uf.name IS NULL, pn_f.name, pn_uf.name) AS firstname_usual, IF(pn_ul.name IS NULL, pn_l.name, pn_ul.name) AS lastname_usual, - pd.promo AS promo, pd.short_name, pd.directory_name AS full_name + pd.promo AS promo, pd.short_name, pd.directory_name AS full_name, + pp.display_tel AS mobile, pp.pub AS mobile_pub FROM profiles AS p INNER JOIN profile_display AS pd ON (pd.pid = p.pid) INNER JOIN profile_education AS pe ON (pe.uid = p.pid AND FIND_IN_SET(\'primary\', pe.flags)) @@ -270,8 +274,9 @@ class Profile AND pn_uf.typeid = ' . self::getNameTypeId('lastname_ordinary', true) . ') LEFT JOIN profile_name AS pn_ul ON (pn_ul.pid = p.pid AND pn_ul.typeid = ' . self::getNameTypeId('firstname_ordinary', true) . ') - LEFT JOIN profile_name aS pn_n ON (pn_n.pid = p.pid + LEFT JOIN profile_name AS pn_n ON (pn_n.pid = p.pid AND pn_n.typeid = ' . self::getNameTypeId('nickname', true) . ') + LEFT JOIN profile_phones AS pp ON (pp.uid = p.pid AND pp.link_type = \'user\' AND tel_type = \'mobile\') WHERE p.pid IN ' . XDB::formatArray($pids) . ' GROUP BY p.pid'); } diff --git a/templates/include/minifiche.tpl b/templates/include/minifiche.tpl index b4d1bcb..57a1ab3 100644 --- a/templates/include/minifiche.tpl +++ b/templates/include/minifiche.tpl @@ -114,7 +114,7 @@
{if !$dead} {assign var=address value=$profile->getMainAddress()} - {if $c.web || $c.mobile || $address.country || $c.entreprise || (!$dead && !$registered)} + {if $c.web || $profile->mobile || $address.country || $c.entreprise || (!$dead && !$registered)} {if $c.web} @@ -128,10 +128,10 @@ {/if} - {if $c.mobile && !$dead} + {if $profile->mobile && !$dead} - + {/if} {if $c.entreprise} -- 2.1.4
{if $address.locality}{$address.locality}, {/if}{$address.country}
Mobile :{$c.mobile}{$profile->mobile}