From e5ba88979a636469e17f47854a3be753a5e12553 Mon Sep 17 00:00:00 2001 From: Manuel Flandorfer Date: Wed, 10 Jul 2024 17:24:16 +0200 Subject: [PATCH 1/8] GP-43974 Create managed entities for CustomGroups and OptionGroups --- CRM/Contract/Upgrader.php | 22 -- .../CustomGroup_contract_cancellation.mgd.php | 63 ++++ managed/CustomGroup_contract_updates.mgd.php | 332 ++++++++++++++++++ ...ustomGroup_membership_cancellation.mgd.php | 79 +++++ .../CustomGroup_membership_general.mgd.php | 148 ++++++++ .../CustomGroup_membership_payment.mgd.php | 223 ++++++++++++ managed/MembershipStatus.mgd.php | 173 +++++++++ managed/OptionGroup_activity_status.mgd.php | 48 +++ managed/OptionGroup_activity_type.mgd.php | 132 +++++++ managed/OptionGroup_contact_channel.mgd.php | 189 ++++++++++ ...OptionGroup_contract_cancel_reason.mgd.php | 50 +++ ...ionGroup_contribution_recur_status.mgd.php | 27 ++ managed/OptionGroup_order_type.mgd.php | 47 +++ managed/OptionGroup_payment_frequency.mgd.php | 170 +++++++++ managed/OptionGroup_shirt_size.mgd.php | 108 ++++++ managed/OptionGroup_shirt_type.mgd.php | 69 ++++ .../custom_group_contract_cancellation.json | 34 -- resources/custom_group_contract_updates.json | 196 ----------- .../custom_group_membership_cancellation.json | 49 --- .../custom_group_membership_general.json | 81 ----- .../custom_group_membership_payment.json | 139 -------- resources/entities_membership_status.json | 76 ---- resources/option_group_activity_status.json | 24 -- resources/option_group_activity_types.json | 60 ---- resources/option_group_contact_channel.json | 15 - .../option_group_contract_cancel_reason.json | 19 - ...ption_group_contribution_recur_status.json | 15 - resources/option_group_order_type.json | 20 -- resources/option_group_payment_frequency.json | 81 ----- resources/option_group_shirt_size.json | 49 --- resources/option_group_shirt_type.json | 29 -- 31 files changed, 1858 insertions(+), 909 deletions(-) create mode 100644 managed/CustomGroup_contract_cancellation.mgd.php create mode 100644 managed/CustomGroup_contract_updates.mgd.php create mode 100644 managed/CustomGroup_membership_cancellation.mgd.php create mode 100644 managed/CustomGroup_membership_general.mgd.php create mode 100644 managed/CustomGroup_membership_payment.mgd.php create mode 100644 managed/MembershipStatus.mgd.php create mode 100644 managed/OptionGroup_activity_status.mgd.php create mode 100644 managed/OptionGroup_activity_type.mgd.php create mode 100644 managed/OptionGroup_contact_channel.mgd.php create mode 100644 managed/OptionGroup_contract_cancel_reason.mgd.php create mode 100644 managed/OptionGroup_contribution_recur_status.mgd.php create mode 100644 managed/OptionGroup_order_type.mgd.php create mode 100644 managed/OptionGroup_payment_frequency.mgd.php create mode 100644 managed/OptionGroup_shirt_size.mgd.php create mode 100644 managed/OptionGroup_shirt_type.mgd.php delete mode 100644 resources/custom_group_contract_cancellation.json delete mode 100644 resources/custom_group_contract_updates.json delete mode 100644 resources/custom_group_membership_cancellation.json delete mode 100644 resources/custom_group_membership_general.json delete mode 100644 resources/custom_group_membership_payment.json delete mode 100644 resources/entities_membership_status.json delete mode 100644 resources/option_group_activity_status.json delete mode 100644 resources/option_group_activity_types.json delete mode 100644 resources/option_group_contact_channel.json delete mode 100644 resources/option_group_contract_cancel_reason.json delete mode 100644 resources/option_group_contribution_recur_status.json delete mode 100644 resources/option_group_order_type.json delete mode 100644 resources/option_group_payment_frequency.json delete mode 100644 resources/option_group_shirt_size.json delete mode 100644 resources/option_group_shirt_type.json diff --git a/CRM/Contract/Upgrader.php b/CRM/Contract/Upgrader.php index 35fdac86..90732197 100644 --- a/CRM/Contract/Upgrader.php +++ b/CRM/Contract/Upgrader.php @@ -24,21 +24,6 @@ public function install() { public function enable() { require_once 'CRM/Contract/CustomData.php'; $customData = new CRM_Contract_CustomData('de.systopia.contract'); - $customData->syncOptionGroup(__DIR__ . '/../../resources/option_group_contact_channel.json'); - $customData->syncOptionGroup(__DIR__ . '/../../resources/option_group_contract_cancel_reason.json'); - $customData->syncOptionGroup(__DIR__ . '/../../resources/option_group_contract_cancel_reason.json'); - $customData->syncOptionGroup(__DIR__ . '/../../resources/option_group_payment_frequency.json'); - $customData->syncOptionGroup(__DIR__ . '/../../resources/option_group_activity_types.json'); - $customData->syncOptionGroup(__DIR__ . '/../../resources/option_group_activity_status.json'); - $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_contract_cancellation.json'); - $customData->syncCustomGroup(__DIR__ . '/../../resources/custom_group_contract_updates.json'); - $customData->syncCustomGroup(__DIR__ . '/../../resources/custom_group_membership_cancellation.json'); - $customData->syncCustomGroup(__DIR__ . '/../../resources/custom_group_membership_payment.json'); - $customData->syncCustomGroup(__DIR__ . '/../../resources/custom_group_membership_general.json'); - $customData->syncEntities(__DIR__ . '/../../resources/entities_membership_status.json'); // create sub-type 'Dialoger' $dialoger_exists = civicrm_api3('ContactType', 'getcount', ['name' => 'Dialoger']); @@ -65,8 +50,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_contract_updates.json'); - $customData->syncCustomGroup(__DIR__ . '/../../resources/custom_group_membership_payment.json'); return TRUE; } @@ -86,9 +69,6 @@ public function upgrade_1390() { public function upgrade_1402() { $this->ctx->log->info('Applying updates for 14xx'); $customData = new CRM_Contract_CustomData('de.systopia.contract'); - $customData->syncOptionGroup(__DIR__ . '/../../resources/option_group_contact_channel.json'); - $customData->syncOptionGroup(__DIR__ . '/../../resources/option_group_order_type.json'); - $customData->syncCustomGroup(__DIR__ . '/../../resources/custom_group_membership_general.json'); return TRUE; } @@ -134,7 +114,6 @@ protected function convertLegacyUpdates() { public function upgrade_1500() { $this->ctx->log->info('Applying update 1500'); $customData = new CRM_Contract_CustomData('de.systopia.contract'); - $customData->syncCustomGroup(__DIR__ . '/../../resources/custom_group_contract_updates.json'); $this->convertLegacyUpdates(); return TRUE; } @@ -142,7 +121,6 @@ public function upgrade_1500() { public function upgrade_1510() { $this->ctx->log->info('Applying update 1510'); $customData = new CRM_Contract_CustomData('de.systopia.contract'); - $customData->syncOptionGroup(__DIR__ . '/../../resources/option_group_contribution_recur_status.json'); return TRUE; } } diff --git a/managed/CustomGroup_contract_cancellation.mgd.php b/managed/CustomGroup_contract_cancellation.mgd.php new file mode 100644 index 00000000..5a5e659a --- /dev/null +++ b/managed/CustomGroup_contract_cancellation.mgd.php @@ -0,0 +1,63 @@ + 'CustomGroup_contract_cancellation', + 'entity' => 'CustomGroup', + 'cleanup' => 'never', + 'update' => 'always', + 'params' => [ + 'version' => 4, + 'values' => [ + 'name' => 'contract_cancellation', + 'title' => E::ts('Contract Cancellation'), + 'extends' => 'Activity', + 'extends_entity_column_value' => [ + $activity_type_contract_cancelled, + ], + 'style' => 'Inline', + 'collapse_display' => TRUE, + 'weight' => 6, + 'collapse_adv_display' => TRUE, + 'is_active' => TRUE, + ], + 'match' => [ + 'extends', + 'name', + ], + ], + ], + [ + 'name' => 'CustomGroup_contract_cancellation_CustomField_contact_history_cancel_reason', + 'entity' => 'CustomField', + 'cleanup' => 'never', + 'update' => 'always', + 'params' => [ + 'version' => 4, + 'values' => [ + 'custom_group_id.name' => 'contract_cancellation', + 'name' => 'contact_history_cancel_reason', + 'label' => E::ts('Cancel Reason'), + 'html_type' => 'Select', + 'is_searchable' => TRUE, + 'is_search_range' => TRUE, + 'column_name' => 'contact_history_cancel_reason', + 'option_group_id.name' => 'contract_cancel_reason', + 'in_selector' => TRUE, + 'is_active' => TRUE, + ], + 'match' => [ + 'custom_group_id', + 'name', + ], + ], + ], +]; diff --git a/managed/CustomGroup_contract_updates.mgd.php b/managed/CustomGroup_contract_updates.mgd.php new file mode 100644 index 00000000..77d83705 --- /dev/null +++ b/managed/CustomGroup_contract_updates.mgd.php @@ -0,0 +1,332 @@ + 'CustomGroup_contract_updates', + 'entity' => 'CustomGroup', + 'cleanup' => 'never', + 'update' => 'always', + 'params' => [ + 'version' => 4, + 'values' => [ + 'name' => 'contract_updates', + 'title' => E::ts('Contract Updates'), + 'extends' => 'Activity', + 'extends_entity_column_value' => [ + $activity_type_contract_updated, + $activity_type_contract_revived, + ], + 'style' => 'Inline', + 'weight' => 5, + 'collapse_adv_display' => TRUE, + 'is_active' => TRUE, + ], + 'match' => [ + 'name', + 'extends', + ], + ], + ], + [ + 'name' => 'CustomGroup_contract_updates_CustomField_ch_membership_type', + 'entity' => 'CustomField', + 'cleanup' => 'never', + 'update' => 'always', + 'params' => [ + 'version' => 4, + 'values' => [ + 'custom_group_id.name' => 'contract_updates', + 'name' => 'ch_membership_type', + 'label' => E::ts('Membership Type'), + 'data_type' => 'EntityReference', + 'html_type' => 'Select', + 'is_searchable' => TRUE, + 'is_search_range' => TRUE, + 'is_view' => TRUE, + 'column_name' => 'ch_membership_type', + 'in_selector' => TRUE, + 'fk_entity' => 'MembershipType', + 'is_active' => TRUE, + ], + 'match' => [ + 'custom_group_id', + 'name', + ], + ], + ], + [ + 'name' => 'CustomGroup_contract_updates_CustomField_ch_annual', + 'entity' => 'CustomField', + 'cleanup' => 'never', + 'update' => 'always', + 'params' => [ + 'version' => 4, + 'values' => [ + 'custom_group_id.name' => 'contract_updates', + 'name' => 'ch_annual', + 'label' => E::ts('Annual Membership Contribution'), + 'data_type' => 'Money', + 'html_type' => 'Text', + 'is_searchable' => TRUE, + 'is_search_range' => TRUE, + 'is_view' => TRUE, + 'column_name' => 'ch_annual', + 'in_selector' => TRUE, + 'is_active' => TRUE, + ], + 'match' => [ + 'custom_group_id', + 'name', + ], + ], + ], + [ + 'name' => 'CustomGroup_contract_updates_CustomField_ch_annual_diff', + 'entity' => 'CustomField', + 'cleanup' => 'never', + 'update' => 'always', + 'params' => [ + 'version' => 4, + 'values' => [ + 'custom_group_id.name' => 'contract_updates', + 'name' => 'ch_annual_diff', + 'label' => E::ts('Increase'), + 'data_type' => 'Money', + 'html_type' => 'Text', + 'is_searchable' => TRUE, + 'is_search_range' => TRUE, + 'is_view' => TRUE, + 'column_name' => 'ch_annual_diff', + 'in_selector' => TRUE, + 'is_active' => TRUE, + ], + 'match' => [ + 'custom_group_id', + 'name', + ], + ], + ], + [ + 'name' => 'CustomGroup_contract_updates_CustomField_ch_frequency', + 'entity' => 'CustomField', + 'cleanup' => 'never', + 'update' => 'always', + 'params' => [ + 'version' => 4, + 'values' => [ + 'custom_group_id.name' => 'contract_updates', + 'name' => 'ch_frequency', + 'label' => E::ts('Payment Interval'), + 'html_type' => 'Select', + 'is_searchable' => TRUE, + 'is_search_range' => TRUE, + 'is_view' => TRUE, + 'column_name' => 'ch_frequency', + 'option_group_id.name' => 'payment_frequency', + 'in_selector' => TRUE, + 'is_active' => TRUE, + ], + 'match' => [ + 'custom_group_id', + 'name', + ], + ], + ], + [ + 'name' => 'CustomGroup_contract_updates_CustomField_ch_recurring_contribution', + 'entity' => 'CustomField', + 'cleanup' => 'never', + 'update' => 'always', + 'params' => [ + 'version' => 4, + 'values' => [ + 'custom_group_id.name' => 'contract_updates', + 'name' => 'ch_recurring_contribution', + 'label' => E::ts('Payment Contract'), + 'data_type' => 'EntityReference', + 'html_type' => 'Select', + 'is_searchable' => TRUE, + 'is_search_range' => TRUE, + 'is_view' => TRUE, + 'column_name' => 'ch_recurring_contribution', + 'in_selector' => TRUE, + 'fk_entity' => 'ContributionRecur', + 'is_active' => TRUE, + ], + 'match' => [ + 'custom_group_id', + 'name', + ], + ], + ], + [ + 'name' => 'CustomGroup_contract_updates_CustomField_ch_to_ba', + 'entity' => 'CustomField', + 'cleanup' => 'never', + 'update' => 'always', + 'params' => [ + 'version' => 4, + 'values' => [ + 'custom_group_id.name' => 'contract_updates', + 'name' => 'ch_to_ba', + 'label' => E::ts('GP Bank Account'), + 'data_type' => 'Int', + 'html_type' => 'Text', + 'is_searchable' => TRUE, + 'is_search_range' => TRUE, + 'is_view' => TRUE, + 'column_name' => 'ch_to_ba', + 'in_selector' => TRUE, + 'is_active' => TRUE, + ], + 'match' => [ + 'custom_group_id', + 'name', + ], + ], + ], + [ + 'name' => 'CustomGroup_contract_updates_CustomField_ch_from_ba', + 'entity' => 'CustomField', + 'cleanup' => 'never', + 'update' => 'always', + 'params' => [ + 'version' => 4, + 'values' => [ + 'custom_group_id.name' => 'contract_updates', + 'name' => 'ch_from_ba', + 'label' => E::ts("Member's Bank Account"), + 'data_type' => 'Int', + 'html_type' => 'Text', + 'is_searchable' => TRUE, + 'is_search_range' => TRUE, + 'is_view' => TRUE, + 'column_name' => 'ch_from_ba', + 'in_selector' => TRUE, + 'is_active' => TRUE, + ], + 'match' => [ + 'custom_group_id', + 'name', + ], + ], + ], + [ + 'name' => 'CustomGroup_contract_updates_CustomField_ch_cycle_day', + 'entity' => 'CustomField', + 'cleanup' => 'never', + 'update' => 'always', + 'params' => [ + 'version' => 4, + 'values' => [ + 'custom_group_id.name' => 'contract_updates', + 'name' => 'ch_cycle_day', + 'label' => E::ts('Cycle Day'), + 'data_type' => 'Int', + 'html_type' => 'Text', + 'is_searchable' => TRUE, + 'is_search_range' => TRUE, + 'is_view' => TRUE, + 'column_name' => 'ch_cycle_day', + 'in_selector' => TRUE, + 'is_active' => TRUE, + ], + 'match' => [ + 'custom_group_id', + 'name', + ], + ], + ], + [ + 'name' => 'CustomGroup_contract_updates_CustomField_ch_payment_instrument', + 'entity' => 'CustomField', + 'cleanup' => 'never', + 'update' => 'always', + 'params' => [ + 'version' => 4, + 'values' => [ + 'custom_group_id.name' => 'contract_updates', + 'name' => 'ch_payment_instrument', + 'label' => E::ts('Payment Method'), + 'html_type' => 'Select', + 'is_searchable' => TRUE, + 'is_search_range' => TRUE, + 'is_view' => TRUE, + 'column_name' => 'ch_payment_instrument', + 'option_group_id.name' => 'payment_instrument', + 'in_selector' => TRUE, + 'is_active' => TRUE, + ], + 'match' => [ + 'custom_group_id', + 'name', + ], + ], + ], + [ + 'name' => 'CustomGroup_contract_updates_CustomField_ch_defer_payment_start', + 'entity' => 'CustomField', + 'cleanup' => 'never', + 'update' => 'always', + 'params' => [ + 'version' => 4, + 'values' => [ + 'custom_group_id.name' => 'contract_updates', + 'name' => 'ch_defer_payment_start', + 'label' => E::ts('Defer Payment Start'), + 'data_type' => 'Boolean', + 'html_type' => 'Radio', + 'default_value' => '1', + 'is_searchable' => TRUE, + 'is_search_range' => TRUE, + 'is_view' => TRUE, + 'column_name' => 'ch_defer_payment_start', + 'in_selector' => TRUE, + 'is_active' => TRUE, + ], + 'match' => [ + 'custom_group_id', + 'name', + ], + ], + ], + [ + 'name' => 'CustomGroup_contract_updates_CustomField_ch_payment_changes', + 'entity' => 'CustomField', + 'cleanup' => 'never', + 'update' => 'always', + 'params' => [ + 'version' => 4, + 'values' => [ + 'custom_group_id.name' => 'contract_updates', + 'name' => 'ch_payment_changes', + 'label' => E::ts('Payment changes'), + 'html_type' => 'Text', + 'is_search_range' => TRUE, + 'is_view' => TRUE, + 'text_length' => 1023, + 'column_name' => 'ch_payment_changes', + 'in_selector' => TRUE, + 'is_active' => TRUE, + ], + 'match' => [ + 'custom_group_id', + 'name', + ], + ], + ], +]; diff --git a/managed/CustomGroup_membership_cancellation.mgd.php b/managed/CustomGroup_membership_cancellation.mgd.php new file mode 100644 index 00000000..7926e6bd --- /dev/null +++ b/managed/CustomGroup_membership_cancellation.mgd.php @@ -0,0 +1,79 @@ + 'CustomGroup_membership_cancellation', + 'entity' => 'CustomGroup', + 'cleanup' => 'never', + 'update' => 'always', + 'params' => [ + 'version' => 4, + 'values' => [ + 'name' => 'membership_cancellation', + 'title' => E::ts('Cancellation Information'), + 'extends' => 'Membership', + 'style' => 'Inline', + 'weight' => 4, + 'collapse_adv_display' => TRUE, + 'is_active' => TRUE, + ], + 'match' => [ + 'extends', + 'name', + ], + ], + ], + [ + 'name' => 'CustomGroup_membership_cancellation_CustomField_membership_cancel_reason', + 'entity' => 'CustomField', + 'cleanup' => 'never', + 'update' => 'always', + 'params' => [ + 'version' => 4, + 'values' => [ + 'custom_group_id.name' => 'membership_cancellation', + 'name' => 'membership_cancel_reason', + 'label' => E::ts('Cancel Reason'), + 'html_type' => 'Select', + 'is_searchable' => TRUE, + 'is_search_range' => TRUE, + 'column_name' => 'membership_cancel_reason', + 'option_group_id.name' => 'contract_cancel_reason', + 'in_selector' => TRUE, + 'is_active' => TRUE, + ], + 'match' => [ + 'custom_group_id', + 'name', + ], + ], + ], + [ + 'name' => 'CustomGroup_membership_cancellation_CustomField_membership_cancel_date', + 'entity' => 'CustomField', + 'cleanup' => 'never', + 'update' => 'always', + 'params' => [ + 'version' => 4, + 'values' => [ + 'custom_group_id.name' => 'membership_cancellation', + 'name' => 'membership_cancel_date', + 'label' => E::ts('Cancellation Date'), + 'data_type' => 'Date', + 'html_type' => 'Select Date', + 'is_searchable' => TRUE, + 'is_search_range' => TRUE, + 'date_format' => 'mm/dd/yy', + 'column_name' => 'membership_cancel_date', + 'in_selector' => TRUE, + 'is_active' => TRUE, + ], + 'match' => [ + 'custom_group_id', + 'name', + ], + ], + ], +]; diff --git a/managed/CustomGroup_membership_general.mgd.php b/managed/CustomGroup_membership_general.mgd.php new file mode 100644 index 00000000..3f16dfbc --- /dev/null +++ b/managed/CustomGroup_membership_general.mgd.php @@ -0,0 +1,148 @@ + 'CustomGroup_membership_general', + 'entity' => 'CustomGroup', + 'cleanup' => 'never', + 'update' => 'always', + 'params' => [ + 'version' => 4, + 'values' => [ + 'name' => 'membership_general', + 'title' => E::ts('General Information'), + 'extends' => 'Membership', + 'style' => 'Inline', + 'weight' => 31, + 'collapse_adv_display' => TRUE, + 'is_active' => TRUE, + ], + 'match' => [ + 'extends', + 'name', + ], + ], + ], + [ + 'name' => 'CustomGroup_membership_general_CustomField_membership_contract', + 'entity' => 'CustomField', + 'cleanup' => 'never', + 'update' => 'always', + 'params' => [ + 'version' => 4, + 'values' => [ + 'custom_group_id.name' => 'membership_general', + 'name' => 'membership_contract', + 'label' => E::ts('Contract Number'), + 'html_type' => 'Text', + 'is_searchable' => TRUE, + 'text_length' => 24, + 'column_name' => 'membership_contract', + 'in_selector' => TRUE, + 'is_active' => TRUE, + ], + 'match' => [ + 'custom_group_id', + 'name', + ], + ], + ], + [ + 'name' => 'CustomGroup_membership_general_CustomField_membership_reference', + 'entity' => 'CustomField', + 'cleanup' => 'never', + 'update' => 'always', + 'params' => [ + 'version' => 4, + 'values' => [ + 'custom_group_id.name' => 'membership_general', + 'name' => 'membership_reference', + 'label' => E::ts('Reference Number'), + 'html_type' => 'Text', + 'is_searchable' => TRUE, + 'text_length' => 24, + 'column_name' => 'membership_reference', + 'in_selector' => TRUE, + 'is_active' => TRUE, + ], + 'match' => [ + 'custom_group_id', + 'name', + ], + ], + ], + [ + 'name' => 'CustomGroup_membership_general_CustomField_membership_channel', + 'entity' => 'CustomField', + 'cleanup' => 'never', + 'update' => 'always', + 'params' => [ + 'version' => 4, + 'values' => [ + 'custom_group_id.name' => 'membership_general', + 'name' => 'membership_channel', + 'label' => E::ts('Membership Channel'), + 'html_type' => 'Select', + 'is_searchable' => TRUE, + 'is_search_range' => TRUE, + 'column_name' => 'membership_channel', + 'option_group_id.name' => 'contact_channel', + 'in_selector' => TRUE, + 'is_active' => TRUE, + ], + 'match' => [ + 'custom_group_id', + 'name', + ], + ], + ], + [ + 'name' => 'CustomGroup_membership_general_CustomField_membership_dialoger', + 'entity' => 'CustomField', + 'cleanup' => 'never', + 'update' => 'always', + 'params' => [ + 'version' => 4, + 'values' => [ + 'custom_group_id.name' => 'membership_general', + 'name' => 'membership_dialoger', + 'label' => E::ts('Dialoger'), + 'data_type' => 'ContactReference', + 'html_type' => 'Autocomplete-Select', + 'is_searchable' => TRUE, + 'is_search_range' => TRUE, + 'column_name' => 'membership_dialoger', + 'in_selector' => TRUE, + 'is_active' => TRUE, + ], + 'match' => [ + 'custom_group_id', + 'name', + ], + ], + ], + [ + 'name' => 'CustomGroup_membership_general_CustomField_contract_file', + 'entity' => 'CustomField', + 'cleanup' => 'never', + 'update' => 'always', + 'params' => [ + 'version' => 4, + 'values' => [ + 'custom_group_id.name' => 'membership_general', + 'name' => 'contract_file', + 'label' => E::ts('Contract File'), + 'data_type' => 'File', + 'html_type' => 'File', + 'column_name' => 'contract_file', + 'is_active' => TRUE, + ], + 'match' => [ + 'custom_group_id', + 'name', + ], + ], + ], +]; diff --git a/managed/CustomGroup_membership_payment.mgd.php b/managed/CustomGroup_membership_payment.mgd.php new file mode 100644 index 00000000..e51e1369 --- /dev/null +++ b/managed/CustomGroup_membership_payment.mgd.php @@ -0,0 +1,223 @@ + '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, + 'is_active' => 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, + 'is_active' => 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, + 'is_active' => 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' => 'EntityReference', + 'html_type' => 'Select', + 'is_searchable' => TRUE, + 'column_name' => 'membership_recurring_contribution', + 'in_selector' => TRUE, + 'fk_entity' => 'ContributionRecur', + 'is_active' => TRUE, + ], + '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, + 'is_active' => 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, + 'is_active' => 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, + 'is_active' => 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'), + 'html_type' => 'Select', + 'is_searchable' => TRUE, + 'column_name' => 'payment_instrument', + 'option_group_id.name' => 'payment_instrument', + 'in_selector' => TRUE, + 'is_active' => 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, + 'is_active' => TRUE, + ], + 'match' => [ + 'custom_group_id', + 'name', + ], + ], + ], +]; diff --git a/managed/MembershipStatus.mgd.php b/managed/MembershipStatus.mgd.php new file mode 100644 index 00000000..12daa300 --- /dev/null +++ b/managed/MembershipStatus.mgd.php @@ -0,0 +1,173 @@ + 'MembershipStatus_New', + 'entity' => 'MembershipStatus', + 'cleanup' => 'never', + 'update' => 'always', + 'params' => [ + 'version' => 4, + 'values' => [ + 'name' => 'New', + 'label' => E::ts('New'), + 'start_event' => 'join_date', + 'end_event' => 'join_date', + 'end_event_adjust_unit' => 'month', + 'end_event_adjust_interval' => 3, + 'is_current_member' => TRUE, + 'weight' => 1, + 'is_active' => FALSE, + ], + 'match' => [ + 'name', + ], + ], + ], + [ + 'name' => 'MembershipStatus_Current', + 'entity' => 'MembershipStatus', + 'cleanup' => 'never', + 'update' => 'always', + 'params' => [ + 'version' => 4, + 'values' => [ + 'name' => 'Current', + 'label' => E::ts('Current'), + 'start_event' => 'join_date', + 'end_event' => 'end_date', + 'is_current_member' => TRUE, + 'weight' => 2, + 'is_active' => TRUE, + ], + 'match' => [ + 'name', + ], + ], + ], + [ + 'name' => 'MembershipStatus_Grace', + 'entity' => 'MembershipStatus', + 'cleanup' => 'never', + 'update' => 'always', + 'params' => [ + 'version' => 4, + 'values' => [ + 'name' => 'Grace', + 'label' => E::ts('Grace'), + 'start_event' => 'end_date', + 'end_event' => 'end_date', + 'end_event_adjust_unit' => 'month', + 'end_event_adjust_interval' => 1, + 'is_current_member' => TRUE, + 'weight' => 3, + 'is_active' => FALSE, + ], + 'match' => [ + 'name', + ], + ], + ], + [ + 'name' => 'MembershipStatus_Expired', + 'entity' => 'MembershipStatus', + 'cleanup' => 'never', + 'update' => 'always', + 'params' => [ + 'version' => 4, + 'values' => [ + 'name' => 'Expired', + 'label' => E::ts('Expired'), + 'start_event' => 'end_date', + 'start_event_adjust_unit' => 'month', + 'start_event_adjust_interval' => 1, + 'weight' => 4, + 'is_active' => TRUE, + ], + 'match' => [ + 'name', + ], + ], + ], + [ + 'name' => 'MembershipStatus_Pending', + 'entity' => 'MembershipStatus', + 'cleanup' => 'never', + 'update' => 'always', + 'params' => [ + 'version' => 4, + 'values' => [ + 'name' => 'Pending', + 'label' => E::ts('Pending'), + 'start_event' => 'join_date', + 'end_event' => 'join_date', + 'is_current_member' => TRUE, + 'weight' => 5, + 'is_reserved' => TRUE, + 'is_active' => TRUE, + ], + 'match' => [ + 'name', + ], + ], + ], + [ + 'name' => 'MembershipStatus_Cancelled', + 'entity' => 'MembershipStatus', + 'cleanup' => 'never', + 'update' => 'always', + 'params' => [ + 'version' => 4, + 'values' => [ + 'name' => 'Cancelled', + 'label' => E::ts('Cancelled'), + 'start_event' => 'join_date', + 'end_event' => 'join_date', + 'weight' => 6, + 'is_active' => TRUE, + ], + 'match' => [ + 'name', + ], + ], + ], + [ + 'name' => 'MembershipStatus_Deceased', + 'entity' => 'MembershipStatus', + 'cleanup' => 'never', + 'update' => 'always', + 'params' => [ + 'version' => 4, + 'values' => [ + 'name' => 'Deceased', + 'label' => E::ts('Deceased'), + 'is_admin' => TRUE, + 'weight' => 7, + 'is_active' => TRUE, + ], + 'match' => [ + 'name', + ], + ], + ], + [ + 'name' => 'MembershipStatus_Paused', + 'entity' => 'MembershipStatus', + 'cleanup' => 'never', + 'update' => 'always', + 'params' => [ + 'version' => 4, + 'values' => [ + 'name' => 'Paused', + 'label' => E::ts('Paused'), + 'is_current_member' => TRUE, + 'is_active' => TRUE, + ], + 'match' => [ + 'name', + ], + ], + ], +]; diff --git a/managed/OptionGroup_activity_status.mgd.php b/managed/OptionGroup_activity_status.mgd.php new file mode 100644 index 00000000..2f6abd10 --- /dev/null +++ b/managed/OptionGroup_activity_status.mgd.php @@ -0,0 +1,48 @@ + 'OptionGroup_activity_status_OptionValue_Needs_Review', + 'entity' => 'OptionValue', + 'cleanup' => 'never', + 'update' => 'always', + 'params' => [ + 'version' => 4, + 'values' => [ + 'option_group_id.name' => 'activity_status', + 'label' => E::ts('Needs Review'), + 'value' => '9', + 'name' => 'Needs Review', + 'is_reserved' => TRUE, + 'is_active' => TRUE, + ], + 'match' => [ + 'name', + 'option_group_id', + ], + ], + ], + [ + 'name' => 'OptionGroup_activity_status_OptionValue_Failed', + 'entity' => 'OptionValue', + 'cleanup' => 'never', + 'update' => 'always', + 'params' => [ + 'version' => 4, + 'values' => [ + 'option_group_id.name' => 'activity_status', + 'label' => E::ts('Failed'), + 'value' => '10', + 'name' => 'Failed', + 'is_reserved' => TRUE, + 'is_active' => TRUE, + ], + 'match' => [ + 'name', + 'option_group_id', + ], + ], + ], +]; diff --git a/managed/OptionGroup_activity_type.mgd.php b/managed/OptionGroup_activity_type.mgd.php new file mode 100644 index 00000000..0f975af4 --- /dev/null +++ b/managed/OptionGroup_activity_type.mgd.php @@ -0,0 +1,132 @@ + 'OptionGroup_activity_type_OptionValue_Contract_Signed', + 'entity' => 'OptionValue', + 'cleanup' => 'never', + 'update' => 'always', + 'params' => [ + 'version' => 4, + 'values' => [ + 'option_group_id.name' => 'activity_type', + 'label' => E::ts('Sign Contract'), + 'value' => '113', + 'name' => 'Contract_Signed', + 'is_reserved' => TRUE, + 'is_active' => TRUE, + ], + 'match' => [ + 'name', + 'option_group_id', + ], + ], + ], + [ + 'name' => 'OptionGroup_activity_type_OptionValue_Contract_Paused', + 'entity' => 'OptionValue', + 'cleanup' => 'never', + 'update' => 'always', + 'params' => [ + 'version' => 4, + 'values' => [ + 'option_group_id.name' => 'activity_type', + 'label' => E::ts('Pause Contract'), + 'value' => '114', + 'name' => 'Contract_Paused', + 'is_reserved' => TRUE, + 'is_active' => TRUE, + ], + 'match' => [ + 'name', + 'option_group_id', + ], + ], + ], + [ + 'name' => 'OptionGroup_activity_type_OptionValue_Contract_Resumed', + 'entity' => 'OptionValue', + 'cleanup' => 'never', + 'update' => 'always', + 'params' => [ + 'version' => 4, + 'values' => [ + 'option_group_id.name' => 'activity_type', + 'label' => E::ts('Resume Contract'), + 'value' => '115', + 'name' => 'Contract_Resumed', + 'is_reserved' => TRUE, + 'is_active' => TRUE, + ], + 'match' => [ + 'name', + 'option_group_id', + ], + ], + ], + [ + 'name' => 'OptionGroup_activity_type_OptionValue_Contract_Updated', + 'entity' => 'OptionValue', + 'cleanup' => 'never', + 'update' => 'always', + 'params' => [ + 'version' => 4, + 'values' => [ + 'option_group_id.name' => 'activity_type', + 'label' => E::ts('Update Contract'), + 'value' => '116', + 'name' => 'Contract_Updated', + 'is_reserved' => TRUE, + 'is_active' => TRUE, + ], + 'match' => [ + 'name', + 'option_group_id', + ], + ], + ], + [ + 'name' => 'OptionGroup_activity_type_OptionValue_Contract_Cancelled', + 'entity' => 'OptionValue', + 'cleanup' => 'never', + 'update' => 'always', + 'params' => [ + 'version' => 4, + 'values' => [ + 'option_group_id.name' => 'activity_type', + 'label' => E::ts('Cancel Contract'), + 'value' => '117', + 'name' => 'Contract_Cancelled', + 'is_reserved' => TRUE, + 'is_active' => TRUE, + ], + 'match' => [ + 'name', + 'option_group_id', + ], + ], + ], + [ + 'name' => 'OptionGroup_activity_type_OptionValue_Contract_Revived', + 'entity' => 'OptionValue', + 'cleanup' => 'never', + 'update' => 'always', + 'params' => [ + 'version' => 4, + 'values' => [ + 'option_group_id.name' => 'activity_type', + 'label' => E::ts('Revive Contract'), + 'value' => '118', + 'name' => 'Contract_Revived', + 'is_reserved' => TRUE, + 'is_active' => TRUE, + ], + 'match' => [ + 'name', + 'option_group_id', + ], + ], + ], +]; diff --git a/managed/OptionGroup_contact_channel.mgd.php b/managed/OptionGroup_contact_channel.mgd.php new file mode 100644 index 00000000..d75233ea --- /dev/null +++ b/managed/OptionGroup_contact_channel.mgd.php @@ -0,0 +1,189 @@ + 'OptionGroup_contact_channel', + 'entity' => 'OptionGroup', + 'cleanup' => 'never', + 'update' => 'always', + 'params' => [ + 'version' => 4, + 'values' => [ + 'name' => 'contact_channel', + 'title' => E::ts('Channel'), + 'description' => E::ts('IMB Konaktart'), + 'is_active' => TRUE, + 'option_value_fields' => [ + 'name', + 'label', + 'description', + ], + ], + 'match' => [ + 'name', + ], + ], + ], + [ + 'name' => 'OptionGroup_contact_channel_OptionValue_F2F', + 'entity' => 'OptionValue', + 'cleanup' => 'never', + 'update' => 'always', + 'params' => [ + 'version' => 4, + 'values' => [ + 'option_group_id.name' => 'contact_channel', + 'label' => E::ts('F2F'), + 'value' => 'F2F', + 'name' => 'F2F', + 'is_active' => TRUE, + ], + 'match' => [ + 'name', + 'option_group_id', + ], + ], + ], + [ + 'name' => 'OptionGroup_contact_channel_OptionValue_D2D', + 'entity' => 'OptionValue', + 'cleanup' => 'never', + 'update' => 'always', + 'params' => [ + 'version' => 4, + 'values' => [ + 'option_group_id.name' => 'contact_channel', + 'label' => E::ts('D2D'), + 'value' => 'D2D', + 'name' => 'D2D', + 'is_active' => TRUE, + ], + 'match' => [ + 'name', + 'option_group_id', + ], + ], + ], + [ + 'name' => 'OptionGroup_contact_channel_OptionValue_Event', + 'entity' => 'OptionValue', + 'cleanup' => 'never', + 'update' => 'always', + 'params' => [ + 'version' => 4, + 'values' => [ + 'option_group_id.name' => 'contact_channel', + 'label' => E::ts('Event'), + 'value' => 'Event', + 'name' => 'Event', + 'is_active' => TRUE, + ], + 'match' => [ + 'name', + 'option_group_id', + ], + ], + ], + [ + 'name' => 'OptionGroup_contact_channel_OptionValue_Handel', + 'entity' => 'OptionValue', + 'cleanup' => 'never', + 'update' => 'always', + 'params' => [ + 'version' => 4, + 'values' => [ + 'option_group_id.name' => 'contact_channel', + 'label' => E::ts('Handel'), + 'value' => 'Handel', + 'name' => 'Handel', + 'is_active' => TRUE, + ], + 'match' => [ + 'name', + 'option_group_id', + ], + ], + ], + [ + 'name' => 'OptionGroup_contact_channel_OptionValue_VR', + 'entity' => 'OptionValue', + 'cleanup' => 'never', + 'update' => 'always', + 'params' => [ + 'version' => 4, + 'values' => [ + 'option_group_id.name' => 'contact_channel', + 'label' => E::ts('VR'), + 'value' => 'VR', + 'name' => 'VR', + 'is_active' => TRUE, + ], + 'match' => [ + 'name', + 'option_group_id', + ], + ], + ], + [ + 'name' => 'OptionGroup_contact_channel_OptionValue_DD_TFR', + 'entity' => 'OptionValue', + 'cleanup' => 'never', + 'update' => 'always', + 'params' => [ + 'version' => 4, + 'values' => [ + 'option_group_id.name' => 'contact_channel', + 'label' => E::ts('DD-TFR'), + 'value' => 'DD-TFR', + 'name' => 'DD_TFR', + 'is_active' => TRUE, + ], + 'match' => [ + 'name', + 'option_group_id', + ], + ], + ], + [ + 'name' => 'OptionGroup_contact_channel_OptionValue_Stand_F2F', + 'entity' => 'OptionValue', + 'cleanup' => 'never', + 'update' => 'always', + 'params' => [ + 'version' => 4, + 'values' => [ + 'option_group_id.name' => 'contact_channel', + 'label' => E::ts('Stand F2F'), + 'value' => 'Stand F2F', + 'name' => 'Stand_F2F', + 'is_active' => TRUE, + ], + 'match' => [ + 'name', + 'option_group_id', + ], + ], + ], + [ + 'name' => 'OptionGroup_contact_channel_OptionValue_Unknown', + 'entity' => 'OptionValue', + 'cleanup' => 'never', + 'update' => 'always', + 'params' => [ + 'version' => 4, + 'values' => [ + 'option_group_id.name' => 'contact_channel', + 'label' => E::ts('Unknown'), + 'value' => '1', + 'name' => 'Unknown', + 'is_active' => TRUE, + ], + 'match' => [ + 'name', + 'option_group_id', + ], + ], + ], +]; diff --git a/managed/OptionGroup_contract_cancel_reason.mgd.php b/managed/OptionGroup_contract_cancel_reason.mgd.php new file mode 100644 index 00000000..e95b5780 --- /dev/null +++ b/managed/OptionGroup_contract_cancel_reason.mgd.php @@ -0,0 +1,50 @@ + 'OptionGroup_contract_cancel_reason', + 'entity' => 'OptionGroup', + 'cleanup' => 'never', + 'update' => 'always', + 'params' => [ + 'version' => 4, + 'values' => [ + 'name' => 'contract_cancel_reason', + 'title' => E::ts('Contract Cancel Reason'), + 'description' => E::ts('Dropdown options for Contract cancellation reasons'), + 'is_reserved' => FALSE, + 'is_active' => TRUE, + 'option_value_fields' => [ + 'name', + 'label', + 'description', + ], + ], + 'match' => [ + 'name', + ], + ], + ], + [ + 'name' => 'OptionGroup_contract_cancel_reason_OptionValue_Unknown', + 'entity' => 'OptionValue', + 'cleanup' => 'never', + 'update' => 'always', + 'params' => [ + 'version' => 4, + 'values' => [ + 'option_group_id.name' => 'contract_cancel_reason', + 'label' => E::ts('Unknown'), + 'value' => '1', + 'name' => 'Unknown', + 'is_active' => TRUE, + ], + 'match' => [ + 'name', + 'option_group_id', + ], + ], + ], +]; diff --git a/managed/OptionGroup_contribution_recur_status.mgd.php b/managed/OptionGroup_contribution_recur_status.mgd.php new file mode 100644 index 00000000..bbb987b4 --- /dev/null +++ b/managed/OptionGroup_contribution_recur_status.mgd.php @@ -0,0 +1,27 @@ + 'OptionGroup_contribution_recur_status_OptionValue_Paused', + 'entity' => 'OptionValue', + 'cleanup' => 'never', + 'update' => 'always', + 'params' => [ + 'version' => 4, + 'values' => [ + 'option_group_id.name' => 'contribution_recur_status', + 'label' => E::ts('Paused'), + 'value' => '9', + 'name' => 'Paused', + 'is_reserved' => TRUE, + 'is_active' => TRUE, + ], + 'match' => [ + 'name', + 'option_group_id', + ], + ], + ], +]; diff --git a/managed/OptionGroup_order_type.mgd.php b/managed/OptionGroup_order_type.mgd.php new file mode 100644 index 00000000..eb6ef663 --- /dev/null +++ b/managed/OptionGroup_order_type.mgd.php @@ -0,0 +1,47 @@ + 'OptionGroup_order_type', + 'entity' => 'OptionGroup', + 'cleanup' => 'never', + 'update' => 'always', + 'params' => [ + 'version' => 4, + 'values' => [ + 'name' => 'order_type', + 'title' => E::ts('Order Type'), + 'is_active' => TRUE, + 'option_value_fields' => [ + 'name', + 'label', + 'description', + ], + ], + 'match' => [ + 'name', + ], + ], + ], + [ + 'name' => 'OptionGroup_order_type_OptionValue_welcome_gift', + 'entity' => 'OptionValue', + 'cleanup' => 'never', + 'update' => 'always', + 'params' => [ + 'version' => 4, + 'values' => [ + 'option_group_id.name' => 'order_type', + 'label' => E::ts('Welcome Gift'), + 'name' => 'Welcome Gift', + 'is_active' => TRUE, + ], + 'match' => [ + 'name', + 'option_group_id', + ], + ], + ], +]; diff --git a/managed/OptionGroup_payment_frequency.mgd.php b/managed/OptionGroup_payment_frequency.mgd.php new file mode 100644 index 00000000..f6082b22 --- /dev/null +++ b/managed/OptionGroup_payment_frequency.mgd.php @@ -0,0 +1,170 @@ + 'OptionGroup_payment_frequency', + 'entity' => 'OptionGroup', + 'cleanup' => 'never', + 'update' => 'always', + 'params' => [ + 'version' => 4, + 'values' => [ + 'name' => 'payment_frequency', + 'title' => E::ts('Payment Intervals'), + 'description' => E::ts('The value describes the payment interval in months'), + 'is_reserved' => FALSE, + 'is_active' => TRUE, + 'option_value_fields' => [ + 'name', + 'label', + 'description', + ], + ], + 'match' => [ + 'name', + ], + ], + ], + [ + 'name' => 'OptionGroup_payment_frequency_OptionValue_one_off', + 'entity' => 'OptionValue', + 'cleanup' => 'never', + 'update' => 'always', + 'params' => [ + 'version' => 4, + 'values' => [ + 'option_group_id.name' => 'payment_frequency', + 'label' => E::ts('one-off'), + 'value' => '0', + 'name' => 'one-off', + 'is_active' => TRUE, + ], + 'match' => [ + 'name', + 'option_group_id', + ], + ], + ], + [ + 'name' => 'OptionGroup_payment_frequency_OptionValue_annually', + 'entity' => 'OptionValue', + 'cleanup' => 'never', + 'update' => 'always', + 'params' => [ + 'version' => 4, + 'values' => [ + 'option_group_id.name' => 'payment_frequency', + 'label' => E::ts('annually'), + 'value' => '1', + 'name' => 'annually', + 'is_active' => TRUE, + ], + 'match' => [ + 'name', + 'option_group_id', + ], + ], + ], + [ + 'name' => 'OptionGroup_payment_frequency_OptionValue_semi_annually', + 'entity' => 'OptionValue', + 'cleanup' => 'never', + 'update' => 'always', + 'params' => [ + 'version' => 4, + 'values' => [ + 'option_group_id.name' => 'payment_frequency', + 'label' => E::ts('semi-annually'), + 'value' => '2', + 'name' => 'semi-annually', + 'is_active' => TRUE, + ], + 'match' => [ + 'name', + 'option_group_id', + ], + ], + ], + [ + 'name' => 'OptionGroup_payment_frequency_OptionValue_trimestral', + 'entity' => 'OptionValue', + 'cleanup' => 'never', + 'update' => 'always', + 'params' => [ + 'version' => 4, + 'values' => [ + 'option_group_id.name' => 'payment_frequency', + 'label' => E::ts('trimestral'), + 'value' => '3', + 'name' => 'trimestral', + 'is_active' => FALSE, + ], + 'match' => [ + 'name', + 'option_group_id', + ], + ], + ], + [ + 'name' => 'OptionGroup_payment_frequency_OptionValue_quarterly', + 'entity' => 'OptionValue', + 'cleanup' => 'never', + 'update' => 'always', + 'params' => [ + 'version' => 4, + 'values' => [ + 'option_group_id.name' => 'payment_frequency', + 'label' => E::ts('quarterly'), + 'value' => '4', + 'name' => 'quarterly', + 'is_active' => TRUE, + ], + 'match' => [ + 'name', + 'option_group_id', + ], + ], + ], + [ + 'name' => 'OptionGroup_payment_frequency_OptionValue_bi_monthly', + 'entity' => 'OptionValue', + 'cleanup' => 'never', + 'update' => 'always', + 'params' => [ + 'version' => 4, + 'values' => [ + 'option_group_id.name' => 'payment_frequency', + 'label' => E::ts('bi-monthly'), + 'value' => '6', + 'name' => 'bi-monthly', + 'is_active' => TRUE, + ], + 'match' => [ + 'name', + 'option_group_id', + ], + ], + ], + [ + 'name' => 'OptionGroup_payment_frequency_OptionValue_monthly', + 'entity' => 'OptionValue', + 'cleanup' => 'never', + 'update' => 'always', + 'params' => [ + 'version' => 4, + 'values' => [ + 'option_group_id.name' => 'payment_frequency', + 'label' => E::ts('monthly'), + 'value' => '12', + 'name' => 'monthly', + 'is_active' => TRUE, + ], + 'match' => [ + 'name', + 'option_group_id', + ], + ], + ], +]; diff --git a/managed/OptionGroup_shirt_size.mgd.php b/managed/OptionGroup_shirt_size.mgd.php new file mode 100644 index 00000000..535353b3 --- /dev/null +++ b/managed/OptionGroup_shirt_size.mgd.php @@ -0,0 +1,108 @@ + 'OptionGroup_shirt_size', + 'entity' => 'OptionGroup', + 'cleanup' => 'never', + 'update' => 'always', + 'params' => [ + 'version' => 4, + 'values' => [ + 'name' => 'shirt_size', + 'title' => E::ts('T-Shirt Size Options'), + 'is_active' => TRUE, + 'option_value_fields' => [ + 'name', + 'label', + 'description', + ], + ], + 'match' => [ + 'name', + ], + ], + ], + [ + 'name' => 'OptionGroup_shirt_size_OptionValue_S', + 'entity' => 'OptionValue', + 'cleanup' => 'never', + 'update' => 'always', + 'params' => [ + 'version' => 4, + 'values' => [ + 'option_group_id.name' => 'shirt_size', + 'label' => E::ts('S'), + 'value' => 'S', + 'name' => 'S', + 'is_active' => TRUE, + ], + 'match' => [ + 'name', + 'option_group_id', + ], + ], + ], + [ + 'name' => 'OptionGroup_shirt_size_OptionValue_M', + 'entity' => 'OptionValue', + 'cleanup' => 'never', + 'update' => 'always', + 'params' => [ + 'version' => 4, + 'values' => [ + 'option_group_id.name' => 'shirt_size', + 'label' => E::ts('M'), + 'value' => 'M', + 'name' => 'M', + 'is_active' => TRUE, + ], + 'match' => [ + 'name', + 'option_group_id', + ], + ], + ], + [ + 'name' => 'OptionGroup_shirt_size_OptionValue_L', + 'entity' => 'OptionValue', + 'cleanup' => 'never', + 'update' => 'always', + 'params' => [ + 'version' => 4, + 'values' => [ + 'option_group_id.name' => 'shirt_size', + 'label' => E::ts('L'), + 'value' => 'L', + 'name' => 'L', + 'is_active' => TRUE, + ], + 'match' => [ + 'name', + 'option_group_id', + ], + ], + ], + [ + 'name' => 'OptionGroup_shirt_size_OptionValue_XL', + 'entity' => 'OptionValue', + 'cleanup' => 'never', + 'update' => 'always', + 'params' => [ + 'version' => 4, + 'values' => [ + 'option_group_id.name' => 'shirt_size', + 'label' => E::ts('XL'), + 'value' => 'XL', + 'name' => 'XL', + 'is_active' => TRUE, + ], + 'match' => [ + 'name', + 'option_group_id', + ], + ], + ], +]; diff --git a/managed/OptionGroup_shirt_type.mgd.php b/managed/OptionGroup_shirt_type.mgd.php new file mode 100644 index 00000000..f417fe64 --- /dev/null +++ b/managed/OptionGroup_shirt_type.mgd.php @@ -0,0 +1,69 @@ + 'OptionGroup_shirt_type', + 'entity' => 'OptionGroup', + 'cleanup' => 'never', + 'update' => 'always', + 'params' => [ + 'version' => 4, + 'values' => [ + 'name' => 'shirt_type', + 'title' => E::ts('T-Shirt Type Options'), + 'is_reserved' => FALSE, + 'is_active' => TRUE, + 'option_value_fields' => [ + 'name', + 'label', + 'description', + ], + ], + 'match' => [ + 'name', + ], + ], + ], + [ + 'name' => 'OptionGroup_shirt_type_OptionValue_Herren', + 'entity' => 'OptionValue', + 'cleanup' => 'never', + 'update' => 'always', + 'params' => [ + 'version' => 4, + 'values' => [ + 'option_group_id.name' => 'shirt_type', + 'label' => E::ts('Herren'), + 'value' => 'M', + 'name' => 'Herren', + 'is_active' => TRUE, + ], + 'match' => [ + 'name', + 'option_group_id', + ], + ], + ], + [ + 'name' => 'OptionGroup_shirt_type_OptionValue_Damen', + 'entity' => 'OptionValue', + 'cleanup' => 'never', + 'update' => 'always', + 'params' => [ + 'version' => 4, + 'values' => [ + 'option_group_id.name' => 'shirt_type', + 'label' => E::ts('Damen'), + 'value' => 'W', + 'name' => 'Damen', + 'is_active' => TRUE, + ], + 'match' => [ + 'name', + 'option_group_id', + ], + ], + ], +]; diff --git a/resources/custom_group_contract_cancellation.json b/resources/custom_group_contract_cancellation.json deleted file mode 100644 index ba06311d..00000000 --- a/resources/custom_group_contract_cancellation.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "_lookup": ["name"], - "_translate": ["title"], - "name": "contract_cancellation", - "title": "Contract Cancellation", - "extends": "Activity", - "extends_entity_column_value": ["Contract_Cancelled"], - "style": "Inline", - "collapse_display": "1", - "is_active": "1", - "is_multiple": "0", - "table_name": "civicrm_value_contract_cancellation", - "collapse_adv_display": "1", - "is_reserved": "0", - "_fields": [ - { - "_lookup": ["column_name", "custom_group_id"], - "_translate": ["label"], - "weight": "1", - "name": "contact_history_cancel_reason", - "label": "Cancel Reason", - "data_type": "String", - "html_type": "Select", - "option_group_id": "contract_cancel_reason", - "is_required": "0", - "is_searchable": "1", - "is_search_range": "1", - "is_active": "1", - "is_view": "0", - "column_name": "contact_history_cancel_reason", - "in_selector": "1" - } - ] -} diff --git a/resources/custom_group_contract_updates.json b/resources/custom_group_contract_updates.json deleted file mode 100644 index e86019d1..00000000 --- a/resources/custom_group_contract_updates.json +++ /dev/null @@ -1,196 +0,0 @@ -{ - "_lookup": ["name"], - "_translate": ["title"], - "name": "contract_updates", - "title": "Contract Updates", - "extends": "Activity", - "extends_entity_column_value": ["Contract_Updated","Contract_Revived"], - "style": "Inline", - "collapse_display": "0", - "is_active": "1", - "is_multiple": "0", - "table_name": "civicrm_value_contract_updates", - "collapse_adv_display": "1", - "is_reserved": "0", - "_fields": [ - { - "_lookup": ["column_name", "custom_group_id"], - "_translate": ["label"], - "weight": "1", - "name": "ch_membership_type", - "column_name": "ch_membership_type", - "label": "Membership Type", - "data_type": "Int", - "html_type": "Text", - "is_required": "0", - "is_searchable": "1", - "is_search_range": "1", - "is_active": "1", - "is_view": "1", - "in_selector": "1" - }, - { - "_lookup": ["column_name", "custom_group_id"], - "_translate": ["label"], - "weight": "2", - "name": "ch_annual", - "column_name": "ch_annual", - "label": "Annual Membership Contribution", - "data_type": "Money", - "html_type": "Text", - "is_required": "0", - "is_searchable": "1", - "is_search_range": "1", - "is_active": "1", - "is_view": "1", - "in_selector": "1" - }, - { - "_lookup": ["column_name", "custom_group_id"], - "_translate": ["label"], - "weight": "3", - "name": "ch_annual_diff", - "column_name": "ch_annual_diff", - "label": "Increase", - "data_type": "Money", - "html_type": "Text", - "is_required": "0", - "is_searchable": "1", - "is_search_range": "1", - "is_active": "1", - "is_view": "1", - "in_selector": "1" - }, - { - "_lookup": ["column_name", "custom_group_id"], - "_translate": ["label"], - "weight": "4", - "name": "ch_frequency", - "column_name": "ch_frequency", - "label": "Payment Interval", - "data_type": "String", - "html_type": "Select", - "option_group_id": "payment_frequency", - "is_required": "0", - "is_searchable": "1", - "is_search_range": "1", - "is_active": "1", - "is_view": "1", - "in_selector": "1" - }, - { - "_lookup": ["column_name", "custom_group_id"], - "_translate": ["label"], - "weight": "5", - "name": "ch_recurring_contribution", - "column_name": "ch_recurring_contribution", - "label": "Payment Contract", - "data_type": "Int", - "html_type": "Text", - "is_required": "0", - "is_searchable": "1", - "is_search_range": "1", - "is_active": "1", - "is_view": "1", - "in_selector": "1" - }, - { - "_lookup": ["column_name", "custom_group_id"], - "_translate": ["label"], - "weight": "6", - "name": "ch_to_ba", - "column_name": "ch_to_ba", - "label": "GP Bank Account", - "data_type": "Int", - "html_type": "Text", - "is_required": "0", - "is_searchable": "1", - "is_search_range": "1", - "is_active": "1", - "is_view": "1", - "in_selector": "1" - }, - { - "_lookup": ["column_name", "custom_group_id"], - "_translate": ["label"], - "weight": "7", - "name": "ch_from_ba", - "column_name": "ch_from_ba", - "label": "Member's Bank Account", - "data_type": "Int", - "html_type": "Text", - "is_required": "0", - "is_searchable": "1", - "is_search_range": "1", - "is_active": "1", - "is_view": "1", - "in_selector": "1" - }, - { - "_lookup": ["column_name", "custom_group_id"], - "_translate": ["label"], - "weight": "8", - "name": "ch_cycle_day", - "column_name": "ch_cycle_day", - "label": "Cycle Day", - "data_type": "Int", - "html_type": "Text", - "is_required": "0", - "is_searchable": "1", - "is_search_range": "1", - "is_active": "1", - "is_view": "1", - "in_selector": "1" - }, - { - "_lookup": ["column_name", "custom_group_id"], - "_translate": ["label"], - "weight": "9", - "name": "ch_payment_instrument", - "column_name": "ch_payment_instrument", - "label": "Payment Method", - "data_type": "Int", - "html_type": "Text", - "is_required": "0", - "is_searchable": "1", - "is_search_range": "1", - "is_active": "1", - "is_view": "1", - "in_selector": "1" - }, - { - "_lookup": ["column_name", "custom_group_id"], - "_translate": ["label"], - "weight": "10", - "name": "ch_defer_payment_start", - "column_name": "ch_defer_payment_start", - "label": "Defer Payment Start", - "data_type": "Boolean", - "html_type": "Radio", - "default_value": "1", - "is_required": "0", - "is_searchable": "1", - "is_search_range": "1", - "is_active": "1", - "is_view": "1", - "in_selector": "1" - }, - { - "_lookup": ["column_name", "custom_group_id"], - "_translate": ["label"], - "weight": "11", - "name": "ch_payment_changes", - "column_name": "ch_payment_changes", - "label": "Payment changes", - "data_type": "String", - "text_length": "1023", - "html_type": "Text", - "is_required": "0", - "is_searchable": "0", - "is_search_range": "1", - "is_active": "1", - "is_view": "1", - "in_selector": "1" - } - ] -} \ No newline at end of file diff --git a/resources/custom_group_membership_cancellation.json b/resources/custom_group_membership_cancellation.json deleted file mode 100644 index 45b6640b..00000000 --- a/resources/custom_group_membership_cancellation.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "_lookup": ["name"], - "_translate": ["title"], - "name": "membership_cancellation", - "title": "Cancellation Information", - "extends": "Membership", - "style": "Inline", - "collapse_display": "0", - "is_active": "1", - "is_multiple": "0", - "table_name": "civicrm_value_membership_cancellation", - "collapse_adv_display": "1", - "is_reserved": "0", - "_fields": [ - { - "_lookup": ["column_name", "custom_group_id"], - "_translate": ["label"], - "weight": "1", - "name": "membership_cancel_date", - "column_name": "membership_cancel_date", - "label": "Cancellation Date", - "data_type": "Date", - "html_type": "Select Date", - "is_required": "0", - "is_searchable": "1", - "is_search_range": "1", - "is_active": "1", - "is_view": "0", - "in_selector": "1" - }, - { - "_lookup": ["column_name", "custom_group_id"], - "_translate": ["label"], - "weight": "1", - "name": "membership_cancel_reason", - "column_name": "membership_cancel_reason", - "label": "Cancel Reason", - "data_type": "String", - "html_type": "Select", - "option_group_id": "contract_cancel_reason", - "is_required": "0", - "is_searchable": "1", - "is_search_range": "1", - "is_active": "1", - "is_view": "0", - "in_selector": "1" - } - ] -} \ No newline at end of file diff --git a/resources/custom_group_membership_general.json b/resources/custom_group_membership_general.json deleted file mode 100644 index dedc1134..00000000 --- a/resources/custom_group_membership_general.json +++ /dev/null @@ -1,81 +0,0 @@ -{ - "_lookup": ["name"], - "_translate": ["title"], - "name": "membership_general", - "title": "General Information", - "extends": "Membership", - "style": "Inline", - "collapse_display": "0", - "is_active": "1", - "is_multiple": "0", - "table_name": "civicrm_value_membership_general", - "collapse_adv_display": "1", - "is_reserved": "0", - "_fields": [ - { - "_lookup": ["column_name", "custom_group_id"], - "_translate": ["label"], - "weight": "1", - "name": "membership_channel", - "column_name": "membership_channel", - "label": "Membership Channel", - "data_type": "String", - "html_type": "Select", - "option_group_id": "contact_channel", - "is_required": "0", - "is_searchable": "1", - "is_search_range": "1", - "is_active": "1", - "is_view": "0", - "in_selector": "1" - }, - { - "_lookup": ["column_name", "custom_group_id"], - "_translate": ["label"], - "weight": "1", - "name": "membership_dialoger", - "column_name": "membership_dialoger", - "label": "Dialoger", - "data_type": "ContactReference", - "html_type": "Autocomplete-Select", - "is_required": "0", - "is_searchable": "1", - "is_search_range": "1", - "is_active": "1", - "is_view": "0", - "in_selector": "1" - }, - { - "_lookup": ["column_name", "custom_group_id"], - "_translate": ["label"], - "weight": "1", - "name": "membership_reference", - "column_name": "membership_reference", - "label": "Reference Number", - "data_type": "String", - "html_type": "Text", - "text_length": "24", - "is_required": "0", - "is_searchable": "1", - "is_active": "1", - "is_view": "0", - "in_selector": "1" - }, - { - "_lookup": ["column_name", "custom_group_id"], - "_translate": ["label"], - "weight": "1", - "name": "membership_contract", - "column_name": "membership_contract", - "label": "Contract Number", - "data_type": "String", - "html_type": "Text", - "text_length": "24", - "is_required": "0", - "is_searchable": "1", - "is_active": "1", - "is_view": "0", - "in_selector": "1" - } - ] -} diff --git a/resources/custom_group_membership_payment.json b/resources/custom_group_membership_payment.json deleted file mode 100644 index 5b1fc2da..00000000 --- a/resources/custom_group_membership_payment.json +++ /dev/null @@ -1,139 +0,0 @@ -{ - "_lookup": ["name"], - "_translate": ["title"], - "name": "membership_payment", - "title": "Payment Information", - "extends": "Membership", - "style": "Inline", - "collapse_display": "0", - "is_active": "1", - "is_multiple": "0", - "table_name": "civicrm_value_membership_payment", - "collapse_adv_display": "1", - "is_reserved": "0", - "_fields": [ - { - "_lookup": ["column_name", "custom_group_id"], - "_translate": ["label"], - "weight": "1", - "name": "membership_annual", - "column_name": "membership_annual", - "label": "Annual Membership Contribution", - "data_type": "Money", - "html_type": "Text", - "is_required": "0", - "is_searchable": "1", - "is_search_range": "1", - "is_active": "1", - "is_view": "0", - "in_selector": "1" - }, - { - "_lookup": ["column_name", "custom_group_id"], - "_translate": ["label"], - "weight": "2", - "name": "membership_frequency", - "column_name": "membership_frequency", - "label": "Payment Interval", - "data_type": "String", - "html_type": "Select", - "is_required": "0", - "option_group_id": "payment_frequency", - "is_searchable": "1", - "is_active": "1", - "is_view": "0", - "in_selector": "1" - }, - { - "_lookup": ["column_name", "custom_group_id"], - "_translate": ["label"], - "weight": "3", - "name": "membership_recurring_contribution", - "column_name": "membership_recurring_contribution", - "label": "Recurring contribution/mandate", - "data_type": "Int", - "html_type": "Text", - "is_required": "0", - "is_searchable": "1", - "is_active": "1", - "is_view": "0", - "in_selector": "1" - }, - { - "_lookup": ["column_name", "custom_group_id"], - "_translate": ["label"], - "weight": "4", - "name": "to_ba", - "column_name": "to_ba", - "label": "Organisation's Bank Account", - "data_type": "Int", - "html_type": "Text", - "is_required": "0", - "is_searchable": "1", - "is_active": "1", - "is_view": "0", - "in_selector": "1" - }, - { - "_lookup": ["column_name", "custom_group_id"], - "_translate": ["label"], - "weight": "5", - "name": "from_ba", - "column_name": "from_ba", - "label": "Donor's Bank Account", - "data_type": "Int", - "html_type": "Text", - "is_required": "0", - "is_searchable": "1", - "is_active": "1", - "is_view": "0", - "in_selector": "1" - }, - { - "_lookup": ["column_name", "custom_group_id"], - "_translate": ["label"], - "weight": "6", - "name": "cycle_day", - "column_name": "cycle_day", - "label": "Cycle day", - "data_type": "Int", - "html_type": "Text", - "is_required": "0", - "is_searchable": "1", - "is_active": "1", - "is_view": "0", - "in_selector": "1" - }, - { - "_lookup": ["column_name", "custom_group_id"], - "_translate": ["label"], - "weight": "7", - "name": "payment_instrument", - "column_name": "payment_instrument", - "label": "Payment method", - "data_type": "Int", - "html_type": "Text", - "is_required": "0", - "is_searchable": "1", - "is_active": "1", - "is_view": "0", - "in_selector": "1" - }, - { - "_lookup": ["column_name", "custom_group_id"], - "_translate": ["label"], - "weight": "8", - "name": "defer_payment_start", - "column_name": "defer_payment_start", - "label": "Defer Payment Start", - "data_type": "Boolean", - "html_type": "Radio", - "default_value": "1", - "is_required": "0", - "is_searchable": "1", - "is_active": "1", - "is_view": "0", - "in_selector": "1" - } - ] -} diff --git a/resources/entities_membership_status.json b/resources/entities_membership_status.json deleted file mode 100644 index 88baf170..00000000 --- a/resources/entities_membership_status.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "entity": "MembershipStatus", - "_entities": [ - { - "_lookup": ["name"], - "_translate": ["label"], - "name": "Paused", - "label": "Paused", - "is_current_member": "1", - "is_default": "0", - "is_active": "1", - "is_reserved": "0" - }, - { - "_lookup": ["name"], - "_translate": ["label"], - "name": "New", - "label": "New", - "is_current_member": "1", - "is_default": "0", - "is_active": "0", - "is_reserved": "0" - }, - { - "_lookup": ["name"], - "_translate": ["label"], - "name": "Grace", - "label": "Grace", - "is_current_member": "1", - "is_default": "0", - "is_active": "0", - "is_reserved": "0" - }, - { - "_lookup": ["name"], - "_translate": ["label"], - "name": "Current", - "label": "Current", - "is_current_member": "1", - "start_event": "join_date", - "is_default": "0", - "is_active": "1", - "is_reserved": "0" - }, - { - "_lookup": ["name"], - "_translate": ["label"], - "name": "Pending", - "label": "Pending", - "is_current_member": "1", - "is_default": "0", - "is_active": "1", - "is_reserved": "1" - }, - { - "_lookup": ["name"], - "_translate": ["label"], - "name": "Cancelled", - "label": "Cancelled", - "is_current_member": "0", - "is_default": "0", - "is_active": "1", - "is_reserved": "0" - }, - { - "_lookup": ["name"], - "_translate": ["label"], - "name": "Deceased", - "label": "Deceased", - "is_current_member": "0", - "is_default": "0", - "is_active": "1", - "is_reserved": "0" - } - ] -} diff --git a/resources/option_group_activity_status.json b/resources/option_group_activity_status.json deleted file mode 100644 index 8657ffc5..00000000 --- a/resources/option_group_activity_status.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "_lookup": ["name"], - "name": "activity_status", - "_values": [ - { - "_lookup": ["name"], - "_translate": ["label"], - "name": "Needs Review", - "label": "Needs Review", - "filter": "0", - "is_reserved": "1", - "is_active": "1" - }, - { - "_lookup": ["name"], - "_translate": ["label"], - "name": "Failed", - "label": "Failed", - "filter": "0", - "is_reserved": "1", - "is_active": "1" - } - ] -} diff --git a/resources/option_group_activity_types.json b/resources/option_group_activity_types.json deleted file mode 100644 index e7b89724..00000000 --- a/resources/option_group_activity_types.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "_lookup": ["name"], - "name": "activity_type", - "_values": [ - { - "_lookup": ["name"], - "_translate": ["label"], - "name": "Contract_Signed", - "label": "Sign Contract", - "filter": "0", - "is_reserved": "1", - "is_active": "1" - }, - { - "_lookup": ["name"], - "_translate": ["label"], - "name": "Contract_Paused", - "label": "Pause Contract", - "filter": "0", - "is_reserved": "1", - "is_active": "1" - }, - { - "_lookup": ["name"], - "_translate": ["label"], - "name": "Contract_Resumed", - "label": "Resume Contract", - "filter": "0", - "is_reserved": "1", - "is_active": "1" - }, - { - "_lookup": ["name"], - "_translate": ["label"], - "name": "Contract_Updated", - "label": "Update Contract", - "filter": "0", - "is_reserved": "1", - "is_active": "1" - }, - { - "_lookup": ["name"], - "_translate": ["label"], - "name": "Contract_Cancelled", - "label": "Cancel Contract", - "filter": "0", - "is_reserved": "1", - "is_active": "1" - }, - { - "_lookup": ["name"], - "_translate": ["label"], - "name": "Contract_Revived", - "label": "Revive Contract", - "filter": "0", - "is_reserved": "1", - "is_active": "1" - } - ] -} \ No newline at end of file diff --git a/resources/option_group_contact_channel.json b/resources/option_group_contact_channel.json deleted file mode 100644 index 2f89a03b..00000000 --- a/resources/option_group_contact_channel.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "_lookup": ["name"], - "name": "contact_channel", - "title": "Channel", - "_values": [ - { - "_lookup": ["name"], - "_translate": ["label"], - "name": "Unknown", - "label": "Unknown", - "filter": "0", - "is_active": "1" - } - ] -} diff --git a/resources/option_group_contract_cancel_reason.json b/resources/option_group_contract_cancel_reason.json deleted file mode 100644 index 78997ae9..00000000 --- a/resources/option_group_contract_cancel_reason.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "_lookup": ["name"], - "_translate": ["title", "description"], - "name": "contract_cancel_reason", - "title": "Contract Cancel Reason", - "description": "Dropdown options for Contract cancellation reasons", - "is_reserved": "0", - "is_active": "1", - "_values": [ - { - "_lookup": ["name"], - "_translate": ["label"], - "name": "Unknown", - "label": "Unknown", - "is_reserved": "0", - "is_active": "1" - } - ] -} diff --git a/resources/option_group_contribution_recur_status.json b/resources/option_group_contribution_recur_status.json deleted file mode 100644 index b69d6b9c..00000000 --- a/resources/option_group_contribution_recur_status.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "_lookup": ["name"], - "name": "contribution_recur_status", - "_values": [ - { - "_lookup": ["name"], - "_translate": ["label"], - "name": "Paused", - "label": "Paused", - "filter": 0, - "is_reserved": "1", - "is_active": "1" - } - ] -} diff --git a/resources/option_group_order_type.json b/resources/option_group_order_type.json deleted file mode 100644 index fc023f00..00000000 --- a/resources/option_group_order_type.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "_lookup": ["name"], - "name": "order_type", - "_translate": ["title", "description"], - "title": "Order Type", - "description": "Type of the membership welcome present", - "is_reserved": "0", - "is_active": "1", - "_values": [ - { - "_lookup": ["name"], - "_translate": ["label"], - "name": "Welcome Gift", - "label": "Welcome Gift", - "filter": "0", - "is_reserved": "0", - "is_active": "1" - } - ] -} diff --git a/resources/option_group_payment_frequency.json b/resources/option_group_payment_frequency.json deleted file mode 100644 index 055cbf6f..00000000 --- a/resources/option_group_payment_frequency.json +++ /dev/null @@ -1,81 +0,0 @@ -{ - "_lookup": ["name"], - "name": "payment_frequency", - "_translate": ["title", "description"], - "title": "Payment Intervals", - "description": "The value describes the payment interval in months", - "is_reserved": "0", - "is_active": "1", - "_values": [ - { - "_lookup": ["value"], - "_translate": ["label"], - "label": "one-off", - "name": "one-off", - "filter": "0", - "value": "0", - "is_reserved": "0", - "is_active": "1" - }, - { - "_lookup": ["value"], - "_translate": ["label"], - "label": "annually", - "name": "annually", - "filter": "0", - "value": "1", - "is_reserved": "0", - "is_active": "1" - }, - { - "_lookup": ["value"], - "_translate": ["label"], - "label": "semi-annually", - "name": "semi-annually", - "filter": "0", - "value": "2", - "is_reserved": "0", - "is_active": "1" - }, - { - "_lookup": ["value"], - "_translate": ["label"], - "label": "trimestral", - "name": "trimestral", - "filter": "0", - "value": "3", - "is_reserved": "0", - "is_active": "0" - }, - { - "_lookup": ["value"], - "_translate": ["label"], - "label": "quarterly", - "name": "quarterly", - "filter": "0", - "value": "4", - "is_reserved": "0", - "is_active": "1" - }, - { - "_lookup": ["value"], - "_translate": ["label"], - "label": "bi-monthly", - "name": "bi-monthly", - "filter": "0", - "value": "6", - "is_reserved": "0", - "is_active": "1" - }, - { - "_lookup": ["value"], - "_translate": ["label"], - "label": "monthly", - "name": "monthly", - "filter": "0", - "value": "12", - "is_reserved": "0", - "is_active": "1" - } - ] -} diff --git a/resources/option_group_shirt_size.json b/resources/option_group_shirt_size.json deleted file mode 100644 index 6aa42f9e..00000000 --- a/resources/option_group_shirt_size.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "_lookup": ["name"], - "name": "shirt_size", - "label": "T-Shirt Size Options", - "is_reserved": "0", - "is_active": "1", - "_values": [ - { - "_lookup": ["name"], - "_translate": ["label"], - "value": "S", - "name": "S", - "label": "S", - "filter": "0", - "is_reserved": "0", - "is_active": "1" - }, - { - "_lookup": ["name"], - "_translate": ["label"], - "value": "M", - "name": "M", - "label": "M", - "filter": "0", - "is_reserved": "0", - "is_active": "1" - }, - { - "_lookup": ["name"], - "_translate": ["label"], - "value": "L", - "name": "L", - "label": "L", - "filter": "0", - "is_reserved": "0", - "is_active": "1" - }, - { - "_lookup": ["name"], - "_translate": ["label"], - "value": "XL", - "name": "XL", - "label": "XL", - "filter": "0", - "is_reserved": "0", - "is_active": "1" - } - ] -} diff --git a/resources/option_group_shirt_type.json b/resources/option_group_shirt_type.json deleted file mode 100644 index d2157534..00000000 --- a/resources/option_group_shirt_type.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "_lookup": ["name"], - "name": "shirt_type", - "label": "T-Shirt Type Options", - "is_reserved": "0", - "is_active": "1", - "_values": [ - { - "_lookup": ["name"], - "_translate": ["label"], - "value": "W", - "name": "W", - "label": "Damen", - "filter": "0", - "is_reserved": "0", - "is_active": "1" - }, - { - "_lookup": ["name"], - "_translate": ["label"], - "value": "M", - "name": "M", - "label": "Herren", - "filter": "0", - "is_reserved": "0", - "is_active": "1" - } - ] -} From a46368dd0cbecc5137c3ea2d426d61aee0d869f9 Mon Sep 17 00:00:00 2001 From: Manuel Flandorfer Date: Thu, 11 Jul 2024 16:26:48 +0200 Subject: [PATCH 2/8] GP-43974 Delete unused upgrade code --- CRM/Contract/CustomData.php | 155 ------------------------------------ CRM/Contract/Upgrader.php | 28 +------ 2 files changed, 1 insertion(+), 182 deletions(-) diff --git a/CRM/Contract/CustomData.php b/CRM/Contract/CustomData.php index fbf9c00d..e37d04e6 100644 --- a/CRM/Contract/CustomData.php +++ b/CRM/Contract/CustomData.php @@ -47,161 +47,6 @@ protected function log($level, $message) { } } - /** - * will take a JSON source file and synchronise the - * generic entity data with those specs - */ - public function syncEntities($source_file) { - $data = json_decode(file_get_contents($source_file), TRUE); - if (empty($data)) { - throw new Exception("syncEntities: Invalid specs"); - } - - foreach ($data['_entities'] as $entity_data) { - $this->translateStrings($entity_data); - $entity = $this->identifyEntity($data['entity'], $entity_data); - - if (empty($entity)) { - // create OptionValue - $entity = $this->createEntity($data['entity'], $entity_data); - } elseif ($entity == 'FAILED') { - // Couldn't identify: - $this->log(CUSTOM_DATA_HELPER_LOG_ERROR, "Couldn't create/update {$data['entity']}: " . json_encode($entity_data)); - } else { - // update OptionValue - $this->updateEntity($data['entity'], $entity_data, $entity); - } - } - } - - /** - * will take a JSON source file and synchronise the - * OptionGroup/OptionValue data in the system with - * those specs - */ - public function syncOptionGroup($source_file) { - $data = json_decode(file_get_contents($source_file), TRUE); - if (empty($data)) { - throw new Exception("syncOptionGroup: Invalid specs"); - } - - // first: find or create option group - $this->translateStrings($data); - $optionGroup = $this->identifyEntity('OptionGroup', $data); - if (empty($optionGroup)) { - // create OptionGroup - $optionGroup = $this->createEntity('OptionGroup', $data); - } elseif ($optionGroup == 'FAILED') { - // Couldn't identify: - $this->log(CUSTOM_DATA_HELPER_LOG_ERROR, "Couldn't create/update OptionGroup: " . json_encode($data)); - return; - } else { - // update OptionGroup - $this->updateEntity('OptionGroup', $data, $optionGroup, array('is_active')); - } - - // now run the update for the OptionValues - foreach ($data['_values'] as $optionValueSpec) { - $this->translateStrings($optionValueSpec); - $optionValueSpec['option_group_id'] = $optionGroup['id']; - $optionValueSpec['_lookup'][] = 'option_group_id'; - $optionValue = $this->identifyEntity('OptionValue', $optionValueSpec); - - if (empty($optionValue)) { - // create OptionValue - $optionValue = $this->createEntity('OptionValue', $optionValueSpec); - } elseif ($optionValue == 'FAILED') { - // Couldn't identify: - $this->log(CUSTOM_DATA_HELPER_LOG_ERROR, "Couldn't create/update OptionValue: " . json_encode($optionValueSpec)); - } else { - // update OptionValue - $this->updateEntity('OptionValue', $optionValueSpec, $optionValue, array('is_active')); - } - } - } - - - /** - * will take a JSON source file and synchronise the - * CustomGroup/CustomField data in the system with - * those specs - */ - public function syncCustomGroup($source_file) { - $force_update = FALSE; - $data = json_decode(file_get_contents($source_file), TRUE); - if (empty($data)) { - throw new Exception("CRM_Utils_CustomData::syncCustomGroup: Invalid custom specs"); - } - - // if extends_entity_column_value, make sure it's sensible data - if (isset($data['extends_entity_column_value'])) { - $force_update = TRUE; // this doesn't get returned by the API, so differences couldn't be detected - if ($data['extends'] == 'Activity') { - $extends_list = array(); - foreach ($data['extends_entity_column_value'] as $activity_type) { - if (!is_numeric($activity_type)) { - $activity_type = CRM_Core_PseudoConstant::getKey( - 'CRM_Activity_BAO_Activity', - 'activity_type_id', - $activity_type - ); - } - if ($activity_type) { - $extends_list[] = $activity_type; - } - } - $data['extends_entity_column_value'] = $extends_list; - } - - if (is_array($data['extends_entity_column_value'])) { - $data['extends_entity_column_value'] = CRM_Utils_Array::implodePadded($data['extends_entity_column_value']); - } - } - - - // first: find or create custom group - $this->translateStrings($data); - $customGroup = $this->identifyEntity('CustomGroup', $data); - if (empty($customGroup)) { - // create CustomGroup - $customGroup = $this->createEntity('CustomGroup', $data); - } elseif ($customGroup == 'FAILED') { - // Couldn't identify: - $this->log(CUSTOM_DATA_HELPER_LOG_ERROR, "Couldn't create/update CustomGroup: " . json_encode($data)); - return; - } else { - // update CustomGroup - $this->updateEntity('CustomGroup', $data, $customGroup, array('extends', 'style', 'is_active', 'title', 'extends_entity_column_value'), $force_update); - } - - // now run the update for the CustomFields - foreach ($data['_fields'] as $customFieldSpec) { - $this->translateStrings($customFieldSpec); - $customFieldSpec['custom_group_id'] = $customGroup['id']; - $customFieldSpec['_lookup'][] = 'custom_group_id'; - if (!empty($customFieldSpec['option_group_id']) && !is_numeric($customFieldSpec['option_group_id'])) { - // look up custom group id - $optionGroup = $this->getEntityID('OptionGroup', array('name' => $customFieldSpec['option_group_id'])); - if ($optionGroup == 'FAILED' || $optionGroup==NULL) { - $this->log(CUSTOM_DATA_HELPER_LOG_ERROR, "Couldn't create/update CustomField, bad option_group: {$customFieldSpec['option_group_id']}"); - return; - } - $customFieldSpec['option_group_id'] = $optionGroup['id']; - } - $customField = $this->identifyEntity('CustomField', $customFieldSpec); - if (empty($customField)) { - // create CustomField - $customField = $this->createEntity('CustomField', $customFieldSpec); - } elseif ($customField == 'FAILED') { - // Couldn't identify: - $this->log(CUSTOM_DATA_HELPER_LOG_ERROR, "Couldn't create/update CustomField: " . json_encode($customFieldSpec)); - } else { - // update CustomField - $this->updateEntity('CustomField', $customFieldSpec, $customField, array('in_selector', 'is_view', 'is_searchable', 'html_type', 'data_type', 'custom_group_id')); - } - } - } - /** * return the ID of the given entity (if exists) */ diff --git a/CRM/Contract/Upgrader.php b/CRM/Contract/Upgrader.php index 90732197..62e20e46 100644 --- a/CRM/Contract/Upgrader.php +++ b/CRM/Contract/Upgrader.php @@ -22,9 +22,6 @@ public function install() { } public function enable() { - require_once 'CRM/Contract/CustomData.php'; - $customData = new CRM_Contract_CustomData('de.systopia.contract'); - // create sub-type 'Dialoger' $dialoger_exists = civicrm_api3('ContactType', 'getcount', ['name' => 'Dialoger']); if (!$dialoger_exists) { @@ -41,18 +38,6 @@ public function postInstall() { public function uninstall() { } - /** - * Add custom field "defer_payment_start" - * - * @return TRUE on success - * @throws Exception - */ - public function upgrade_1360() { - $this->ctx->log->info('Applying update 1360'); - $customData = new CRM_Contract_CustomData('de.systopia.contract'); - return TRUE; - } - public function upgrade_1370() { $this->ctx->log->info('Applying update 1370'); $this->executeSqlFile('sql/contract.sql'); @@ -66,19 +51,13 @@ public function upgrade_1390() { return TRUE; } - public function upgrade_1402() { - $this->ctx->log->info('Applying updates for 14xx'); - $customData = new CRM_Contract_CustomData('de.systopia.contract'); - return TRUE; - } - /** * Convert scheduled legacy update activities by adding ch_payment_changes * * @throws \CiviCRM_API3_Exception */ protected function convertLegacyUpdates() { - $paymentChangeField = \CRM_Contract_CustomData::getCustomFieldKey( + $paymentChangeField = CRM_Contract_CustomData::getCustomFieldKey( 'contract_updates', 'ch_payment_changes' ); @@ -118,9 +97,4 @@ public function upgrade_1500() { return TRUE; } - public function upgrade_1510() { - $this->ctx->log->info('Applying update 1510'); - $customData = new CRM_Contract_CustomData('de.systopia.contract'); - return TRUE; - } } From 923aa0022f3f2dc61ca8516719ab0952941c1349 Mon Sep 17 00:00:00 2001 From: Manuel Flandorfer Date: Mon, 15 Jul 2024 16:08:56 +0200 Subject: [PATCH 3/8] GP-43974 Upgrade extension with civix --- CRM/Contract/Upgrader.php | 2 +- CRM/Contract/Upgrader/Base.php | 375 -------------------------------- contract.civix.php | 273 +---------------------- contract.php | 55 +---- info.xml | 12 + mixin/smarty-v2@1.0.1.mixin.php | 51 +++++ 6 files changed, 75 insertions(+), 693 deletions(-) delete mode 100644 CRM/Contract/Upgrader/Base.php create mode 100644 mixin/smarty-v2@1.0.1.mixin.php diff --git a/CRM/Contract/Upgrader.php b/CRM/Contract/Upgrader.php index 62e20e46..5dcb790d 100644 --- a/CRM/Contract/Upgrader.php +++ b/CRM/Contract/Upgrader.php @@ -11,7 +11,7 @@ /** * Collection of upgrade steps. */ -class CRM_Contract_Upgrader extends CRM_Contract_Upgrader_Base { +class CRM_Contract_Upgrader extends CRM_Extension_Upgrader_Base { // By convention, functions that look like "function upgrade_NNNN()" are // upgrade tasks. They are executed in order (like Drupal's hook_update_N). diff --git a/CRM/Contract/Upgrader/Base.php b/CRM/Contract/Upgrader/Base.php deleted file mode 100644 index 4c5b177e..00000000 --- a/CRM/Contract/Upgrader/Base.php +++ /dev/null @@ -1,375 +0,0 @@ -ctx = array_shift($args); - $instance->queue = $instance->ctx->queue; - $method = array_shift($args); - return call_user_func_array(array($instance, $method), $args); - } - - public function __construct($extensionName, $extensionDir) { - $this->extensionName = $extensionName; - $this->extensionDir = $extensionDir; - } - - // ******** Task helpers ******** - - /** - * Run a CustomData file. - * - * @param string $relativePath the CustomData XML file path (relative to this extension's dir) - * @return bool - */ - public function executeCustomDataFile($relativePath) { - $xml_file = $this->extensionDir . '/' . $relativePath; - return $this->executeCustomDataFileByAbsPath($xml_file); - } - - /** - * Run a CustomData file - * - * @param string $xml_file the CustomData XML file path (absolute path) - * - * @return bool - */ - protected static function executeCustomDataFileByAbsPath($xml_file) { - $import = new CRM_Utils_Migrate_Import(); - $import->run($xml_file); - return TRUE; - } - - /** - * Run a SQL file. - * - * @param string $relativePath the SQL file path (relative to this extension's dir) - * - * @return bool - */ - public function executeSqlFile($relativePath) { - CRM_Utils_File::sourceSQLFile( - CIVICRM_DSN, - $this->extensionDir . DIRECTORY_SEPARATOR . $relativePath - ); - return TRUE; - } - - /** - * @param string $tplFile - * The SQL file path (relative to this extension's dir). - * Ex: "sql/mydata.mysql.tpl". - * @return bool - */ - public function executeSqlTemplate($tplFile) { - // Assign multilingual variable to Smarty. - $upgrade = new CRM_Upgrade_Form(); - - $tplFile = CRM_Utils_File::isAbsolute($tplFile) ? $tplFile : $this->extensionDir . DIRECTORY_SEPARATOR . $tplFile; - $smarty = CRM_Core_Smarty::singleton(); - $smarty->assign('domainID', CRM_Core_Config::domainID()); - CRM_Utils_File::sourceSQLFile( - CIVICRM_DSN, $smarty->fetch($tplFile), NULL, TRUE - ); - return TRUE; - } - - /** - * Run one SQL query. - * - * This is just a wrapper for CRM_Core_DAO::executeSql, but it - * provides syntatic sugar for queueing several tasks that - * run different queries - */ - public function executeSql($query, $params = array()) { - // FIXME verify that we raise an exception on error - CRM_Core_DAO::executeQuery($query, $params); - return TRUE; - } - - /** - * Syntatic sugar for enqueuing a task which calls a function in this class. - * - * The task is weighted so that it is processed - * as part of the currently-pending revision. - * - * After passing the $funcName, you can also pass parameters that will go to - * the function. Note that all params must be serializable. - */ - public function addTask($title) { - $args = func_get_args(); - $title = array_shift($args); - $task = new CRM_Queue_Task( - array(get_class($this), '_queueAdapter'), - $args, - $title - ); - return $this->queue->createItem($task, array('weight' => -1)); - } - - // ******** Revision-tracking helpers ******** - - /** - * Determine if there are any pending revisions. - * - * @return bool - */ - public function hasPendingRevisions() { - $revisions = $this->getRevisions(); - $currentRevision = $this->getCurrentRevision(); - - if (empty($revisions)) { - return FALSE; - } - if (empty($currentRevision)) { - return TRUE; - } - - return ($currentRevision < max($revisions)); - } - - /** - * Add any pending revisions to the queue. - */ - public function enqueuePendingRevisions(CRM_Queue_Queue $queue) { - $this->queue = $queue; - - $currentRevision = $this->getCurrentRevision(); - foreach ($this->getRevisions() as $revision) { - if ($revision > $currentRevision) { - $title = ts('Upgrade %1 to revision %2', array( - 1 => $this->extensionName, - 2 => $revision, - )); - - // note: don't use addTask() because it sets weight=-1 - - $task = new CRM_Queue_Task( - array(get_class($this), '_queueAdapter'), - array('upgrade_' . $revision), - $title - ); - $this->queue->createItem($task); - - $task = new CRM_Queue_Task( - array(get_class($this), '_queueAdapter'), - array('setCurrentRevision', $revision), - $title - ); - $this->queue->createItem($task); - } - } - } - - /** - * Get a list of revisions. - * - * @return array(revisionNumbers) sorted numerically - */ - public function getRevisions() { - if (!is_array($this->revisions)) { - $this->revisions = array(); - - $clazz = new ReflectionClass(get_class($this)); - $methods = $clazz->getMethods(); - foreach ($methods as $method) { - if (preg_match('/^upgrade_(.*)/', $method->name, $matches)) { - $this->revisions[] = $matches[1]; - } - } - sort($this->revisions, SORT_NUMERIC); - } - - return $this->revisions; - } - - public function getCurrentRevision() { - $revision = CRM_Core_BAO_Extension::getSchemaVersion($this->extensionName); - if (!$revision) { - $revision = $this->getCurrentRevisionDeprecated(); - } - return $revision; - } - - private function getCurrentRevisionDeprecated() { - $key = $this->extensionName . ':version'; - if ($revision = CRM_Core_BAO_Setting::getItem('Extension', $key)) { - $this->revisionStorageIsDeprecated = TRUE; - } - return $revision; - } - - public function setCurrentRevision($revision) { - CRM_Core_BAO_Extension::setSchemaVersion($this->extensionName, $revision); - // clean up legacy schema version store (CRM-19252) - $this->deleteDeprecatedRevision(); - return TRUE; - } - - private function deleteDeprecatedRevision() { - if ($this->revisionStorageIsDeprecated) { - $setting = new CRM_Core_BAO_Setting(); - $setting->name = $this->extensionName . ':version'; - $setting->delete(); - CRM_Core_Error::debug_log_message("Migrated extension schema revision ID for {$this->extensionName} from civicrm_setting (deprecated) to civicrm_extension.\n"); - } - } - - // ******** Hook delegates ******** - - /** - * @see https://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_install - */ - public function onInstall() { - $files = glob($this->extensionDir . '/sql/*_install.sql'); - if (is_array($files)) { - foreach ($files as $file) { - CRM_Utils_File::sourceSQLFile(CIVICRM_DSN, $file); - } - } - $files = glob($this->extensionDir . '/sql/*_install.mysql.tpl'); - if (is_array($files)) { - foreach ($files as $file) { - $this->executeSqlTemplate($file); - } - } - $files = glob($this->extensionDir . '/xml/*_install.xml'); - if (is_array($files)) { - foreach ($files as $file) { - $this->executeCustomDataFileByAbsPath($file); - } - } - if (is_callable(array($this, 'install'))) { - $this->install(); - } - } - - /** - * @see https://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_postInstall - */ - public function onPostInstall() { - $revisions = $this->getRevisions(); - if (!empty($revisions)) { - $this->setCurrentRevision(max($revisions)); - } - if (is_callable(array($this, 'postInstall'))) { - $this->postInstall(); - } - } - - /** - * @see https://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_uninstall - */ - public function onUninstall() { - $files = glob($this->extensionDir . '/sql/*_uninstall.mysql.tpl'); - if (is_array($files)) { - foreach ($files as $file) { - $this->executeSqlTemplate($file); - } - } - if (is_callable(array($this, 'uninstall'))) { - $this->uninstall(); - } - $files = glob($this->extensionDir . '/sql/*_uninstall.sql'); - if (is_array($files)) { - foreach ($files as $file) { - CRM_Utils_File::sourceSQLFile(CIVICRM_DSN, $file); - } - } - } - - /** - * @see https://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_enable - */ - public function onEnable() { - // stub for possible future use - if (is_callable(array($this, 'enable'))) { - $this->enable(); - } - } - - /** - * @see https://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_disable - */ - public function onDisable() { - // stub for possible future use - if (is_callable(array($this, 'disable'))) { - $this->disable(); - } - } - - public function onUpgrade($op, CRM_Queue_Queue $queue = NULL) { - switch ($op) { - case 'check': - return array($this->hasPendingRevisions()); - - case 'enqueue': - return $this->enqueuePendingRevisions($queue); - - default: - } - } - -} diff --git a/contract.civix.php b/contract.civix.php index a94c6170..0b91b359 100644 --- a/contract.civix.php +++ b/contract.civix.php @@ -24,7 +24,7 @@ class CRM_Contract_ExtensionUtil { * Translated text. * @see ts */ - public static function ts($text, $params = []) { + public static function ts($text, $params = []): string { if (!array_key_exists('domain', $params)) { $params['domain'] = [self::LONG_NAME, NULL]; } @@ -41,7 +41,7 @@ public static function ts($text, $params = []) { * Ex: 'http://example.org/sites/default/ext/org.example.foo'. * Ex: 'http://example.org/sites/default/ext/org.example.foo/css/foo.css'. */ - public static function url($file = NULL) { + public static function url($file = NULL): string { if ($file === NULL) { return rtrim(CRM_Core_Resources::singleton()->getUrl(self::LONG_NAME), '/'); } @@ -84,40 +84,17 @@ public static function findClass($suffix) { * * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_config */ -function _contract_civix_civicrm_config(&$config = NULL) { +function _contract_civix_civicrm_config($config = NULL) { static $configured = FALSE; if ($configured) { return; } $configured = TRUE; - $template =& CRM_Core_Smarty::singleton(); - - $extRoot = dirname(__FILE__) . DIRECTORY_SEPARATOR; - $extDir = $extRoot . 'templates'; - - if (is_array($template->template_dir)) { - array_unshift($template->template_dir, $extDir); - } - else { - $template->template_dir = [$extDir, $template->template_dir]; - } - + $extRoot = __DIR__ . DIRECTORY_SEPARATOR; $include_path = $extRoot . PATH_SEPARATOR . get_include_path(); set_include_path($include_path); -} - -/** - * (Delegated) Implements hook_civicrm_xmlMenu(). - * - * @param $files array(string) - * - * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_xmlMenu - */ -function _contract_civix_civicrm_xmlMenu(&$files) { - foreach (_contract_civix_glob(__DIR__ . '/xml/Menu/*.xml') as $file) { - $files[] = $file; - } + // Based on , this does not currently require mixin/polyfill.php. } /** @@ -127,35 +104,7 @@ function _contract_civix_civicrm_xmlMenu(&$files) { */ function _contract_civix_civicrm_install() { _contract_civix_civicrm_config(); - if ($upgrader = _contract_civix_upgrader()) { - $upgrader->onInstall(); - } -} - -/** - * Implements hook_civicrm_postInstall(). - * - * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_postInstall - */ -function _contract_civix_civicrm_postInstall() { - _contract_civix_civicrm_config(); - if ($upgrader = _contract_civix_upgrader()) { - if (is_callable([$upgrader, 'onPostInstall'])) { - $upgrader->onPostInstall(); - } - } -} - -/** - * Implements hook_civicrm_uninstall(). - * - * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_uninstall - */ -function _contract_civix_civicrm_uninstall() { - _contract_civix_civicrm_config(); - if ($upgrader = _contract_civix_upgrader()) { - $upgrader->onUninstall(); - } + // Based on , this does not currently require mixin/polyfill.php. } /** @@ -163,188 +112,9 @@ function _contract_civix_civicrm_uninstall() { * * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_enable */ -function _contract_civix_civicrm_enable() { - _contract_civix_civicrm_config(); - if ($upgrader = _contract_civix_upgrader()) { - if (is_callable([$upgrader, 'onEnable'])) { - $upgrader->onEnable(); - } - } -} - -/** - * (Delegated) Implements hook_civicrm_disable(). - * - * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_disable - * @return mixed - */ -function _contract_civix_civicrm_disable() { +function _contract_civix_civicrm_enable(): void { _contract_civix_civicrm_config(); - if ($upgrader = _contract_civix_upgrader()) { - if (is_callable([$upgrader, 'onDisable'])) { - $upgrader->onDisable(); - } - } -} - -/** - * (Delegated) Implements hook_civicrm_upgrade(). - * - * @param $op string, the type of operation being performed; 'check' or 'enqueue' - * @param $queue CRM_Queue_Queue, (for 'enqueue') the modifiable list of pending up upgrade tasks - * - * @return mixed - * based on op. for 'check', returns array(boolean) (TRUE if upgrades are pending) - * for 'enqueue', returns void - * - * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_upgrade - */ -function _contract_civix_civicrm_upgrade($op, CRM_Queue_Queue $queue = NULL) { - if ($upgrader = _contract_civix_upgrader()) { - return $upgrader->onUpgrade($op, $queue); - } -} - -/** - * @return CRM_Contract_Upgrader - */ -function _contract_civix_upgrader() { - if (!file_exists(__DIR__ . '/CRM/Contract/Upgrader.php')) { - return NULL; - } - else { - return CRM_Contract_Upgrader_Base::instance(); - } -} - -/** - * Search directory tree for files which match a glob pattern. - * - * Note: Dot-directories (like "..", ".git", or ".svn") will be ignored. - * Note: Delegate to CRM_Utils_File::findFiles(), this function kept only - * for backward compatibility of extension code that uses it. - * - * @param string $dir base dir - * @param string $pattern , glob pattern, eg "*.txt" - * - * @return array - */ -function _contract_civix_find_files($dir, $pattern) { - return CRM_Utils_File::findFiles($dir, $pattern); -} - -/** - * (Delegated) Implements hook_civicrm_managed(). - * - * Find any *.mgd.php files, merge their content, and return. - * - * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_managed - */ -function _contract_civix_civicrm_managed(&$entities) { - $mgdFiles = _contract_civix_find_files(__DIR__, '*.mgd.php'); - sort($mgdFiles); - foreach ($mgdFiles as $file) { - $es = include $file; - foreach ($es as $e) { - if (empty($e['module'])) { - $e['module'] = E::LONG_NAME; - } - if (empty($e['params']['version'])) { - $e['params']['version'] = '3'; - } - $entities[] = $e; - } - } -} - -/** - * (Delegated) Implements hook_civicrm_caseTypes(). - * - * Find any and return any files matching "xml/case/*.xml" - * - * Note: This hook only runs in CiviCRM 4.4+. - * - * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_caseTypes - */ -function _contract_civix_civicrm_caseTypes(&$caseTypes) { - if (!is_dir(__DIR__ . '/xml/case')) { - return; - } - - foreach (_contract_civix_glob(__DIR__ . '/xml/case/*.xml') as $file) { - $name = preg_replace('/\.xml$/', '', basename($file)); - if ($name != CRM_Case_XMLProcessor::mungeCaseType($name)) { - $errorMessage = sprintf("Case-type file name is malformed (%s vs %s)", $name, CRM_Case_XMLProcessor::mungeCaseType($name)); - throw new CRM_Core_Exception($errorMessage); - } - $caseTypes[$name] = [ - 'module' => E::LONG_NAME, - 'name' => $name, - 'file' => $file, - ]; - } -} - -/** - * (Delegated) Implements hook_civicrm_angularModules(). - * - * Find any and return any files matching "ang/*.ang.php" - * - * Note: This hook only runs in CiviCRM 4.5+. - * - * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_angularModules - */ -function _contract_civix_civicrm_angularModules(&$angularModules) { - if (!is_dir(__DIR__ . '/ang')) { - return; - } - - $files = _contract_civix_glob(__DIR__ . '/ang/*.ang.php'); - foreach ($files as $file) { - $name = preg_replace(':\.ang\.php$:', '', basename($file)); - $module = include $file; - if (empty($module['ext'])) { - $module['ext'] = E::LONG_NAME; - } - $angularModules[$name] = $module; - } -} - -/** - * (Delegated) Implements hook_civicrm_themes(). - * - * Find any and return any files matching "*.theme.php" - */ -function _contract_civix_civicrm_themes(&$themes) { - $files = _contract_civix_glob(__DIR__ . '/*.theme.php'); - foreach ($files as $file) { - $themeMeta = include $file; - if (empty($themeMeta['name'])) { - $themeMeta['name'] = preg_replace(':\.theme\.php$:', '', basename($file)); - } - if (empty($themeMeta['ext'])) { - $themeMeta['ext'] = E::LONG_NAME; - } - $themes[$themeMeta['name']] = $themeMeta; - } -} - -/** - * Glob wrapper which is guaranteed to return an array. - * - * The documentation for glob() says, "On some systems it is impossible to - * distinguish between empty match and an error." Anecdotally, the return - * result for an empty match is sometimes array() and sometimes FALSE. - * This wrapper provides consistency. - * - * @link http://php.net/glob - * @param string $pattern - * - * @return array - */ -function _contract_civix_glob($pattern) { - $result = glob($pattern); - return is_array($result) ? $result : []; + // Based on , this does not currently require mixin/polyfill.php. } /** @@ -363,8 +133,8 @@ function _contract_civix_insert_navigation_menu(&$menu, $path, $item) { if (empty($path)) { $menu[] = [ 'attributes' => array_merge([ - 'label' => CRM_Utils_Array::value('name', $item), - 'active' => 1, + 'label' => $item['name'] ?? NULL, + 'active' => 1, ], $item), ]; return TRUE; @@ -428,26 +198,3 @@ function _contract_civix_fixNavigationMenuItems(&$nodes, &$maxNavID, $parentID) } } } - -/** - * (Delegated) Implements hook_civicrm_alterSettingsFolders(). - * - * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_alterSettingsFolders - */ -function _contract_civix_civicrm_alterSettingsFolders(&$metaDataFolders = NULL) { - $settingsDir = __DIR__ . DIRECTORY_SEPARATOR . 'settings'; - if (!in_array($settingsDir, $metaDataFolders) && is_dir($settingsDir)) { - $metaDataFolders[] = $settingsDir; - } -} - -/** - * (Delegated) Implements hook_civicrm_entityTypes(). - * - * Find any *.entityType.php files, merge their content, and return. - * - * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_entityTypes - */ -function _contract_civix_civicrm_entityTypes(&$entityTypes) { - $entityTypes = array_merge($entityTypes, []); -} diff --git a/contract.php b/contract.php index 71b625f2..f4325337 100644 --- a/contract.php +++ b/contract.php @@ -27,15 +27,6 @@ function contract_civicrm_config(&$config) { ); } -/** - * Implements hook_civicrm_xmlMenu(). - * - * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_xmlMenu - */ -function contract_civicrm_xmlMenu(&$files) { - _contract_civix_civicrm_xmlMenu($files); -} - /** * Implements hook_civicrm_install(). * @@ -45,24 +36,6 @@ function contract_civicrm_install() { _contract_civix_civicrm_install(); } -/** - * Implements hook_civicrm_postInstall(). - * - * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_postInstall - */ -function contract_civicrm_postInstall() { - _contract_civix_civicrm_postInstall(); -} - -/** - * Implements hook_civicrm_uninstall(). - * - * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_uninstall - */ -function contract_civicrm_uninstall() { - _contract_civix_civicrm_uninstall(); -} - /** * Implements hook_civicrm_enable(). * @@ -72,24 +45,6 @@ function contract_civicrm_enable() { _contract_civix_civicrm_enable(); } -/** - * Implements hook_civicrm_disable(). - * - * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_disable - */ -function contract_civicrm_disable() { - _contract_civix_civicrm_disable(); -} - -/** - * Implements hook_civicrm_upgrade(). - * - * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_upgrade - */ -function contract_civicrm_upgrade($op, CRM_Queue_Queue $queue = NULL) { - return _contract_civix_civicrm_upgrade($op, $queue); -} - /** * Implements hook_civicrm_managed(). * @@ -102,14 +57,7 @@ function contract_civicrm_upgrade($op, CRM_Queue_Queue $queue = NULL) { // _contract_civix_civicrm_managed($entities); // } -/** - * Implements hook_civicrm_alterSettingsFolders(). - * - * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_alterSettingsFolders - */ -function contract_civicrm_alterSettingsFolders(&$metaDataFolders = NULL) { - _contract_civix_civicrm_alterSettingsFolders($metaDataFolders); -} + /** * UI Adjustements for membership forms @@ -296,7 +244,6 @@ function contract_civicrm_links( $op, $objectName, $objectId, &$links, &$mask, & } } - /** * CiviCRM PRE hook: Monitoring of relevant entity changes */ diff --git a/info.xml b/info.xml index b7f3c697..cbd6e1ac 100644 --- a/info.xml +++ b/info.xml @@ -27,5 +27,17 @@ Concept by B. Endres and M. Haefner, Greenpeace CEE. First implementation by Michael McAndrew, michaelmcandrew@thirdsectordesign.org CRM/Contract + 23.02.1 + + menu-xml@1.0.0 + mgd-php@1.0.0 + setting-php@1.0.0 + smarty-v2@1.0.1 + + + + + + CRM_Contract_Upgrader diff --git a/mixin/smarty-v2@1.0.1.mixin.php b/mixin/smarty-v2@1.0.1.mixin.php new file mode 100644 index 00000000..5972dbdc --- /dev/null +++ b/mixin/smarty-v2@1.0.1.mixin.php @@ -0,0 +1,51 @@ +getPath('templates'); + if (!file_exists($dir)) { + return; + } + + $register = function() use ($dir) { + // This implementation has a theoretical edge-case bug on older versions of CiviCRM where a template could + // be registered more than once. + CRM_Core_Smarty::singleton()->addTemplateDir($dir); + }; + + // Let's figure out what environment we're in -- so that we know the best way to call $register(). + + if (!empty($GLOBALS['_CIVIX_MIXIN_POLYFILL'])) { + // Polyfill Loader (v<=5.45): We're already in the middle of firing `hook_config`. + if ($mixInfo->isActive()) { + $register(); + } + return; + } + + if (CRM_Extension_System::singleton()->getManager()->extensionIsBeingInstalledOrEnabled($mixInfo->longName)) { + // New Install, Standard Loader: The extension has just been enabled, and we're now setting it up. + // System has already booted. New templates may be needed for upcoming installation steps. + $register(); + return; + } + + // Typical Pageview, Standard Loader: Defer the actual registration for a moment -- to ensure that Smarty is online. + \Civi::dispatcher()->addListener('hook_civicrm_config', function() use ($mixInfo, $register) { + if ($mixInfo->isActive()) { + $register(); + } + }); + +}; From 6aa9627b02fddee8c2f9cf5f976895ff2ea1ca46 Mon Sep 17 00:00:00 2001 From: Manuel Flandorfer Date: Wed, 17 Jul 2024 16:47:02 +0200 Subject: [PATCH 4/8] GP-43974 Fix membership display --- CRM/Contract/FormUtils.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CRM/Contract/FormUtils.php b/CRM/Contract/FormUtils.php index 82723d9c..84a530bc 100644 --- a/CRM/Contract/FormUtils.php +++ b/CRM/Contract/FormUtils.php @@ -47,7 +47,7 @@ public function replaceIdWithLabel($name, $entity) { if (isset($details[$result['custom_group_id']])) { $customGroupTableId = key($details[$result['custom_group_id']]); if (!empty($details[$result['custom_group_id']][$customGroupTableId]['fields'][$result['id']]['field_value'])) { - $entityId = $details[$result['custom_group_id']][$customGroupTableId]['fields'][$result['id']]['field_value']; + $entityId = $details[$result['custom_group_id']][$customGroupTableId]['fields'][$result['id']]['data']; if ($entity == 'ContributionRecur') { try { $entityResult = civicrm_api3($entity, 'getsingle', ['id' => $entityId]); @@ -87,7 +87,7 @@ public function setPaymentAmountCurrency() { ]); $details = $this->form->get_template_vars('viewCustomData'); $customGroupTableId = key($details[$result['custom_group_id']]); - $recContributionId = $details[$result['custom_group_id']][$customGroupTableId]['fields'][$result['id']]['field_value']; + $recContributionId = $details[$result['custom_group_id']][$customGroupTableId]['fields'][$result['id']]['data']; if (empty($recContributionId)) return; From 47e4091ff6a6c9cf80c3183bb615f870695925a3 Mon Sep 17 00:00:00 2001 From: Manuel Flandorfer Date: Mon, 22 Jul 2024 15:14:46 +0200 Subject: [PATCH 5/8] GP-43974 Remove explicit values in OptionGroups --- managed/OptionGroup_activity_status.mgd.php | 2 -- managed/OptionGroup_activity_type.mgd.php | 6 ------ managed/OptionGroup_contribution_recur_status.mgd.php | 1 - 3 files changed, 9 deletions(-) diff --git a/managed/OptionGroup_activity_status.mgd.php b/managed/OptionGroup_activity_status.mgd.php index 2f6abd10..6f5f599a 100644 --- a/managed/OptionGroup_activity_status.mgd.php +++ b/managed/OptionGroup_activity_status.mgd.php @@ -13,7 +13,6 @@ 'values' => [ 'option_group_id.name' => 'activity_status', 'label' => E::ts('Needs Review'), - 'value' => '9', 'name' => 'Needs Review', 'is_reserved' => TRUE, 'is_active' => TRUE, @@ -34,7 +33,6 @@ 'values' => [ 'option_group_id.name' => 'activity_status', 'label' => E::ts('Failed'), - 'value' => '10', 'name' => 'Failed', 'is_reserved' => TRUE, 'is_active' => TRUE, diff --git a/managed/OptionGroup_activity_type.mgd.php b/managed/OptionGroup_activity_type.mgd.php index 0f975af4..e8c7c675 100644 --- a/managed/OptionGroup_activity_type.mgd.php +++ b/managed/OptionGroup_activity_type.mgd.php @@ -13,7 +13,6 @@ 'values' => [ 'option_group_id.name' => 'activity_type', 'label' => E::ts('Sign Contract'), - 'value' => '113', 'name' => 'Contract_Signed', 'is_reserved' => TRUE, 'is_active' => TRUE, @@ -34,7 +33,6 @@ 'values' => [ 'option_group_id.name' => 'activity_type', 'label' => E::ts('Pause Contract'), - 'value' => '114', 'name' => 'Contract_Paused', 'is_reserved' => TRUE, 'is_active' => TRUE, @@ -55,7 +53,6 @@ 'values' => [ 'option_group_id.name' => 'activity_type', 'label' => E::ts('Resume Contract'), - 'value' => '115', 'name' => 'Contract_Resumed', 'is_reserved' => TRUE, 'is_active' => TRUE, @@ -76,7 +73,6 @@ 'values' => [ 'option_group_id.name' => 'activity_type', 'label' => E::ts('Update Contract'), - 'value' => '116', 'name' => 'Contract_Updated', 'is_reserved' => TRUE, 'is_active' => TRUE, @@ -97,7 +93,6 @@ 'values' => [ 'option_group_id.name' => 'activity_type', 'label' => E::ts('Cancel Contract'), - 'value' => '117', 'name' => 'Contract_Cancelled', 'is_reserved' => TRUE, 'is_active' => TRUE, @@ -118,7 +113,6 @@ 'values' => [ 'option_group_id.name' => 'activity_type', 'label' => E::ts('Revive Contract'), - 'value' => '118', 'name' => 'Contract_Revived', 'is_reserved' => TRUE, 'is_active' => TRUE, diff --git a/managed/OptionGroup_contribution_recur_status.mgd.php b/managed/OptionGroup_contribution_recur_status.mgd.php index bbb987b4..b0b46a5f 100644 --- a/managed/OptionGroup_contribution_recur_status.mgd.php +++ b/managed/OptionGroup_contribution_recur_status.mgd.php @@ -13,7 +13,6 @@ 'values' => [ 'option_group_id.name' => 'contribution_recur_status', 'label' => E::ts('Paused'), - 'value' => '9', 'name' => 'Paused', 'is_reserved' => TRUE, 'is_active' => TRUE, From 6a4632c9de7d0c9b138636e739400dc4f1cd9ed1 Mon Sep 17 00:00:00 2001 From: Patrick Figel Date: Mon, 22 Jul 2024 16:14:47 +0200 Subject: [PATCH 6/8] GP-20469 Add PR event and dependencies to CI --- .github/workflows/unit-tests.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index b2714e49..efe56535 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -1,6 +1,11 @@ name: "Run unit tests" -on: ["push"] +on: + push: + branches: + - master + tags: + pull_request: env: CIVI_CI_CIVICRM: ${{ vars.CIVI_CI_CIVICRM || '["master"]' }} @@ -50,9 +55,8 @@ jobs: steps: - id: clone-repo name: "Clone the repository" - uses: "actions/checkout@v3" + uses: "actions/checkout@v4" with: - ref: "${{ github.ref_name }}" path: "de.systopia.contract" - id: build-ci uses: greenpeace-cee/civi-ci@main @@ -71,6 +75,8 @@ jobs: cp -R "$GITHUB_WORKSPACE/de.systopia.contract" "$EXT_DIR/de.systopia.contract" git clone https://github.com/Project60/org.project60.banking.git "$EXT_DIR/org.project60.banking" git clone https://github.com/Project60/org.project60.sepa.git "$EXT_DIR/org.project60.sepa" + git clone https://lab.civicrm.org/extensions/mjwshared.git "$EXT_DIR/mjwshared" + git clone https://github.com/greenpeace-cee/adyen.git "$EXT_DIR/adyen" cv en de.systopia.contract - id: run-tests name: "Run Tests" From 735ae93454727c99f47f2abab419e04d817b7b2f Mon Sep 17 00:00:00 2001 From: Manuel Flandorfer Date: Tue, 20 Aug 2024 16:32:17 +0200 Subject: [PATCH 7/8] GP-43974 Add entity references for bank accounts --- managed/CustomGroup_contract_updates.mgd.php | 10 ++++++---- managed/CustomGroup_membership_payment.mgd.php | 10 ++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/managed/CustomGroup_contract_updates.mgd.php b/managed/CustomGroup_contract_updates.mgd.php index 77d83705..705ae256 100644 --- a/managed/CustomGroup_contract_updates.mgd.php +++ b/managed/CustomGroup_contract_updates.mgd.php @@ -184,13 +184,14 @@ 'custom_group_id.name' => 'contract_updates', 'name' => 'ch_to_ba', 'label' => E::ts('GP Bank Account'), - 'data_type' => 'Int', - 'html_type' => 'Text', + 'data_type' => 'EntityReference', + 'html_type' => 'Select', 'is_searchable' => TRUE, 'is_search_range' => TRUE, 'is_view' => TRUE, 'column_name' => 'ch_to_ba', 'in_selector' => TRUE, + 'fk_entity' => 'BankAccount', 'is_active' => TRUE, ], 'match' => [ @@ -210,13 +211,14 @@ 'custom_group_id.name' => 'contract_updates', 'name' => 'ch_from_ba', 'label' => E::ts("Member's Bank Account"), - 'data_type' => 'Int', - 'html_type' => 'Text', + 'data_type' => 'EntityReference', + 'html_type' => 'Select', 'is_searchable' => TRUE, 'is_search_range' => TRUE, 'is_view' => TRUE, 'column_name' => 'ch_from_ba', 'in_selector' => TRUE, + 'fk_entity' => 'BankAccount', 'is_active' => TRUE, ], 'match' => [ diff --git a/managed/CustomGroup_membership_payment.mgd.php b/managed/CustomGroup_membership_payment.mgd.php index e51e1369..6276aee9 100644 --- a/managed/CustomGroup_membership_payment.mgd.php +++ b/managed/CustomGroup_membership_payment.mgd.php @@ -110,11 +110,12 @@ 'custom_group_id.name' => 'membership_payment', 'name' => 'to_ba', 'label' => E::ts("Organisation's Bank Account"), - 'data_type' => 'Int', - 'html_type' => 'Text', + 'data_type' => 'EntityReference', + 'html_type' => 'Select', 'is_searchable' => TRUE, 'column_name' => 'to_ba', 'in_selector' => TRUE, + 'fk_entity' => 'BankAccount', 'is_active' => TRUE, ], 'match' => [ @@ -134,11 +135,12 @@ 'custom_group_id.name' => 'membership_payment', 'name' => 'from_ba', 'label' => E::ts("Donor's Bank Account"), - 'data_type' => 'Int', - 'html_type' => 'Text', + 'data_type' => 'EntityReference', + 'html_type' => 'Select', 'is_searchable' => TRUE, 'column_name' => 'from_ba', 'in_selector' => TRUE, + 'fk_entity' => 'BankAccount', 'is_active' => TRUE, ], 'match' => [ From a08abc08c7c77b6fbe57bc748f8cc240c8302916 Mon Sep 17 00:00:00 2001 From: Manuel Flandorfer Date: Thu, 10 Oct 2024 16:07:22 +0200 Subject: [PATCH 8/8] GP-43974 Fix deprecation warning for undefined API parameter '_today' --- api/v3/Contract/StartDate.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/v3/Contract/StartDate.php b/api/v3/Contract/StartDate.php index 7c81156c..5474d55b 100644 --- a/api/v3/Contract/StartDate.php +++ b/api/v3/Contract/StartDate.php @@ -6,7 +6,7 @@ function civicrm_api3_Contract_start_date($params) { try { _civicrm_api3_Contract_start_date_validate_params($params); - $today = CRM_Utils_Array::value('_today', $params); + $today = CRM_Utils_Array::value('_today', $params, 'now'); $payment_adapter = CRM_Contract_Utils::getPaymentAdapterClass($params['payment_adapter']); $start_date = $payment_adapter::startDate($params, $today);