From: Stéphane Jacob Date: Fri, 16 Jul 2010 22:11:29 +0000 (+0200) Subject: Fixes referent file. X-Git-Tag: xorg/1.0.1~15^2~36 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=fde60e9f70691456b2c799c43c65126e9913791e;p=platal.git Fixes referent file. Signed-off-by: Stéphane Jacob --- 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}