Restaures previous display of job phones (Closes #1157).
authorStéphane Jacob <sj@m4x.org>
Sat, 26 Jun 2010 09:03:43 +0000 (11:03 +0200)
committerStéphane Jacob <sj@m4x.org>
Sat, 26 Jun 2010 09:03:43 +0000 (11:03 +0200)
Signed-off-by: Stéphane Jacob <sj@m4x.org>
plugins/function.display_address.php
templates/geoloc/address.tpl
templates/profile/profile.tpl

index 55c1f16..2294f2c 100644 (file)
@@ -87,9 +87,12 @@ function smarty_function_display_address($param, &$smarty)
     {
         $txthtml .= "<strong>" . pl_entities($line) . "</strong><br/>\n";
     }
-    if($adr->phones() != null) {
-        require_once('function.display_phones.php');
+    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) {
+        require_once 'function.display_phones.php';
+        $txthtml .= smarty_function_display_phones(array('tels' => $param['phones']),$smarty);
     }
     if (!$param['nodiv']) {
         $pos = $param['pos'] ? " style='float: " . $param['pos'] . "'" : '';
index 0cf9eec..e21a395 100644 (file)
@@ -20,6 +20,6 @@
 {*                                                                        *}
 {**************************************************************************}
 
-{display_address adr=$address titre=$titre titre_div=$titre_div no_div=$no_div for=$for pos=$pos}
+{display_address adr=$address titre=$titre titre_div=$titre_div no_div=$no_div for=$for pos=$pos phones=$phones}
 
 {* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}
index 0525acd..6576785 100644 (file)
@@ -229,13 +229,11 @@ function chgMainWinLoc(strPage)
     {foreach from=$jobs item="job" key="i"}
       {if $i neq 0}<hr />{/if}
       {include file="include/emploi.tpl" job=$job}
+      {assign var=phones value=$job->phones()}
       {if $job->address()}
-        {include file="geoloc/address.tpl" address=$job->address() titre="Adresse&nbsp;: " for=$job->company->name pos="left"}
-      {elseif $job->company->address}
-        {include file="geoloc/address.tpl" address=$job->company->address titre="Addresse&nbsp;: " for=$job->company->name pos="left"}
-      {/if}
-      {if $job->phones()}
-        {display_phones tels=$job->phones()}
+        {include file="geoloc/address.tpl" address=$job->address() titre="Adresse&nbsp;: " for=$job->company->name pos="left" phones=$phones}
+      {elseif $phones}
+        {display_phones tels=$phones}
       {/if}
       <div class="spacer">&nbsp;</div>
     {/foreach}