From 7e50650dc4838bafd4aaca0209258708fce95cce Mon Sep 17 00:00:00 2001 From: Pradeep Nayak Date: Fri, 11 Mar 2016 14:10:25 +0530 Subject: [PATCH] --CRM-18204, modified code to use checkProfileType function --- CRM/UF/Page/Field.php | 6 ++---- CRM/UF/Page/Group.php | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/CRM/UF/Page/Field.php b/CRM/UF/Page/Field.php index ef76bec53e..7fb6b880eb 100644 --- a/CRM/UF/Page/Field.php +++ b/CRM/UF/Page/Field.php @@ -125,10 +125,8 @@ class CRM_UF_Page_Field extends CRM_Core_Page { $isGroupReserved = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_UFGroup', $this->_gid, 'is_reserved'); $this->assign('isGroupReserved', $isGroupReserved); - $profileType = CRM_Core_BAO_UFField::getProfileType($this->_gid); - $contactTypes = CRM_Contact_BAO_ContactType::contactTypes(); - $contactTypes[] = 'Contact'; - if (!in_array($profileType, $contactTypes)) { + $isMixedProfile = CRM_Core_BAO_UFField::checkProfileType($this->_gid); + if ($isMixedProfile) { $this->assign('skipCreate', TRUE); } diff --git a/CRM/UF/Page/Group.php b/CRM/UF/Page/Group.php index 43b06697bf..aa60dd5e57 100644 --- a/CRM/UF/Page/Group.php +++ b/CRM/UF/Page/Group.php @@ -352,10 +352,8 @@ class CRM_UF_Page_Group extends CRM_Core_Page { // drop Create, Edit and View mode links if profile group_type is one of the following: // Contribution, Membership, Activity, Participant, Case, Grant - $contactTypes = CRM_Contact_BAO_ContactType::contactTypes(); - $contactTypes[] = 'Contact'; - $componentFound = array_diff(array_keys($groupTypes), $contactTypes); - if (!empty($componentFound)) { + $isMixedProfile = CRM_Core_BAO_UFField::checkProfileType($id); + if ($isMixedProfile) { $action -= CRM_Core_Action::ADD; $action -= CRM_Core_Action::ADVANCED; $action -= CRM_Core_Action::BASIC; -- 2.25.1