From fde60e9f70691456b2c799c43c65126e9913791e Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Jacob?= Date: Sat, 17 Jul 2010 00:11:29 +0200 Subject: [PATCH] Fixes referent file. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Jacob --- include/profilefields.inc.php | 4 ++-- plugins/function.display_address.php | 15 +++++++++++++-- templates/profile/fiche_referent.tpl | 8 +++++--- 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/include/profilefields.inc.php b/include/profilefields.inc.php index 27ffeb2..75f770c 100644 --- a/include/profilefields.inc.php +++ b/include/profilefields.inc.php @@ -259,8 +259,8 @@ class Job public $id; public $company = null; - private $phones = array(); - private $address = null; + public $phones = array(); + public $address = null; public $jobid; diff --git a/plugins/function.display_address.php b/plugins/function.display_address.php index 2294f2c..00a6fb6 100644 --- a/plugins/function.display_address.php +++ b/plugins/function.display_address.php @@ -41,8 +41,19 @@ function smarty_function_display_address($param, &$smarty) require_once('geocoding.inc.php'); $adr = $param['adr']; $txtad = $adr->text; - if (!$txtad && !$adr->phones() && !count($adr->phones())) { - return ""; + if (!$txtad) { + $txthtml = ''; + if ($adr->phones() && count($adr->phones())) { + require_once 'function.display_phones.php'; + $txthtml .= smarty_function_display_phones(array('tels' => $adr->phones()), $smarty); + } elseif (isset($param['phones']) && count($param['phones'])) { + require_once 'function.display_phones.php'; + $txthtml .= smarty_function_display_phones(array('tels' => $param['phones']), $smarty); + } + if (!isset($param['nodiv']) && $txthtml != '' && isset($param['pos'])) { + $txthtml = '
' . $txthtml . '
'; + } + return $txthtml; } $lines = explode("\n", $txtad); diff --git a/templates/profile/fiche_referent.tpl b/templates/profile/fiche_referent.tpl index a543510..0ded2bc 100644 --- a/templates/profile/fiche_referent.tpl +++ b/templates/profile/fiche_referent.tpl @@ -71,8 +71,10 @@ {foreach from=$jobs item="job"}

{$job->company->name}

{include file="include/emploi.tpl" job=$job} - {if $job->address()} - {include file="geoloc/address.tpl" address=$job->address titre="Adresse : " for=$job->company->name} + {if $job->address} + {include file="geoloc/address.tpl" address=$job->address titre="Adresse : " for=$job->company->name phones=$job->phones pos="left"} + {elseif $job->phones} + {display_phones tels=$job->phones} {/if}
 
{/foreach} @@ -81,7 +83,7 @@ {if $profile->cv}

Curriculum Vitae :

-
{$profile->cv|smarty:nodefaults}
+
{$profile->cv|miniwiki:title|smarty:nodefaults}
{/if} -- 2.1.4