Skip to content

Commit

Permalink
Merge pull request #721 from jitendrapurohit/grantext
Browse files Browse the repository at this point in the history
D7 - port #719 - check for grant in the ext
  • Loading branch information
jitendrapurohit committed Mar 6, 2022
2 parents df779a2 + e2fb91f commit 4d82379
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions includes/utils.inc
Expand Up @@ -544,6 +544,17 @@ function wf_crm_get_fields($var = 'fields') {
'activity' => ['entity_type' => 'activity', 'label' => t('Activity'), 'max_instances' => 99, 'attachments' => TRUE],
'relationship' => ['entity_type' => 'contact', 'label' => t('Relationship'), 'help_text' => TRUE, 'custom_fields' => 'combined'],
];
$civicrm_version = wf_crm_apivalues('System', 'get')[0]['version'];
// Grant is moved to extension after > 5.47.0.
if (version_compare($civicrm_version, '5.47') >= 0) {
$components = array_diff($components, ['CiviGrant']);
$grantStatus = wf_crm_apivalues('Extension', 'get', [
'full_name' => 'civigrant'
], 'status');
if (array_pop($grantStatus) == 'installed') {
$components[] = 'CiviGrant';
}
}
$conditional_sets = [
'CiviCase' => ['entity_type' => 'case', 'label' => t('Case'), 'max_instances' => 30],
'CiviEvent' => ['entity_type' => 'participant', 'label' => t('Participant'), 'max_instances' => 9],
Expand Down

0 comments on commit 4d82379

Please sign in to comment.