From 6815c4c9c15d8f7d4cd620052a0283236331eceb Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Wed, 17 May 2023 02:33:58 -0700 Subject: [PATCH] Extract campaign_status, campaign_type, currencies_enabled, event_badge, note_privacy, civicrm_data.tpl --- sql/civicrm_option_groups.php | 20 ----------- .../campaign_status.sqldata.php | 11 +++++++ .../campaign_type.sqldata.php | 10 ++++++ .../currencies_enabled.sqldata.php | 12 +++++++ .../event_badge.sqldata.php | 11 +++++++ .../note_privacy.sqldata.php | 9 +++++ xml/templates/civicrm_data.tpl | 33 ------------------- 7 files changed, 53 insertions(+), 53 deletions(-) create mode 100644 sql/civicrm_option_groups/campaign_status.sqldata.php create mode 100644 sql/civicrm_option_groups/campaign_type.sqldata.php create mode 100644 sql/civicrm_option_groups/currencies_enabled.sqldata.php create mode 100644 sql/civicrm_option_groups/event_badge.sqldata.php create mode 100644 sql/civicrm_option_groups/note_privacy.sqldata.php diff --git a/sql/civicrm_option_groups.php b/sql/civicrm_option_groups.php index f97f6e5533..7029ab876b 100644 --- a/sql/civicrm_option_groups.php +++ b/sql/civicrm_option_groups.php @@ -19,26 +19,6 @@ $readOptionGroups = function (): array { }; return $readOptionGroups() + [ - 'currencies_enabled' => CRM_Core_CodeGen_OptionGroup::create('currencies_enabled') - ->addMetadata([ - 'title' => ts('Currencies Enabled'), - ]), - 'event_badge' => CRM_Core_CodeGen_OptionGroup::create('event_badge') - ->addMetadata([ - 'title' => ts('Event Name Badge'), - ]), - 'note_privacy' => CRM_Core_CodeGen_OptionGroup::create('note_privacy') - ->addMetadata([ - 'title' => ts('Privacy levels for notes'), - ]), - 'campaign_type' => CRM_Core_CodeGen_OptionGroup::create('campaign_type') - ->addMetadata([ - 'title' => ts('Campaign Type'), - ]), - 'campaign_status' => CRM_Core_CodeGen_OptionGroup::create('campaign_status') - ->addMetadata([ - 'title' => ts('Campaign Status'), - ]), 'system_extensions' => CRM_Core_CodeGen_OptionGroup::create('system_extensions') ->addMetadata([ 'title' => ts('CiviCRM Extensions'), diff --git a/sql/civicrm_option_groups/campaign_status.sqldata.php b/sql/civicrm_option_groups/campaign_status.sqldata.php new file mode 100644 index 0000000000..69a7789469 --- /dev/null +++ b/sql/civicrm_option_groups/campaign_status.sqldata.php @@ -0,0 +1,11 @@ +addMetadata([ + 'title' => ts('Campaign Status'), + ]) + ->addValues(['label', 'name', 'value', 'weight'], [ + [ts('Planned'), 'Planned', 1, 1], + [ts('In Progress'), 'In Progress', 2, 1], + [ts('Completed'), 'Completed', 3, 1], + [ts('Cancelled'), 'Cancelled', 4, 1], + ]); diff --git a/sql/civicrm_option_groups/campaign_type.sqldata.php b/sql/civicrm_option_groups/campaign_type.sqldata.php new file mode 100644 index 0000000000..1272e6fbe9 --- /dev/null +++ b/sql/civicrm_option_groups/campaign_type.sqldata.php @@ -0,0 +1,10 @@ +addMetadata([ + 'title' => ts('Campaign Type'), + ]) + ->addValues(['label', 'name', 'value', 'weight'], [ + [ts('Direct Mail'), 'Direct Mail', 1, 1], + [ts('Referral Program'), 'Referral Program', 2, 1], + [ts('Constituent Engagement'), 'Constituent Engagement', 3, 1], + ]); diff --git a/sql/civicrm_option_groups/currencies_enabled.sqldata.php b/sql/civicrm_option_groups/currencies_enabled.sqldata.php new file mode 100644 index 0000000000..d8f4caa646 --- /dev/null +++ b/sql/civicrm_option_groups/currencies_enabled.sqldata.php @@ -0,0 +1,12 @@ +addMetadata([ + 'title' => ts('Currencies Enabled'), + ]) + ->addValues(['label', 'name', 'value'], [ + ['USD ($)', 'USD', 'USD', 'is_default' => 1], + ['CAD ($)', 'CAD', 'CAD'], + ['EUR (€)', 'EUR', 'EUR'], + ['GBP (£)', 'GBP', 'GBP'], + ['JPY (¥)', 'JPY', 'JPY'], + ]); diff --git a/sql/civicrm_option_groups/event_badge.sqldata.php b/sql/civicrm_option_groups/event_badge.sqldata.php new file mode 100644 index 0000000000..d9bd482b37 --- /dev/null +++ b/sql/civicrm_option_groups/event_badge.sqldata.php @@ -0,0 +1,11 @@ +addMetadata([ + 'title' => ts('Event Name Badge'), + ]) + ->addValues(['label', 'name', 'value', 'description'], [ + [ts('Name Only'), 'CRM_Event_Badge_Simple', 1, ts('Simple Event Name Badge'), 'is_reserved' => 1], + [ts('Name Tent'), 'CRM_Event_Badge_NameTent', 2, ts('Name Tent'), 'is_reserved' => 1], + [ts('With Logo'), 'CRM_Event_Badge_Logo', 3, ts('You can set your own background image'), 'is_reserved' => 1], + [ts('5395 with Logo'), 'CRM_Event_Badge_Logo5395', 4, ts('Avery 5395 compatible labels with logo (4 up by 2, 59.2mm x 85.7mm)'), 'is_reserved' => 1], + ]); diff --git a/sql/civicrm_option_groups/note_privacy.sqldata.php b/sql/civicrm_option_groups/note_privacy.sqldata.php new file mode 100644 index 0000000000..82c1ae75d5 --- /dev/null +++ b/sql/civicrm_option_groups/note_privacy.sqldata.php @@ -0,0 +1,9 @@ +addMetadata([ + 'title' => ts('Privacy levels for notes'), + ]) + ->addValues(['label', 'name', 'value'], [ + [ts('None'), 'None', 0, 'is_default' => 1, 'is_reserved' => 1], + [ts('Author Only'), 'Author Only', 1, 'is_reserved' => 1], + ]); diff --git a/xml/templates/civicrm_data.tpl b/xml/templates/civicrm_data.tpl index aae9eab8ce..56ee366c29 100644 --- a/xml/templates/civicrm_data.tpl +++ b/xml/templates/civicrm_data.tpl @@ -134,11 +134,6 @@ VALUES SELECT @option_group_id_pi := max(id) from civicrm_option_group where name = 'payment_instrument'; -SELECT @option_group_id_currency := max(id) from civicrm_option_group where name = 'currencies_enabled'; -SELECT @option_group_id_eventBadge := max(id) from civicrm_option_group where name = 'event_badge'; -SELECT @option_group_id_notePrivacy := max(id) from civicrm_option_group where name = 'note_privacy'; -SELECT @option_group_id_campaignType := max(id) from civicrm_option_group where name = 'campaign_type'; -SELECT @option_group_id_campaignStatus := max(id) from civicrm_option_group where name = 'campaign_status'; SELECT @option_group_id_extensions := max(id) from civicrm_option_group where name = 'system_extensions'; SELECT @option_group_id_mail_approval_status := max(id) from civicrm_option_group where name = 'mail_approval_status'; SELECT @option_group_id_engagement_index := max(id) from civicrm_option_group where name = 'engagement_index'; @@ -183,34 +178,6 @@ INSERT INTO `civicrm_option_value` (`option_group_id`, `label`, `value`, `name`, `grouping`, `filter`, `is_default`, `weight`, `description`, `is_optgroup`, `is_reserved`, `is_active`, `component_id`, `visibility_id`, `icon`) VALUES --- Available currencies. - (@option_group_id_currency, 'USD ($)', 'USD', 'USD', NULL, 0, 1, 1, NULL, 0, 0, 1, NULL, NULL, NULL), - (@option_group_id_currency, 'CAD ($)', 'CAD', 'CAD', NULL, 0, 0, 2, NULL, 0, 0, 1, NULL, NULL, NULL), - (@option_group_id_currency, 'EUR (€)', 'EUR', 'EUR', NULL, 0, 0, 3, NULL, 0, 0, 1, NULL, NULL, NULL), - (@option_group_id_currency, 'GBP (£)', 'GBP', 'GBP', NULL, 0, 0, 4, NULL, 0, 0, 1, NULL, NULL, NULL), - (@option_group_id_currency, 'JPY (¥)', 'JPY', 'JPY', NULL, 0, 0, 5, NULL, 0, 0, 1, NULL, NULL, NULL), - --- event name badges - (@option_group_id_eventBadge, '{ts escape="sql"}Name Only{/ts}' , 1, 'CRM_Event_Badge_Simple' , NULL, 0, 0, 1, '{ts escape="sql"}Simple Event Name Badge{/ts}', 0, 1, 1, NULL, NULL, NULL), - (@option_group_id_eventBadge, '{ts escape="sql"}Name Tent{/ts}' , 2, 'CRM_Event_Badge_NameTent', NULL, 0, 0, 2, '{ts escape="sql"}Name Tent{/ts}', 0, 1, 1, NULL, NULL, NULL), - (@option_group_id_eventBadge , '{ts escape="sql"}With Logo{/ts}' , 3, 'CRM_Event_Badge_Logo' , NULL, 0, 0, 3, '{ts escape="sql"}You can set your own background image{/ts}', 0, 1, 1, NULL, NULL , NULL), - (@option_group_id_eventBadge , '{ts escape="sql"}5395 with Logo{/ts}', 4, 'CRM_Event_Badge_Logo5395', NULL, 0, 0, 4, '{ts escape="sql"}Avery 5395 compatible labels with logo (4 up by 2, 59.2mm x 85.7mm){/ts}', 0, 1, 1, NULL, NULL , NULL), - --- note privacy levels - (@option_group_id_notePrivacy, '{ts escape="sql"}None{/ts}', 0, 'None', NULL, 0, 1, 1, NULL, 0, 1, 1, NULL, NULL, NULL), - (@option_group_id_notePrivacy, '{ts escape="sql"}Author Only{/ts}', 1, 'Author Only', NULL, 0, 0, 2, NULL, 0, 1, 1, NULL, NULL, NULL), - --- Compaign Types - (@option_group_id_campaignType, '{ts escape="sql"}Direct Mail{/ts}', 1, 'Direct Mail', NULL, 0, 0, 1, NULL, 0, 0, 1, NULL, NULL, NULL), - (@option_group_id_campaignType, '{ts escape="sql"}Referral Program{/ts}', 2, 'Referral Program', NULL, 0, 0, 1, NULL, 0, 0, 1, NULL, NULL, NULL), - (@option_group_id_campaignType, '{ts escape="sql"}Constituent Engagement{/ts}', 3, 'Constituent Engagement', NULL, 0, 0, 1, NULL, 0, 0, 1, NULL, NULL, NULL), - --- Campaign Status - (@option_group_id_campaignStatus, '{ts escape="sql"}Planned{/ts}', 1, 'Planned', NULL, 0, 0, 1, NULL, 0, 0, 1, NULL, NULL, NULL), - (@option_group_id_campaignStatus, '{ts escape="sql"}In Progress{/ts}', 2, 'In Progress', NULL, 0, 0, 1, NULL, 0, 0, 1, NULL, NULL, NULL), - (@option_group_id_campaignStatus, '{ts escape="sql"}Completed{/ts}', 3, 'Completed', NULL, 0, 0, 1, NULL, 0, 0, 1, NULL, NULL, NULL), - (@option_group_id_campaignStatus, '{ts escape="sql"}Cancelled{/ts}', 4, 'Cancelled', NULL, 0, 0, 1, NULL, 0, 0, 1, NULL, NULL, NULL), - -- Engagement Level (@option_group_id_engagement_index, '{ts escape="sql"}1{/ts}', 1, '1', NULL, 0, 0, 1, NULL, 0, 0, 1, NULL, NULL , NULL), (@option_group_id_engagement_index, '{ts escape="sql"}2{/ts}', 2, '2', NULL, 0, 0, 2, NULL, 0, 0, 1, NULL, NULL , NULL), -- 2.25.1