CRM-18204, used contact type and contact sub type for checking uf group type
authorPradeep Nayak <pradpnayak@gmail.com>
Thu, 10 Mar 2016 13:48:52 +0000 (19:18 +0530)
committerPradeep Nayak <pradpnayak@gmail.com>
Fri, 11 Mar 2016 08:11:03 +0000 (13:41 +0530)
----------------------------------------
* CRM-18204: Enables use of Mixed Profile for create mode
  https://issues.civicrm.org/jira/browse/CRM-18204

CRM/UF/Page/Group.php

index 273dfab8fae523f578faad0c67565838944f0a16..932580fb499bc7056d567fbdfd99b08f3d2aeba8 100644 (file)
@@ -351,8 +351,10 @@ 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));
+      // Contribution, Membership, Activity, Participant, Case, Grant
+      $contactTypes = CRM_Contact_BAO_ContactType::contactTypes();
+      $contactTypes[] = 'Contact';
+      $componentFound = array_diff(array_keys($groupTypes), $contactTypes);
       if (!empty($componentFound)) {
         $action -= CRM_Core_Action::ADD;
       }