From: Aidan Saunders Date: Tue, 3 Jul 2018 15:11:17 +0000 (+0100) Subject: Use icons for permission status X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=66229fd56f5a91924067a44e0432ccef312023d4;p=civicrm-core.git Use icons for permission status --- diff --git a/CRM/Contact/BAO/Relationship.php b/CRM/Contact/BAO/Relationship.php index 2b4db2f0a1..d7730bb6a4 100644 --- a/CRM/Contact/BAO/Relationship.php +++ b/CRM/Contact/BAO/Relationship.php @@ -2123,36 +2123,36 @@ AND cc.sort_name LIKE '%$name%'"; 'civicrm/contact/view/rel', "action=view&reset=1&cid={$values['cid']}&id={$values['id']}&rtype={$values['rtype']}"); + if (!empty($values['description'])) { + $relationship['relation'] .= "

{$values['description']}

"; + } + if ($params['context'] == 'current') { if (($params['contact_id'] == $values['contact_id_a'] AND $values['is_permission_a_b'] == CRM_Contact_BAO_Relationship::EDIT) OR ($params['contact_id'] == $values['contact_id_b'] AND $values['is_permission_b_a'] == CRM_Contact_BAO_Relationship::EDIT) ) { - $relationship['sort_name'] .= ' *'; + $relationship['sort_name'] .= ' '; } if (($params['contact_id'] == $values['contact_id_a'] AND $values['is_permission_a_b'] == CRM_Contact_BAO_Relationship::VIEW) OR ($params['contact_id'] == $values['contact_id_b'] AND $values['is_permission_b_a'] == CRM_Contact_BAO_Relationship::VIEW) ) { - $relationship['sort_name'] .= ' +'; + $relationship['sort_name'] .= ' '; } if (($values['cid'] == $values['contact_id_a'] AND $values['is_permission_a_b'] == CRM_Contact_BAO_Relationship::EDIT) OR ($values['cid'] == $values['contact_id_b'] AND $values['is_permission_b_a'] == CRM_Contact_BAO_Relationship::EDIT) ) { - $relationship['relation'] .= ' *'; + $relationship['relation'] .= ' '; } if (($values['cid'] == $values['contact_id_a'] AND $values['is_permission_a_b'] == CRM_Contact_BAO_Relationship::VIEW) OR ($values['cid'] == $values['contact_id_b'] AND $values['is_permission_b_a'] == CRM_Contact_BAO_Relationship::VIEW) ) { - $relationship['relation'] .= ' +'; + $relationship['relation'] .= ' '; } } - if (!empty($values['description'])) { - $relationship['relation'] .= "

{$values['description']}

"; - } - $relationship['start_date'] = CRM_Utils_Date::customFormat($values['start_date']); $relationship['end_date'] = CRM_Utils_Date::customFormat($values['end_date']); $relationship['city'] = $values['city']; diff --git a/templates/CRM/Contact/Form/Relationship.tpl b/templates/CRM/Contact/Form/Relationship.tpl index f2312bc11d..55bb4060ff 100644 --- a/templates/CRM/Contact/Form/Relationship.tpl +++ b/templates/CRM/Contact/Form/Relationship.tpl @@ -58,15 +58,15 @@
{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} + {ts 1=$displayName 2=$row.display_name}%1 can view and update information about %2{/ts} {else} - {ts 1=$displayName 2=$row.display_name}%1 can view information about %2.{/ts} + {ts 1=$displayName 2=$row.display_name}%1 can view information about %2{/ts} {/if} {else} {if $row.is_permission_a_b == 1} - {ts 1=$row.display_name 2=$displayName}%1 can view and update information about %2.{/ts} + {ts 1=$row.display_name 2=$displayName}%1 can view and update information about %2{/ts} {else} - {ts 1=$row.display_name 2=$displayName}%1 can view information about %2.{/ts} + {ts 1=$row.display_name 2=$displayName}%1 can view information about %2{/ts} {/if} {/if}
@@ -75,15 +75,15 @@
{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} + {ts 1=$row.display_name 2=$displayName}%1 can view and update information about %2{/ts} {else} - {ts 1=$row.display_name 2=$displayName}%1 can view information about %2.{/ts} + {ts 1=$row.display_name 2=$displayName}%1 can view information about %2{/ts} {/if} {else} {if $row.is_permission_b_a == 1} - {ts 1=$displayName 2=$row.display_name}%1 can view and update information about %2.{/ts} + {ts 1=$displayName 2=$row.display_name}%1 can view and update information about %2{/ts} {else} - {ts 1=$displayName 2=$row.display_name}%1 can view and update information about %2.{/ts} + {ts 1=$displayName 2=$row.display_name}%1 can view information about %2{/ts} {/if} {/if}
@@ -132,14 +132,14 @@ {capture assign="contact_b"}{if $action eq 1}{ts}selected contact(s){/ts}{else}{$display_name_b}{/if}{/capture} - {ts 1=$display_name_a 2=$contact_b}Permission for %1 to access information about %2.{/ts}
+ {ts 1=$display_name_a 2=$contact_b}Permission for %1 to access information about %2{/ts}
{$form.is_permission_a_b.html} - {ts 1=$contact_b|ucfirst 2=$display_name_a}Permission for %1 to access information about %2.{/ts}
+ {ts 1=$contact_b|ucfirst 2=$display_name_a}Permission for %1 to access information about %2{/ts}
{$form.is_permission_b_a.html} diff --git a/templates/CRM/Contact/Page/View/Relationship.tpl b/templates/CRM/Contact/Page/View/Relationship.tpl index f8d99c5e27..1624e9d869 100644 --- a/templates/CRM/Contact/Page/View/Relationship.tpl +++ b/templates/CRM/Contact/Page/View/Relationship.tpl @@ -39,9 +39,9 @@ {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}