From: Tim Otten Date: Thu, 18 May 2023 04:10:16 +0000 (-0700) Subject: (REF) civicrm_option_groups - Small simplifications X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=afe3192b97876d145830ae9c6e8c7b5b7eb1276e;p=civicrm-core.git (REF) civicrm_option_groups - Small simplifications --- diff --git a/sql/civicrm_option_groups/campaign_status.sqldata.php b/sql/civicrm_option_groups/campaign_status.sqldata.php index fe0e8e7d79..81b78f8fe7 100644 --- a/sql/civicrm_option_groups/campaign_status.sqldata.php +++ b/sql/civicrm_option_groups/campaign_status.sqldata.php @@ -3,9 +3,12 @@ return CRM_Core_CodeGen_OptionGroup::create('campaign_status', 'a/0052') ->addMetadata([ 'title' => ts('Campaign Status'), ]) - ->addValueTable(['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], + ->addValueTable(['label', 'name', 'value'], [ + [ts('Planned'), 'Planned', 1], + [ts('In Progress'), 'In Progress', 2], + [ts('Completed'), 'Completed', 3], + [ts('Cancelled'), 'Cancelled', 4], + ]) + ->addDefaults([ + 'weight' => 1, ]); diff --git a/sql/civicrm_option_groups/campaign_type.sqldata.php b/sql/civicrm_option_groups/campaign_type.sqldata.php index c78c111757..1a0e3ac267 100644 --- a/sql/civicrm_option_groups/campaign_type.sqldata.php +++ b/sql/civicrm_option_groups/campaign_type.sqldata.php @@ -3,8 +3,11 @@ return CRM_Core_CodeGen_OptionGroup::create('campaign_type', 'a/0051') ->addMetadata([ 'title' => ts('Campaign Type'), ]) - ->addValueTable(['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], + ->addValueTable(['label', 'name', 'value'], [ + [ts('Direct Mail'), 'Direct Mail', 1], + [ts('Referral Program'), 'Referral Program', 2], + [ts('Constituent Engagement'), 'Constituent Engagement', 3], + ]) + ->addDefaults([ + 'weight' => 1, ]); diff --git a/sql/civicrm_option_groups/contribution_status.sqldata.php b/sql/civicrm_option_groups/contribution_status.sqldata.php index 7a2547f0a5..7bcd99673f 100644 --- a/sql/civicrm_option_groups/contribution_status.sqldata.php +++ b/sql/civicrm_option_groups/contribution_status.sqldata.php @@ -5,13 +5,16 @@ return CRM_Core_CodeGen_OptionGroup::create('contribution_status', 'a/0011') 'is_locked' => 1, ]) ->addValueTable(['label', 'name', 'value', 'weight'], [ - [ts('Completed'), 'Completed', 1, 1, 'is_reserved' => 1], - [ts('Pending'), 'Pending', 2, 2, 'is_reserved' => 1], - [ts('Cancelled'), 'Cancelled', 3, 3, 'is_reserved' => 1], - [ts('Failed'), 'Failed', 4, 4, 'is_reserved' => 1], - [ts('Refunded'), 'Refunded', 7, 7, 'is_reserved' => 1], - [ts('Partially paid'), 'Partially paid', 8, 8, 'is_reserved' => 1], - [ts('Pending refund'), 'Pending refund', 9, 9, 'is_reserved' => 1], - [ts('Chargeback'), 'Chargeback', 10, 10, 'is_reserved' => 1], - [ts('Template'), 'Template', 11, 11, 'description' => ts('Status for contribution records which represent a template for a recurring contribution rather than an actual contribution. This status is transitional, to ensure that said contributions don\\\'t appear in reports. The is_template field is the preferred way to find and filter these contributions.'), 'is_reserved' => 1], + [ts('Completed'), 'Completed', 1, 1], + [ts('Pending'), 'Pending', 2, 2], + [ts('Cancelled'), 'Cancelled', 3, 3], + [ts('Failed'), 'Failed', 4, 4], + [ts('Refunded'), 'Refunded', 7, 7], + [ts('Partially paid'), 'Partially paid', 8, 8], + [ts('Pending refund'), 'Pending refund', 9, 9], + [ts('Chargeback'), 'Chargeback', 10, 10], + [ts('Template'), 'Template', 11, 11, 'description' => ts('Status for contribution records which represent a template for a recurring contribution rather than an actual contribution. This status is transitional, to ensure that said contributions don\\\'t appear in reports. The is_template field is the preferred way to find and filter these contributions.')], + ]) + ->addDefaults([ + 'is_reserved' => 1, ]); diff --git a/sql/civicrm_option_groups/group_type.sqldata.php b/sql/civicrm_option_groups/group_type.sqldata.php index 427d7aa5b2..c39a0ef34b 100644 --- a/sql/civicrm_option_groups/group_type.sqldata.php +++ b/sql/civicrm_option_groups/group_type.sqldata.php @@ -4,6 +4,9 @@ return CRM_Core_CodeGen_OptionGroup::create('group_type', 'a/0022') 'title' => ts('Group Type'), ]) ->addValueTable(['label', 'name', 'value'], [ - [ts('Access Control'), 'Access Control', 1, 'is_reserved' => 1], - [ts('Mailing List'), 'Mailing List', 2, 'is_reserved' => 1], + [ts('Access Control'), 'Access Control', 1], + [ts('Mailing List'), 'Mailing List', 2], + ]) + ->addDefaults([ + 'is_reserved' => 1, ]); diff --git a/sql/civicrm_option_groups/mapping_type.sqldata.php b/sql/civicrm_option_groups/mapping_type.sqldata.php index 68614993aa..d88327027a 100644 --- a/sql/civicrm_option_groups/mapping_type.sqldata.php +++ b/sql/civicrm_option_groups/mapping_type.sqldata.php @@ -5,17 +5,20 @@ return CRM_Core_CodeGen_OptionGroup::create('mapping_type', 'a/0030') 'is_locked' => 1, ]) ->addValueTable(['label', 'name', 'value', 'weight'], [ - [ts('Search Builder'), 'Search Builder', 1, 1, 'is_reserved' => 1], - [ts('Import Contact'), 'Import Contact', 2, 2, 'is_reserved' => 1], - [ts('Import Activity'), 'Import Activity', 3, 3, 'is_reserved' => 1], - [ts('Import Contribution'), 'Import Contribution', 4, 4, 'is_reserved' => 1], - [ts('Import Membership'), 'Import Membership', 5, 5, 'is_reserved' => 1], - [ts('Import Participant'), 'Import Participant', 6, 6, 'is_reserved' => 1], - [ts('Export Contact'), 'Export Contact', 7, 7, 'is_reserved' => 1], - [ts('Export Contribution'), 'Export Contribution', 8, 8, 'is_reserved' => 1], - [ts('Export Membership'), 'Export Membership', 9, 9, 'is_reserved' => 1], - [ts('Export Participant'), 'Export Participant', 10, 10, 'is_reserved' => 1], - [ts('Export Pledge'), 'Export Pledge', 11, 11, 'is_reserved' => 1], - [ts('Export Case'), 'Export Case', 12, 12, 'is_reserved' => 1], - [ts('Export Activity'), 'Export Activity', 14, 14, 'is_reserved' => 1], + [ts('Search Builder'), 'Search Builder', 1, 1], + [ts('Import Contact'), 'Import Contact', 2, 2], + [ts('Import Activity'), 'Import Activity', 3, 3], + [ts('Import Contribution'), 'Import Contribution', 4, 4], + [ts('Import Membership'), 'Import Membership', 5, 5], + [ts('Import Participant'), 'Import Participant', 6, 6], + [ts('Export Contact'), 'Export Contact', 7, 7], + [ts('Export Contribution'), 'Export Contribution', 8, 8], + [ts('Export Membership'), 'Export Membership', 9, 9], + [ts('Export Participant'), 'Export Participant', 10, 10], + [ts('Export Pledge'), 'Export Pledge', 11, 11], + [ts('Export Case'), 'Export Case', 12, 12], + [ts('Export Activity'), 'Export Activity', 14, 14], + ]) + ->addDefaults([ + 'is_reserved' => 1, ]); diff --git a/sql/civicrm_option_groups/participant_role.sqldata.php b/sql/civicrm_option_groups/participant_role.sqldata.php index a057a6d7fc..4b1d9b29c0 100644 --- a/sql/civicrm_option_groups/participant_role.sqldata.php +++ b/sql/civicrm_option_groups/participant_role.sqldata.php @@ -6,8 +6,11 @@ return CRM_Core_CodeGen_OptionGroup::create('participant_role', 'a/0014') 'data_type' => 'Integer', ]) ->addValueTable(['label', 'name', 'value'], [ - [ts('Attendee'), 'Attendee', 1, 'filter' => 1], - [ts('Volunteer'), 'Volunteer', 2, 'filter' => 1], - [ts('Host'), 'Host', 3, 'filter' => 1], - [ts('Speaker'), 'Speaker', 4, 'filter' => 1], + [ts('Attendee'), 'Attendee', 1], + [ts('Volunteer'), 'Volunteer', 2], + [ts('Host'), 'Host', 3], + [ts('Speaker'), 'Speaker', 4], + ]) + ->addDefaults([ + 'filter' => 1, ]); diff --git a/sql/civicrm_option_groups/pcp_status.sqldata.php b/sql/civicrm_option_groups/pcp_status.sqldata.php index d4987729c9..b4759b4dde 100644 --- a/sql/civicrm_option_groups/pcp_status.sqldata.php +++ b/sql/civicrm_option_groups/pcp_status.sqldata.php @@ -5,7 +5,10 @@ return CRM_Core_CodeGen_OptionGroup::create('pcp_status', 'a/0012') 'is_locked' => 1, ]) ->addValueTable(['label', 'name', 'value'], [ - [ts('Waiting Review'), 'Waiting Review', 1, 'is_reserved' => 1], - [ts('Approved'), 'Approved', 2, 'is_reserved' => 1], - [ts('Not Approved'), 'Not Approved', 3, 'is_reserved' => 1], + [ts('Waiting Review'), 'Waiting Review', 1], + [ts('Approved'), 'Approved', 2], + [ts('Not Approved'), 'Not Approved', 3], + ]) + ->addDefaults([ + 'is_reserved' => 1, ]); diff --git a/sql/civicrm_option_groups/pledge_status.sqldata.php b/sql/civicrm_option_groups/pledge_status.sqldata.php index 8944d56cac..407252c208 100644 --- a/sql/civicrm_option_groups/pledge_status.sqldata.php +++ b/sql/civicrm_option_groups/pledge_status.sqldata.php @@ -5,9 +5,12 @@ return CRM_Core_CodeGen_OptionGroup::create('pledge_status', 'a/0079') 'is_locked' => 1, ]) ->addValueTable(['label', 'name', 'value'], [ - [ts('Completed'), 'Completed', 1, 'is_reserved' => 1], - [ts('Pending'), 'Pending', 2, 'is_reserved' => 1], - [ts('Cancelled'), 'Cancelled', 3, 'is_reserved' => 1], - [ts('In Progress'), 'In Progress', 5, 'is_reserved' => 1], - [ts('Overdue'), 'Overdue', 6, 'is_reserved' => 1], + [ts('Completed'), 'Completed', 1], + [ts('Pending'), 'Pending', 2], + [ts('Cancelled'), 'Cancelled', 3], + [ts('In Progress'), 'In Progress', 5], + [ts('Overdue'), 'Overdue', 6], + ]) + ->addDefaults([ + 'is_reserved' => 1, ]); diff --git a/sql/civicrm_option_groups/recur_frequency_units.sqldata.php b/sql/civicrm_option_groups/recur_frequency_units.sqldata.php index 2df573dbb8..0d341eddfa 100644 --- a/sql/civicrm_option_groups/recur_frequency_units.sqldata.php +++ b/sql/civicrm_option_groups/recur_frequency_units.sqldata.php @@ -4,8 +4,11 @@ return CRM_Core_CodeGen_OptionGroup::create('recur_frequency_units', 'a/0032') 'title' => ts('Recurring Frequency Units'), ]) ->addValueTable(['label', 'name', 'value'], [ - [ts('day'), 'day', 'day', 'is_reserved' => 1], - [ts('week'), 'week', 'week', 'is_reserved' => 1], - [ts('month'), 'month', 'month', 'is_reserved' => 1], - [ts('year'), 'year', 'year', 'is_reserved' => 1], + [ts('day'), 'day', 'day'], + [ts('week'), 'week', 'week'], + [ts('month'), 'month', 'month'], + [ts('year'), 'year', 'year'], + ]) + ->addDefaults([ + 'is_reserved' => 1, ]); diff --git a/sql/civicrm_option_groups/wysiwyg_editor.sqldata.php b/sql/civicrm_option_groups/wysiwyg_editor.sqldata.php index c319cebd5c..68342aade5 100644 --- a/sql/civicrm_option_groups/wysiwyg_editor.sqldata.php +++ b/sql/civicrm_option_groups/wysiwyg_editor.sqldata.php @@ -4,6 +4,9 @@ return CRM_Core_CodeGen_OptionGroup::create('wysiwyg_editor', 'a/0031') 'title' => ts('WYSIWYG Editor'), ]) ->addValueTable(['label', 'name', 'value'], [ - [ts('Textarea'), 'Textarea', 1, 'is_reserved' => 1], - [ts('CKEditor 4'), 'CKEditor', 2, 'is_reserved' => 1], + [ts('Textarea'), 'Textarea', 1], + [ts('CKEditor 4'), 'CKEditor', 2], + ]) + ->addDefaults([ + 'is_reserved' => 1, ]);