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>
Thu, 10 Mar 2016 13:55:08 +0000 (19:25 +0530)
----------------------------------------
* CRM-18204: Enables use of Mixed Profile for create mode
  https://issues.civicrm.org/jira/browse/CRM-18204

Conflicts:

CRM/UF/Page/Group.php

CRM/UF/Page/Group.php

index 4d0fdf7179266fd98baba4823755cc81b7595394..914622fc2cb442a327379027326d5f9cd439679a 100644 (file)
@@ -342,10 +342,12 @@ class CRM_UF_Page_Group extends CRM_Core_Page {
       }
 
       $groupTypes = self::extractGroupTypes($value['group_type']);
-      $groupComponents = array('Contribution', 'Membership', 'Activity', 'Participant', 'Case');
 
-      // drop Create, Edit and View mode links if profile group_type is Contribution, Membership, Activities or Participant
-      $componentFound = array_intersect($groupComponents, array_keys($groupTypes));
+      // 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)) {
         $action -= CRM_Core_Action::ADD;
       }