Updates language table for better compatibility with iso codes.
[platal.git] / templates / profile / profile.tpl
index d02d153..967bf7e 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  *}
@@ -106,10 +106,12 @@ function chgMainWinLoc(strPage)
           {icon name=wrench title="administrer user"}</a>
         {/if}
 
-        {if $owner->login() eq $smarty.session.hruid}
+        {if $smarty.session.user->isMyProfile($profile)}
         <a href="javascript:chgMainWinLoc('profile/edit')">{icon name="user_edit" title="Modifier ma fiche"}</a>
-        {elseif hasPerm('edit_directory')}
-        <a href="javascript:chgMainWinLoc('profile/edit/{$profile->hrpid}')">{icon name="user_edit" title="Modifier cette fiche"}</a>
+        {elseif hasPerm('admin') || $smarty.session.user->canEdit($profile)}
+        <a href="javascript:chgMainWinLoc('profile/edit/{$profile->hrpid}')">
+          {icon name=user_edit title="modifier la fiche"}
+        </a>
         {/if}
       {/if}
     </div>