Fix display of jobs in minifiches
authorRaphaël Barrois <raphael.barrois@polytechnique.org>
Fri, 19 Mar 2010 16:39:26 +0000 (17:39 +0100)
committerRaphaël Barrois <raphael.barrois@polytechnique.org>
Mon, 22 Mar 2010 12:49:29 +0000 (13:49 +0100)
Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org>
classes/profile.php
templates/include/minifiche.tpl

index 09d35da..8af99ab 100644 (file)
@@ -464,7 +464,7 @@ class Profile
         return $this->jobs->get($flags, $limit);
     }
 
-    public function getMailJob()
+    public function getMainJob()
     {
         $job = $this->getJobs(self::JOBS_MAIN, 1);
         if ($job->total() != 1) {
index cebe1d3..0640732 100644 (file)
   {if !$dead}
     {assign var=address value=$profile->getMainAddress()}
     {assign var=web     value=$profile->getWebSite()}
-    {assign var=job     value=$profile->getMailJob()}
+    {assign var=job     value=$profile->getMainJob()}
     {if $web || $profile->mobile || $address.country || $job || (!$dead && !$registered)}
     <table cellspacing="0" cellpadding="0">
       {if $web}
       <tr>
         <td class="lt">Profession&nbsp;:</td>
         <td class="rt">
-          {if $job.url|default:$job.user_site}<a href="{$job.url|default:$job.user_site}">{$job.name}</a>{else}{$job.name}{/if}
-          {if $job.subsubsector}&nbsp;({$job.subsubsector}){/if}{if $job.description}<br />{$job.description}{/if}
+          {if $job->company->url|default:$job->user_site}<a href="{$job->company->url|default:$job->user_site}">{$job->company->name}</a>{else}{$job->company->name}{/if}
+          {if $job->subsubsector}&nbsp;({$job->subsubsector}){/if}{if $job->description}<br />{$job->description}{/if}
         </td>
       </tr>
       {/if}