Use icons for permission status
authorAidan Saunders <aidan.saunders@squiffle.uk>
Tue, 3 Jul 2018 15:11:17 +0000 (16:11 +0100)
committerAidan Saunders <aidan.saunders@squiffle.uk>
Wed, 4 Jul 2018 11:34:10 +0000 (12:34 +0100)
CRM/Contact/BAO/Relationship.php
templates/CRM/Contact/Form/Relationship.tpl
templates/CRM/Contact/Page/View/Relationship.tpl

index 2b4db2f0a1c65e00b17f0060e8418448576ecf7b..d7730bb6a47f492167f7000dba9b246c9705b336 100644 (file)
@@ -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'] .= "<p class='description'>{$values['description']}</p>";
+        }
+
         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'] .= '<span id="permission-a-b" class="crm-marker permission-relationship"> *</span>';
+            $relationship['sort_name'] .= ' <i class="crm-i fa-asterisk"></i>';
           }
 
           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'] .= '<span id="permission-a-b" class="crm-marker permission-relationship"> +</span>';
+            $relationship['sort_name'] .= ' <i class="crm-i fa-eye"></i>';
           }
 
           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'] .= '<span id="permission-b-a" class="crm-marker permission-relationship"> *</span>';
+            $relationship['relation'] .= ' <i class="crm-i fa-asterisk"></i>';
           }
 
           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'] .= '<span id="permission-b-a" class="crm-marker permission-relationship"> +</span>';
+            $relationship['relation'] .= ' <i class="crm-i fa-eye"></i>';
           }
         }
 
-        if (!empty($values['description'])) {
-          $relationship['relation'] .= "<p class='description'>{$values['description']}</p>";
-        }
-
         $relationship['start_date'] = CRM_Utils_Date::customFormat($values['start_date']);
         $relationship['end_date'] = CRM_Utils_Date::customFormat($values['end_date']);
         $relationship['city'] = $values['city'];
index f2312bc11d1d5211c8fd872879d9e4de252ca19d..55bb4060ff5f79ad18bfa2fda15edfc7cf244b5c 100644 (file)
                   <div>
                   {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}<strong>%1</strong> can view and update information about %2.{/ts}
+                      {ts 1=$displayName 2=$row.display_name}<strong>%1</strong> can view and update information about <strong>%2</strong>{/ts} <i class="crm-i fa-asterisk"></i>
                     {else}
-                      {ts 1=$displayName 2=$row.display_name}<strong>%1</strong> can view information about %2.{/ts}
+                      {ts 1=$displayName 2=$row.display_name}<strong>%1</strong> can view information about <strong>%2</strong>{/ts} <i class="crm-i fa-eye"></i>
                     {/if}
                   {else}
                     {if $row.is_permission_a_b == 1}
-                      {ts 1=$row.display_name 2=$displayName}<strong>%1</strong> can view and update information about %2.{/ts}
+                      {ts 1=$row.display_name 2=$displayName}<strong>%1</strong> can view and update information about <strong>%2</strong>{/ts} <i class="crm-i fa-asterisk"></i>
                     {else}
-                      {ts 1=$row.display_name 2=$displayName}<strong>%1</strong> can view information about %2.{/ts}
+                      {ts 1=$row.display_name 2=$displayName}<strong>%1</strong> can view information about <strong>%2</strong>{/ts} <i class="crm-i fa-eye"></i>
                     {/if}
                   {/if}
                   </div>
                   <div>
                   {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}<strong>%1</strong> can view and update information about %2.{/ts}
+                      {ts 1=$row.display_name 2=$displayName}<strong>%1</strong> can view and update information about <strong>%2</strong>{/ts} <i class="crm-i fa-asterisk"></i>
                     {else}
-                      {ts 1=$row.display_name 2=$displayName}<strong>%1</strong> can view information about %2.{/ts}
+                      {ts 1=$row.display_name 2=$displayName}<strong>%1</strong> can view information about <strong>%2</strong>{/ts} <i class="crm-i fa-eye"></i>
                     {/if}
                   {else}
                     {if $row.is_permission_b_a == 1}
-                      {ts 1=$displayName 2=$row.display_name}<strong>%1</strong> can view and update information about %2.{/ts}
+                      {ts 1=$displayName 2=$row.display_name}<strong>%1</strong> can view and update information about <strong>%2</strong>{/ts} <i class="crm-i fa-asterisk"></i>
                     {else}
-                      {ts 1=$displayName 2=$row.display_name}<strong>%1</strong> can view and update information about %2.{/ts}
+                      {ts 1=$displayName 2=$row.display_name}<strong>%1</strong> can view information about <strong>%2</strong>{/ts} <i class="crm-i fa-eye"></i>
                     {/if}
                   {/if}
                   </div>
           {capture assign="contact_b"}{if $action eq 1}{ts}selected contact(s){/ts}{else}{$display_name_b}{/if}{/capture}
           <td class="label"><label>{ts}Permissions{/ts}</label></td>
           <td>
-            {ts 1=$display_name_a 2=$contact_b}Permission for <strong>%1</strong> to access information about %2.{/ts}<br />
+            {ts 1=$display_name_a 2=$contact_b}Permission for <strong>%1</strong> to access information about <strong>%2</strong>{/ts}<br />
             {$form.is_permission_a_b.html}
           </td>
         </tr>
         <tr class="crm-relationship-form-block-is_permission_b_a">
           <td class="label"></td>
           <td>
-            {ts 1=$contact_b|ucfirst 2=$display_name_a}Permission for <strong>%1</strong> to access information about %2.{/ts}<br />
+            {ts 1=$contact_b|ucfirst 2=$display_name_a}Permission for <strong>%1</strong> to access information about <strong>%2</strong>{/ts}<br />
             {$form.is_permission_b_a.html}
           </td>
         </tr>
index f8d99c5e27deb0655ebcb921dc420d4b6fed9b3a..1624e9d86994308fe40c8795cd21f61c8bddc468 100644 (file)
@@ -39,9 +39,9 @@
     {include file="CRM/Contact/Page/View/RelationshipSelector.tpl" context="current"}
     <div id="permission-legend" class="crm-content-block">
       <span class="label">Permissioned Relationships: </span>&nbsp;
-      <span class="crm-marker"> +</span>
+      <i class="crm-i fa-eye"></i>
       {ts}This contact can be viewed by the other.{/ts}&nbsp;
-      <span class="crm-marker"> *</span>
+      <i class="crm-i fa-asterisk"></i>
       {ts}This contact can be viewed and updated by the other.{/ts}
     </div>