Make profile edition link available from minifiches and profile when the
[platal.git] / templates / include / minifiche.tpl
index 698a549..16dac4f 100644 (file)
     <div class="nom">
       {if $profile->isFemale()}&bull;{/if}
       {if !$dead && $registered}<a href="profile/{$profile->hrid()}" class="popup2">{/if}
-      {$profile->full_name}
+      {$profile->directory_name}
       {if !$dead && $registered}</a>{/if}
     </div>
 
     <div class="edu">
-      {foreach from=$profile->nationalities() item=nat}
-      <img src='images/flags/{$nat}.gif' alt='{$nat}' height='11' title='{$nat}' />&nbsp;
+      {foreach from=$profile->nationalities() item=country key=code}
+      <img src='images/flags/{$code}.gif' alt='{$code}' height='11' title='{$country}' />&nbsp;
       {/foreach}
       {$profile->promo()}{*
-      *}{foreach from=$profile->getExtraEducations(4) item=edu}, {display_education edu=$edu profile=$profile}{/foreach}{*
+      *}{foreach from=$profile->getExtraEducations(4) item=edu}, {display_education edu=$edu profile=$profile full=false}{/foreach}{*
       *}{if $dead}, {"décédé"|sex:"décédée":$profile} le {$profile->deathdate|date_format}{/if}
     </div>
   </div>
 
   {if $withAuth}
   <div class="noprint bits">
+    {if $registered || (!$dead && $hasowner)}
     <div>
       {if !$registered && !$dead && $hasowner}
-        {if $show_action && ($show_action eq 'ajouter')}
+        {if hasPerm('directory_private')}
+        {if !$smarty.session.user->isWatchedUser($profile)}
     <a href="carnet/notifs/add_nonins/{$user->login()}?token={xsrf_token}">{*
     *}{icon name=add title="Ajouter à la liste de mes surveillances"}</a>
         {else}
     <a href="carnet/notifs/del_nonins/{$user->login()}?token={xsrf_token}">{*
     *}{icon name=cross title="Retirer de la liste de mes surveillances"}</a>
         {/if}
+        {/if}
       {elseif $registered}
     <a href="profile/{$profile->hrid()}" class="popup2">{*
     *}{icon name=user_suit title="Afficher la fiche"}</a>
@@ -88,6 +91,7 @@
     *}{icon name=vcard title="Afficher la carte de visite"}</a>
     <a href="mailto:{$user->bestEmail()}">{*
     *}{icon name=email title="Envoyer un email"}</a>
+          {if hasPerm('directory_private')}
           {if !$smarty.session.user->isContact($profile)}
     <a href="carnet/contacts?action=ajouter&amp;user={$profile->hrid()}&amp;token={xsrf_token}">{*
     *}{icon name=add title="Ajouter à mes contacts"}</a>
     <a href="carnet/contacts?action=retirer&amp;user={$profile->hrid()}&amp;token={xsrf_token}">{*
     *}{icon name=cross title="Retirer de mes contacts"}</a>
           {/if}
+          {/if}
         {/if}
       {/if}
     </div>
+    {/if}
 
-    {if hasPerm('admin') && $hasowner}
+    {if hasPerm('edit_directory')}
+    <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}
       <a href="marketing/private/{$user->login()}">{*
     {assign var=address value=$profile->getMainAddress()}
     {assign var=web     value=$profile->getWebSite()}
     {assign var=job     value=$profile->getMainJob()}
-    {if $web || $profile->mobile || ($address && $address->country) || $job || !$registered}
+    {if $web || $profile->mobile || ($address && $address->country) || $job || !$registered || $user->lost}
     <table cellspacing="0" cellpadding="0">
       {if $web}
       <tr>
-        <td class="lt">Page web&nbsp;:</td>
-        <td class="rt"><a href="{$web}">{$web}</a></td>
+        <td class="lt">{$web.name}&nbsp;:</td>
+        <td class="rt"><a href="{$web.address}">{$web.address}</a></td>
       </tr>
       {/if}
       {if $address && $address->country}
         <td class="smaller" colspan="2">
           {"Ce"|sex:"Cette":$profile} camarade n'est pas {"inscrit"|sex:"inscrite":$profile}.
           <a href="marketing/public/{$user->login()}" class='popup'>Si tu connais son adresse email,
-          <strong>n'hésite pas à nous la transmettre !</a>
+          <strong>n'hésite pas à nous la transmettre !</strong></a>
         </td>
       </tr>
       {elseif $user->state neq 'disabled' && $user->lost}