From 838d0ff6fb7a05b0a5689523b97bec9610438ee5 Mon Sep 17 00:00:00 2001 From: Dave Greenberg Date: Mon, 28 Jul 2014 16:02:22 -0700 Subject: [PATCH] CRM-14997 - fix regression that caused Add Contacts to Group button to be ALWAYS hidden. ---------------------------------------- * CRM-14997: https://issues.civicrm.org/jira/browse/CRM-14997 --- CRM/Contact/Form/Search.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/CRM/Contact/Form/Search.php b/CRM/Contact/Form/Search.php index adb3c512ef..8522181ce3 100644 --- a/CRM/Contact/Form/Search.php +++ b/CRM/Contact/Form/Search.php @@ -418,10 +418,9 @@ class CRM_Contact_Form_Search extends CRM_Core_Form { $url = CRM_Utils_System::makeURL('qfKey') . $formQFKey; CRM_Utils_System::redirect($url); } + $permissionForGroup = FALSE; if (!empty($this->_groupID)) { - $permissionForGroup = FALSE; - // check if user has permission to edit members of this group $permission = CRM_Contact_BAO_Group::checkPermission($this->_groupID); if ($permission && in_array(CRM_Core_Permission::EDIT, $permission)) { @@ -431,13 +430,10 @@ class CRM_Contact_Form_Search extends CRM_Core_Form { // check if _groupID exists, it might not if // we are displaying a hidden group if (!isset($this->_group[$this->_groupID])) { - $permissionForGroup = FALSE; $this->_group[$this->_groupID] = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Group', $this->_groupID, 'title'); } - $this->assign('permissionedForGroup', $permissionForGroup); - // set the group title $groupValues = array('id' => $this->_groupID, 'title' => $this->_group[$this->_groupID]); $this->assign_by_ref('group', $groupValues); @@ -467,7 +463,7 @@ class CRM_Contact_Form_Search extends CRM_Core_Form { 'group_contact_status', ts('Group Status') ); - $this->assign('permissionedForGroup', FALSE); + $this->assign('permissionedForGroup', $permissionForGroup); } // add the go button for the action form, note it is of type 'next' rather than of type 'submit' -- 2.25.1