Fixes referent file.
authorStéphane Jacob <sj@m4x.org>
Fri, 16 Jul 2010 22:11:29 +0000 (00:11 +0200)
committerStéphane Jacob <sj@m4x.org>
Fri, 16 Jul 2010 22:12:31 +0000 (00:12 +0200)
Signed-off-by: Stéphane Jacob <sj@m4x.org>
include/profilefields.inc.php
plugins/function.display_address.php
templates/profile/fiche_referent.tpl

index 27ffeb2..75f770c 100644 (file)
@@ -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;
 
index 2294f2c..00a6fb6 100644 (file)
@@ -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 = '<div class="adresse" style="float: ' . $param['pos'] . '">' . $txthtml . '</div>';
+        }
+        return $txthtml;
     }
 
     $lines = explode("\n", $txtad);
index a543510..0ded2bc 100644 (file)
     {foreach from=$jobs item="job"}
       <h2>{$job->company->name}</h2>
       {include file="include/emploi.tpl" job=$job}
-      {if $job->address()}
-        {include file="geoloc/address.tpl" address=$job->address titre="Adresse&nbsp;: " for=$job->company->name}
+      {if $job->address}
+        {include file="geoloc/address.tpl" address=$job->address titre="Adresse&nbsp;: " for=$job->company->name phones=$job->phones pos="left"}
+      {elseif $job->phones}
+        {display_phones tels=$job->phones}
       {/if}
       <div class="spacer">&nbsp;</div>
     {/foreach}
@@ -81,7 +83,7 @@
   {if $profile->cv}
   <div class="part">
     <h2>Curriculum Vitae&nbsp;: </h2>
-    <div style="padding: 0 2ex">{$profile->cv|smarty:nodefaults}</div>
+    <div style="padding: 0 2ex">{$profile->cv|miniwiki:title|smarty:nodefaults}</div>
   </div>
   {/if}