Merge pull request #7963 from jitendrapurohit/CRM-18174
authorMonish Deb <monish.deb@webaccessglobal.com>
Fri, 11 Mar 2016 14:20:20 +0000 (19:50 +0530)
committerMonish Deb <monish.deb@webaccessglobal.com>
Fri, 11 Mar 2016 14:20:20 +0000 (19:50 +0530)
CRM-18174 -- DB Error when Exporting Contact Using "Merge Household" …

CRM/UF/Page/Field.php
CRM/UF/Page/Group.php

index c2cec5186e358b8e81fd62277c4f1fbbecc868af..7fb6b880eb03be003ca612ccf13304570a35349e 100644 (file)
@@ -125,8 +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);
-    if ($profileType == 'Contribution' || $profileType == 'Membership' || $profileType == 'Activity' || $profileType == 'Participant') {
+    $isMixedProfile = CRM_Core_BAO_UFField::checkProfileType($this->_gid);
+    if ($isMixedProfile) {
       $this->assign('skipCreate', TRUE);
     }
 
index 273dfab8fae523f578faad0c67565838944f0a16..aa60dd5e571cc0fd0fd05d74ad498936c8ac96b6 100644 (file)
@@ -351,10 +351,13 @@ class CRM_UF_Page_Group extends CRM_Core_Page {
       $groupTypes = self::extractGroupTypes($value['group_type']);
 
       // drop Create, Edit and View mode links if profile group_type is one of the following:
-      $groupComponents = array('Contribution', 'Membership', 'Activity', 'Participant', 'Case');
-      $componentFound = array_intersect($groupComponents, array_keys($groupTypes));
-      if (!empty($componentFound)) {
+      // Contribution, Membership, Activity, Participant, Case, Grant
+      $isMixedProfile = CRM_Core_BAO_UFField::checkProfileType($id);
+      if ($isMixedProfile) {
         $action -= CRM_Core_Action::ADD;
+        $action -= CRM_Core_Action::ADVANCED;
+        $action -= CRM_Core_Action::BASIC;
+        $action -= CRM_Core_Action::PROFILE;
       }
 
       $ufGroup[$id]['group_type'] = self::formatGroupTypes($groupTypes);