From b9d254dfbec04814a5301ee1f49a3793cf763716 Mon Sep 17 00:00:00 2001 From: Florent Bruneau Date: Tue, 28 Sep 2010 14:44:09 +0200 Subject: [PATCH] Make profile edition link available from minifiches and profile when the current user have edit_directory permissions. Signed-off-by: Florent Bruneau --- core | 2 +- templates/include/minifiche.tpl | 11 ++++++++++- templates/profile/profile.tpl | 3 ++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/core b/core index 6e4c4ea..a2efe30 160000 --- a/core +++ b/core @@ -1 +1 @@ -Subproject commit 6e4c4ead2d8c7e55e9fc9c925130b8425b4ec585 +Subproject commit a2efe30f0470b8150e70189e6f8d9d7d8601ea87 diff --git a/templates/include/minifiche.tpl b/templates/include/minifiche.tpl index 0daa537..16dac4f 100644 --- a/templates/include/minifiche.tpl +++ b/templates/include/minifiche.tpl @@ -74,6 +74,7 @@ {if $registered || (!$dead && $hasowner)}
{if !$registered && !$dead && $hasowner} + {if hasPerm('directory_private')} {if !$smarty.session.user->isWatchedUser($profile)} {* *}{icon name=add title="Ajouter à la liste de mes surveillances"} @@ -81,6 +82,7 @@ {* *}{icon name=cross title="Retirer de la liste de mes surveillances"} {/if} + {/if} {elseif $registered} {* *}{icon name=user_suit title="Afficher la fiche"} @@ -89,6 +91,7 @@ *}{icon name=vcard title="Afficher la carte de visite"} {* *}{icon name=email title="Envoyer un email"} + {if hasPerm('directory_private')} {if !$smarty.session.user->isContact($profile)} {* *}{icon name=add title="Ajouter à mes contacts"} @@ -96,12 +99,18 @@ {* *}{icon name=cross title="Retirer de mes contacts"} {/if} + {/if} {/if} {/if}
{/if} - {if hasPerm('admin') && $hasowner} + {if hasPerm('edit_directory')} +
+ [{* + *}{icon name=user_edit title="modifier la fiche"}] +
+ {elseif hasPerm('admin') && $hasowner}
[{if $registered && !$dead} {* diff --git a/templates/profile/profile.tpl b/templates/profile/profile.tpl index 926f807..863cbdc 100644 --- a/templates/profile/profile.tpl +++ b/templates/profile/profile.tpl @@ -108,8 +108,9 @@ function chgMainWinLoc(strPage) {if $owner->login() eq $smarty.session.hruid} {icon name="user_edit" title="Modifier ma fiche"} + {elseif hasPerm('edit_directory')} + {icon name="user_edit" title="Modifier cette fiche"} {/if} - {/if}
-- 2.1.4