Skip to content

Commit bec5fc5

Browse files
committed
CustomData - Move cg_extends from installer to managed
Before: 3 ways this is declared: installer data, managed data, and hardcoded arrays in getCustomGroupExtendsOptions() After: 2 ways. Installer data moved to managed data
1 parent 16fd023 commit bec5fc5

4 files changed

Lines changed: 57 additions & 13 deletions

File tree

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php
2+
use CRM_Contribute_ExtensionUtil as E;
3+
4+
// This enables custom fields for Survey entities
5+
return [
6+
[
7+
'name' => 'cg_extend_objects:Survey',
8+
'entity' => 'OptionValue',
9+
'cleanup' => 'always',
10+
'update' => 'always',
11+
'params' => [
12+
'version' => 4,
13+
'values' => [
14+
'option_group_id.name' => 'cg_extend_objects',
15+
'label' => E::ts('Survey'),
16+
'value' => 'Survey',
17+
'name' => 'civicrm_survey',
18+
'is_reserved' => TRUE,
19+
'is_active' => TRUE,
20+
'grouping' => NULL,
21+
],
22+
'match' => [
23+
'name',
24+
'option_group_id',
25+
],
26+
],
27+
],
28+
];

ext/civi_case/info.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
</classloader>
4040
<mixins>
4141
<mixin>ang-php@1.0.0</mixin>
42+
<mixin>mgd-php@2.0.0</mixin>
4243
<mixin>setting-php@1.0.0</mixin>
4344
<mixin>scan-classes@1.0.0</mixin>
4445
</mixins>
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php
2+
use CRM_Contribute_ExtensionUtil as E;
3+
4+
// This enables custom fields for Case entities
5+
return [
6+
[
7+
'name' => 'cg_extend_objects:Case',
8+
'entity' => 'OptionValue',
9+
'cleanup' => 'always',
10+
'update' => 'always',
11+
'params' => [
12+
'version' => 4,
13+
'values' => [
14+
'option_group_id.name' => 'cg_extend_objects',
15+
'label' => E::ts('Cases'),
16+
'value' => 'Case',
17+
'name' => 'civicrm_case',
18+
'is_reserved' => TRUE,
19+
'is_active' => TRUE,
20+
'grouping' => 'case_type_id',
21+
],
22+
'match' => [
23+
'name',
24+
'option_group_id',
25+
],
26+
],
27+
],
28+
];

sql/civicrm_data/civicrm_option_group/cg_extend_objects.sqldata.php

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,4 @@
22
return CRM_Core_CodeGen_OptionGroup::create('cg_extend_objects', 'a/0056')
33
->addMetadata([
44
'title' => ts('Objects a custom group extends to'),
5-
])
6-
->addValues([
7-
[
8-
'label' => ts('Survey'),
9-
'value' => 'Survey',
10-
'name' => 'civicrm_survey',
11-
],
12-
[
13-
'label' => ts('Cases'),
14-
'value' => 'Case',
15-
'name' => 'civicrm_case',
16-
'grouping' => 'case_type_id',
17-
],
185
]);

0 commit comments

Comments
 (0)