From 6d0e92a1db8bcbd745b4e3241960bc427659e754 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 11b5189ed5..12cc49594f 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 3733250208..d08c024fc0 100644 --- a/CRM/UF/Page/Group.php +++ b/CRM/UF/Page/Group.php @@ -345,10 +345,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::BASIC; $action -= CRM_Core_Action::PROFILE; -- 2.25.1