$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);
}
// 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;