Prevents notices.
[platal.git] / templates / include / minifiche.tpl
index 16dac4f..9752602 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2010 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2011 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
@@ -44,7 +44,7 @@
 
 
 <div class="contact {if !$registered || $dead }grayed{/if}"
-     {if $registered}title="fiche mise à jour le {$profile->last_change|date_format}"{/if}>
+     {if $profile->last_change}title="fiche mise à jour le {$profile->last_change|date_format}"{/if}>
   <div class="identity">
     {if $withAuth}
     <div class="photo">
@@ -54,9 +54,9 @@
 
     <div class="nom">
       {if $profile->isFemale()}&bull;{/if}
-      {if !$dead && $registered}<a href="profile/{$profile->hrid()}" class="popup2">{/if}
+      {if !$dead && ($withAuth || $registered)}<a href="profile/{$profile->hrid()}" class="popup2">{/if}
       {$profile->directory_name}
-      {if !$dead && $registered}</a>{/if}
+      {if !$dead && ($withAuth || $registered)}</a>{/if}
     </div>
 
     <div class="edu">
     </div>
     {/if}
 
-    {if hasPerm('edit_directory')}
+    {if hasPerm('admin') || $smarty.session.user->canEdit($profile)}
     <div>
-      [<a href="profile/edit/{$user->login()}">{*
-         *}{icon name=user_edit title="modifier la fiche"}</a>]
-    </div>
-    {elseif hasPerm('admin') && $hasowner}
-    <div>
-      [{if $registered && !$dead}
+      [{if hasPerm('admin') && $hasowner}{if !$registered && !$dead}
       <a href="marketing/private/{$user->login()}">{*
         *}{icon name=email title="marketter user"}</a>
       {/if}
       <a href="admin/user/{$user->login()}">{*
-      *}{icon name=wrench title="administrer user"}</a>
-      <a href="profile/ax/{$user->login()}">{*
-      *}{icon name=user_gray title="fiche AX"}</a>]
+      *}{icon name=wrench title="administrer user"}</a>{/if}{*
+      *}{if hasPerm('admin') || $smarty.session.user->canEdit($profile)}{*
+      *}<a href="profile/edit/{$user->login()}">{*
+      *}{icon name=user_edit title="modifier la fiche"}</a>{*
+      *}<a href="profile/ax/{$user->login()}">{*
+      *}{icon name=user_gray title="fiche AX"}</a>{/if}]
     </div>
     {/if}
   </div>
         <td class="lt">Profession&nbsp;:</td>
         <td class="rt">
           {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}
+          {if $job->description}<br />{$job->description}{/if}
         </td>
       </tr>
       {/if}