From efb74b8f4196b188d66d4f48b6456ff7f3677672 Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Jacob?= Date: Thu, 22 Jul 2010 14:41:27 +0200 Subject: [PATCH] Fixes phone display in profile (Closes #1202). MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Jacob --- plugins/function.display_address.php | 2 +- templates/profile/profile.tpl | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/plugins/function.display_address.php b/plugins/function.display_address.php index 00a6fb6..4e51c99 100644 --- a/plugins/function.display_address.php +++ b/plugins/function.display_address.php @@ -101,7 +101,7 @@ function smarty_function_display_address($param, &$smarty) if ($adr->phones() != null) { require_once 'function.display_phones.php'; $txthtml .= smarty_function_display_phones(array('tels' => $adr->phones()),$smarty); - } else if ($param['phones'] != null) { + } else if (isset($param['phones']) && count($param['phones'])) { require_once 'function.display_phones.php'; $txthtml .= smarty_function_display_phones(array('tels' => $param['phones']),$smarty); } diff --git a/templates/profile/profile.tpl b/templates/profile/profile.tpl index 759bff1..4402224 100644 --- a/templates/profile/profile.tpl +++ b/templates/profile/profile.tpl @@ -210,13 +210,13 @@ function chgMainWinLoc(strPage) {/if} {if $address->hasFlag('current')} {include file="geoloc/address.tpl" address=$address titre_div=true titre=$address_name|@cat:" actuelle :" - for="`$profile->firstname` `$profile->lastname`" pos=$pos} + for="`$profile->firstname` `$profile->lastname`" pos=$pos phones=null} {elseif $address->hasFlag('secondary')} {include file="geoloc/address.tpl" address=$address titre_div=true titre=$address_name|@cat:" secondaire :" - for="`$profile->firstname` `$profile->lastname`" pos=$pos} + for="`$profile->firstname` `$profile->lastname`" pos=$pos phones=null} {else} {include file="geoloc/address.tpl" address=$address titre_div=true titre=$address_name|@cat:" principale :" - for="`$profile->firstname` `$profile->lastname`" pos=$pos} + for="`$profile->firstname` `$profile->lastname`" pos=$pos phones=null} {/if} {if $smarty.foreach.addresses.iteration is even}
{/if} {/foreach} @@ -230,11 +230,11 @@ function chgMainWinLoc(strPage) {foreach from=$jobs item="job" key="i"} {if $i neq 0}
{/if} {include file="include/emploi.tpl" job=$job} - {assign var=phones value=$job->phones()} + {assign var=jobPhones value=$job->phones()} {if $job->address()} - {include file="geoloc/address.tpl" address=$job->address() titre="Adresse : " for=$job->company->name pos="left" phones=$phones} - {elseif $phones} - {display_phones tels=$phones} + {include file="geoloc/address.tpl" address=$job->address() titre="Adresse : " for=$job->company->name pos="left" phones=$jobPhones} + {elseif $jobPhones|@count neq 0} + {display_phones tels=$jobPhones} {/if}
 
{/foreach} -- 2.1.4