From: Seamus Lee Date: Wed, 5 Aug 2020 23:57:26 +0000 (+1000) Subject: Apply edit groups permission check to the button not the generaal permissionedForGrou... X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=ee21bfd4cc45e85ae569e441cd9c0c263eb6fd60;p=civicrm-core.git Apply edit groups permission check to the button not the generaal permissionedForGroup check --- diff --git a/CRM/Contact/Form/Search.php b/CRM/Contact/Form/Search.php index 2af1c15e70..25c95ac6b7 100644 --- a/CRM/Contact/Form/Search.php +++ b/CRM/Contact/Form/Search.php @@ -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); } diff --git a/templates/CRM/Contact/Form/Search/Intro.tpl b/templates/CRM/Contact/Form/Search/Intro.tpl index 3d0b47163a..adc70018d0 100644 --- a/templates/CRM/Contact/Form/Search/Intro.tpl +++ b/templates/CRM/Contact/Form/Search/Intro.tpl @@ -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"} {/if} + {/if} + {if $permissionedForGroup} {capture assign=addMembersURL}{crmURL q="context=amtg&amtgID=`$group.id`&reset=1"}{/capture}
{ts 1=$group.title}Add Contacts to %1{/ts}