Apply edit groups permission check to the button not the generaal permissionedForGrou...
authorSeamus Lee <seamuslee001@gmail.com>
Wed, 5 Aug 2020 23:57:26 +0000 (09:57 +1000)
committerSeamus Lee <seamuslee001@gmail.com>
Wed, 19 Aug 2020 06:16:57 +0000 (16:16 +1000)
CRM/Contact/Form/Search.php
templates/CRM/Contact/Form/Search/Intro.tpl

index 2af1c15e70be24cd20458251e8848f9b345f0fda..25c95ac6b7ebbb541e47d2d629604db82fad4673 100644 (file)
@@ -450,6 +450,7 @@ class CRM_Contact_Form_Search extends CRM_Core_Form_Search {
         'group_contact_status', ts('Group Status')
       );
 
+      $this->assign('permissionEditSmartGroup', CRM_Core_Permission::check('edit groups'));
       $this->assign('permissionedForGroup', $permissionForGroup);
     }
 
index 3d0b47163a9697bd5d70369042cc4558cd55110c..adc70018d03a78153a74ec7d66eb4b4cc943de96 100644 (file)
@@ -11,7 +11,7 @@
 {* smog = 'show members of group'; amtg = 'add members to group' *}
 {if $context EQ 'smog'}
   {* Provide link to modify smart group search criteria if we are viewing a smart group (ssID = saved search ID) *}
-  {if $permissionedForGroup}
+  {if $permissionEditSmartGroup}
     {if !empty($ssID)}
       {if $ssMappingID}
         {capture assign=editSmartGroupURL}{crmURL p="civicrm/contact/search/builder" q="reset=1&ssID=`$ssID`"}{/capture}
@@ -25,7 +25,9 @@
         {help id="id-edit-smartGroup"}
       </div>
     {/if}
+  {/if}
 
+  {if $permissionedForGroup}
     {capture assign=addMembersURL}{crmURL q="context=amtg&amtgID=`$group.id`&reset=1"}{/capture}
     <div class="crm-submit-buttons">
       <a href="{$addMembersURL}" class="button no-popup"><span><i class="crm-i fa-user-plus" aria-hidden="true"></i> {ts 1=$group.title}Add Contacts to %1{/ts}</span></a>