Skip to content

Commit

Permalink
WIP Add CustomGroup membership_payment as managed entity
Browse files Browse the repository at this point in the history
  • Loading branch information
mflandorfer committed Jul 10, 2024
1 parent 803ab0d commit 1bc7c81
Show file tree
Hide file tree
Showing 3 changed files with 212 additions and 141 deletions.
2 changes: 0 additions & 2 deletions CRM/Contract/Upgrader.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ public function enable() {
$customData->syncOptionGroup(__DIR__ . '/../../resources/option_group_shirt_type.json');
$customData->syncOptionGroup(__DIR__ . '/../../resources/option_group_shirt_size.json');
$customData->syncOptionGroup(__DIR__ . '/../../resources/option_group_contribution_recur_status.json');
$customData->syncCustomGroup(__DIR__ . '/../../resources/custom_group_membership_payment.json');
$customData->syncEntities(__DIR__ . '/../../resources/entities_membership_status.json');

// create sub-type 'Dialoger'
Expand Down Expand Up @@ -57,7 +56,6 @@ public function uninstall() {
public function upgrade_1360() {
$this->ctx->log->info('Applying update 1360');
$customData = new CRM_Contract_CustomData('de.systopia.contract');
$customData->syncCustomGroup(__DIR__ . '/../../resources/custom_group_membership_payment.json');
return TRUE;
}

Expand Down
212 changes: 212 additions & 0 deletions managed/CustomGroup_membership_payment.mgd.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,212 @@
<?php

return [
[
'name' => 'CustomGroup_membership_payment',
'entity' => 'CustomGroup',
'cleanup' => 'never',
'update' => 'always',
'params' => [
'version' => 4,
'values' => [
'name' => 'membership_payment',
'title' => E::ts('Payment Information'),
'extends' => 'Membership',
'style' => 'Inline',
'weight' => 3,
'collapse_adv_display' => TRUE,
],
'match' => [
'extends',
'name',
],
],
],
[
'name' => 'CustomGroup_membership_payment_CustomField_membership_annual',
'entity' => 'CustomField',
'cleanup' => 'never',
'update' => 'always',
'params' => [
'version' => 4,
'values' => [
'custom_group_id.name' => 'membership_payment',
'name' => 'membership_annual',
'label' => E::ts('Annual Membership Contribution'),
'data_type' => 'Money',
'html_type' => 'Text',
'is_searchable' => TRUE,
'is_search_range' => TRUE,
'column_name' => 'membership_annual',
'in_selector' => TRUE,
],
'match' => [
'custom_group_id',
'name',
],
],
],
[
'name' => 'CustomGroup_membership_payment_CustomField_membership_frequency',
'entity' => 'CustomField',
'cleanup' => 'never',
'update' => 'always',
'params' => [
'version' => 4,
'values' => [
'custom_group_id.name' => 'membership_payment',
'name' => 'membership_frequency',
'label' => E::ts('Payment Interval'),
'html_type' => 'Select',
'is_searchable' => TRUE,
'column_name' => 'membership_frequency',
'option_group_id.name' => 'payment_frequency',
'in_selector' => TRUE,
],
'match' => [
'custom_group_id',
'name',
],
],
],
[
'name' => 'CustomGroup_membership_payment_CustomField_membership_recurring_contribution',
'entity' => 'CustomField',
'cleanup' => 'never',
'update' => 'always',
'params' => [
'version' => 4,
'values' => [
'custom_group_id.name' => 'membership_payment',
'name' => 'membership_recurring_contribution',
'label' => E::ts('Recurring contribution/mandate'),
'data_type' => 'Int',
'html_type' => 'Text',
'is_searchable' => TRUE,
'column_name' => 'membership_recurring_contribution',
'in_selector' => TRUE,
'fk_entity' => 'ContributionRecur',
],
'match' => [
'custom_group_id',
'name',
],
],
],
[
'name' => 'CustomGroup_membership_payment_CustomField_to_ba',
'entity' => 'CustomField',
'cleanup' => 'never',
'update' => 'always',
'params' => [
'version' => 4,
'values' => [
'custom_group_id.name' => 'membership_payment',
'name' => 'to_ba',
'label' => E::ts("Organisation's Bank Account"),
'data_type' => 'Int',
'html_type' => 'Text',
'is_searchable' => TRUE,
'column_name' => 'to_ba',
'in_selector' => TRUE,
],
'match' => [
'custom_group_id',
'name',
],
],
],
[
'name' => 'CustomGroup_membership_payment_CustomField_from_ba',
'entity' => 'CustomField',
'cleanup' => 'never',
'update' => 'always',
'params' => [
'version' => 4,
'values' => [
'custom_group_id.name' => 'membership_payment',
'name' => 'from_ba',
'label' => E::ts("Donor's Bank Account"),
'data_type' => 'Int',
'html_type' => 'Text',
'is_searchable' => TRUE,
'column_name' => 'from_ba',
'in_selector' => TRUE,
],
'match' => [
'custom_group_id',
'name',
],
],
],
[
'name' => 'CustomGroup_membership_payment_CustomField_cycle_day',
'entity' => 'CustomField',
'cleanup' => 'never',
'update' => 'always',
'params' => [
'version' => 4,
'values' => [
'custom_group_id.name' => 'membership_payment',
'name' => 'cycle_day',
'label' => E::ts('Cycle day'),
'data_type' => 'Int',
'html_type' => 'Text',
'is_searchable' => TRUE,
'column_name' => 'cycle_day',
'in_selector' => TRUE,
],
'match' => [
'custom_group_id',
'name',
],
],
],
[
'name' => 'CustomGroup_membership_payment_CustomField_payment_instrument',
'entity' => 'CustomField',
'cleanup' => 'never',
'update' => 'always',
'params' => [
'version' => 4,
'values' => [
'custom_group_id.name' => 'membership_payment',
'name' => 'payment_instrument',
'label' => E::ts('Payment method'),
'data_type' => 'Int',
'html_type' => 'Text',
'is_searchable' => TRUE,
'column_name' => 'payment_instrument',
'in_selector' => TRUE,
],
'match' => [
'custom_group_id',
'name',
],
],
],
[
'name' => 'CustomGroup_membership_payment_CustomField_defer_payment_start',
'entity' => 'CustomField',
'cleanup' => 'never',
'update' => 'always',
'params' => [
'version' => 4,
'values' => [
'custom_group_id.name' => 'membership_payment',
'name' => 'defer_payment_start',
'label' => E::ts('Defer Payment Start'),
'data_type' => 'Boolean',
'html_type' => 'Radio',
'default_value' => '1',
'is_searchable' => TRUE,
'column_name' => 'defer_payment_start',
'in_selector' => TRUE,
],
'match' => [
'custom_group_id',
'name',
],
],
],
];
139 changes: 0 additions & 139 deletions resources/custom_group_membership_payment.json

This file was deleted.

0 comments on commit 1bc7c81

Please sign in to comment.