X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;ds=sidebyside;f=CRM%2FCore%2FBAO%2FCustomGroup.php;h=32494be2199d85a60cd288022f25830b44aac95f;hb=e9ff53910fd4c96490568b0096b0477058158586;hp=5a23b77886f72ac0f14e2abd8c2cf03ce2b9429d;hpb=0fccb17f3cf8138fc43aed4b48fd23a38394bbf8;p=civicrm-core.git diff --git a/CRM/Core/BAO/CustomGroup.php b/CRM/Core/BAO/CustomGroup.php index 5a23b77886..32494be219 100644 --- a/CRM/Core/BAO/CustomGroup.php +++ b/CRM/Core/BAO/CustomGroup.php @@ -329,7 +329,11 @@ class CRM_Core_BAO_CustomGroup extends CRM_Core_DAO_CustomGroup { * Do not restrict by subtype at all. (The parameter feels a bit cludgey but is only used from the * api - through which it is properly tested - so can be refactored with some comfort.) * + * @param bool $checkPermission + * * @return array + * Custom field 'tree'. + * * The returned array is keyed by group id and has the custom group table fields * and a subkey 'fields' holding the specific custom fields. * If entityId is passed in the fields keys have a subkey 'customValue' which holds custom data @@ -348,7 +352,8 @@ class CRM_Core_BAO_CustomGroup extends CRM_Core_DAO_CustomGroup { $subName = NULL, $fromCache = TRUE, $onlySubType = NULL, - $returnAll = FALSE + $returnAll = FALSE, + $checkPermission = TRUE ) { if ($entityID) { $entityID = CRM_Utils_Type::escape($entityID, 'Integer'); @@ -495,12 +500,13 @@ WHERE civicrm_custom_group.is_active = 1 // since groupID is false we need to show all Inline groups $strWhere .= " AND civicrm_custom_group.style = 'Inline'"; } - - // ensure that the user has access to these custom groups - $strWhere .= " AND " . - CRM_Core_Permission::customGroupClause(CRM_Core_Permission::VIEW, - 'civicrm_custom_group.' - ); + if ($checkPermission) { + // ensure that the user has access to these custom groups + $strWhere .= " AND " . + CRM_Core_Permission::customGroupClause(CRM_Core_Permission::VIEW, + 'civicrm_custom_group.' + ); + } $orderBy = " ORDER BY civicrm_custom_group.weight, @@ -1732,6 +1738,9 @@ ORDER BY civicrm_custom_group.weight, case 'Contribution': return 'civicrm_contribution'; + case 'ContributionRecur': + return 'civicrm_contribution_recur'; + case 'Relationship': return 'civicrm_relationship';