From: Andrew Hunt Date: Fri, 20 Jul 2018 20:05:54 +0000 (-0400) Subject: Relationship permissions: standardize all permission icons into template X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=3097904afc7074d08b6609b3f206dc0810443b15;p=civicrm-core.git Relationship permissions: standardize all permission icons into template --- diff --git a/templates/CRM/Contact/Form/Relationship.tpl b/templates/CRM/Contact/Form/Relationship.tpl index cfc33721af..ad0efe0c0a 100644 --- a/templates/CRM/Contact/Form/Relationship.tpl +++ b/templates/CRM/Contact/Form/Relationship.tpl @@ -57,34 +57,18 @@ {if $row.is_permission_a_b}
{if $row.rtype EQ 'a_b' AND $is_contact_id_a} - {if $row.is_permission_a_b == 1} - {ts 1=$displayName 2=$row.display_name}%1 can view and update information about %2{/ts} {include file="CRM/Contact/Page/View/RelationshipPerm.tpl" permType=1 permDisplayName=$displayName otherDisplayName=$row.display_name} - {else} - {ts 1=$displayName 2=$row.display_name}%1 can view information about %2{/ts} {include file="CRM/Contact/Page/View/RelationshipPerm.tpl" permType=2 permDisplayName=$displayName otherDisplayName=$row.display_name} - {/if} + {include file="CRM/Contact/Page/View/RelationshipPerm.tpl" permType=$row.is_permission_a_b permDisplayName=$displayName otherDisplayName=$row.display_name displayText=true} {else} - {if $row.is_permission_a_b == 1} - {ts 1=$row.display_name 2=$displayName}%1 can view and update information about %2{/ts} {include file="CRM/Contact/Page/View/RelationshipPerm.tpl" permType=1 otherDisplayName=$displayName permDisplayName=$row.display_name} - {else} - {ts 1=$row.display_name 2=$displayName}%1 can view information about %2{/ts} {include file="CRM/Contact/Page/View/RelationshipPerm.tpl" permType=2 otherDisplayName=$displayName permDisplayName=$row.display_name} - {/if} + {include file="CRM/Contact/Page/View/RelationshipPerm.tpl" permType=$row.is_permission_a_b otherDisplayName=$displayName permDisplayName=$row.display_name displayText=true} {/if}
{/if} {if $row.is_permission_b_a}
{if $row.rtype EQ 'a_b' AND $is_contact_id_a} - {if $row.is_permission_b_a == 1} - {ts 1=$row.display_name 2=$displayName}%1 can view and update information about %2{/ts} {include file="CRM/Contact/Page/View/RelationshipPerm.tpl" permType=1 otherDisplayName=$displayName permDisplayName=$row.display_name} - {else} - {ts 1=$row.display_name 2=$displayName}%1 can view information about %2{/ts} {include file="CRM/Contact/Page/View/RelationshipPerm.tpl" permType=2 otherDisplayName=$displayName permDisplayName=$row.display_name} - {/if} + {include file="CRM/Contact/Page/View/RelationshipPerm.tpl" permType=$row.is_permission_b_a otherDisplayName=$displayName permDisplayName=$row.display_name displayText=true} {else} - {if $row.is_permission_b_a == 1} - {ts 1=$displayName 2=$row.display_name}%1 can view and update information about %2{/ts} {include file="CRM/Contact/Page/View/RelationshipPerm.tpl" permType=1 permDisplayName=$displayName otherDisplayName=$row.display_name} - {else} - {ts 1=$displayName 2=$row.display_name}%1 can view information about %2{/ts} {include file="CRM/Contact/Page/View/RelationshipPerm.tpl" permType=2 permDisplayName=$displayName otherDisplayName=$row.display_name} - {/if} + {include file="CRM/Contact/Page/View/RelationshipPerm.tpl" permType=$row.is_permission_b_a permDisplayName=$displayName otherDisplayName=$row.display_name displayText=true} {/if}
{/if} diff --git a/templates/CRM/Contact/Page/View/Relationship.tpl b/templates/CRM/Contact/Page/View/Relationship.tpl index 1624e9d869..46e1735e23 100644 --- a/templates/CRM/Contact/Page/View/Relationship.tpl +++ b/templates/CRM/Contact/Page/View/Relationship.tpl @@ -38,11 +38,8 @@

{ts}Current Relationships{/ts}

{include file="CRM/Contact/Page/View/RelationshipSelector.tpl" context="current"}
- Permissioned Relationships:   - - {ts}This contact can be viewed by the other.{/ts}  - - {ts}This contact can be viewed and updated by the other.{/ts} + Permissioned Relationships: + {include file="CRM/Contact/Page/View/RelationshipPerm.tpl" permType=1 afterText=true}
diff --git a/templates/CRM/Contact/Page/View/RelationshipPerm.tpl b/templates/CRM/Contact/Page/View/RelationshipPerm.tpl index 82529f22ec..e78ca39a50 100644 --- a/templates/CRM/Contact/Page/View/RelationshipPerm.tpl +++ b/templates/CRM/Contact/Page/View/RelationshipPerm.tpl @@ -25,19 +25,37 @@ *} {* Partial for displaying permissions associated with a relationship *} +{if $displayText} {if $permType eq 1} -{include file="CRM/Contact/Page/View/RelationshipPerm.tpl" permType=2} +{ts 1=$permDisplayName 2=$otherDisplayName}%1 can view and update information about %2.{/ts} +{else} +{ts 1=$permDisplayName 2=$otherDisplayName}%1 can view information about %2.{/ts} +{/if} +{/if} + +{if $permType eq 1} +{include file="CRM/Contact/Page/View/RelationshipPerm.tpl" permType=2 displayText=false} {/if} +{if $permDisplayName and $otherDisplayName} {capture assign="permText"} {if $permType eq 1} -{ts 1=$permDisplayName 2=$otherDisplayName}%2 can be edited by %1{/ts} +{ts 1=$permDisplayName 2=$otherDisplayName}%2 can be edited by %1.{/ts} {else} -{ts 1=$permDisplayName 2=$otherDisplayName}%2 can be viewed by %1{/ts} +{ts 1=$permDisplayName 2=$otherDisplayName}%2 can be viewed by %1.{/ts} {/if} {/capture} +{/if} + +{if $afterText} +{if $permType eq 1} +{ts}This contact can be edited by the other.{/ts} +{else} +{ts}This contact can be viewed by the other.{/ts} +{/if} +{/if}