From: Tim Otten Date: Thu, 18 May 2023 05:58:58 +0000 (-0700) Subject: (REF) Remove duplicates X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=02e3cebbe642d51cd123f8a669723dd027e016f5;p=civicrm-core.git (REF) Remove duplicates --- diff --git a/CRM/Core/CodeGen/OptionGroup.php b/CRM/Core/CodeGen/OptionGroup.php index f764d85806..582f63665a 100644 --- a/CRM/Core/CodeGen/OptionGroup.php +++ b/CRM/Core/CodeGen/OptionGroup.php @@ -42,6 +42,8 @@ class CRM_Core_CodeGen_OptionGroup { protected $rows = []; + protected $syncRules = []; + /** * @var string * @internal @@ -68,6 +70,23 @@ class CRM_Core_CodeGen_OptionGroup { return $this; } + /** + * Copy fields + * + * @param string $mode + * copy|fill + * @param array $fields + * Array(string $srcField => string $destField). + * Ex: ['name' => 'label'] + * @return $this + */ + public function syncColumns(string $mode, array $fields): CRM_Core_CodeGen_OptionGroup { + foreach ($fields as $from => $to) { + $this->syncRules[] = [$mode, $from, $to]; + } + return $this; + } + public function addDefaults(array $fields): CRM_Core_CodeGen_OptionGroup { $this->defaults = array_merge($this->defaults, $fields); return $this; @@ -126,6 +145,24 @@ class CRM_Core_CodeGen_OptionGroup { $position = 1; $result = []; foreach ($this->rows as $row) { + foreach ($this->syncRules as $syncRule) { + [$mode, $from, $to] = $syncRule; + switch ($mode) { + case 'copy': + $row[$to] = $row[$from]; + break; + + case 'fill': + if (array_key_exists($from, $row) && !array_key_exists($to, $row)) { + $row[$to] = $row[$from]; + } + break; + + default: + throw new \RuntimeException("Invalid sync mod: $mode"); + } + } + $result[] = array_merge( ['option_group_id' => new CRM_Utils_SQL_Literal($this->var), 'value' => $position, 'weight' => $position], $this->defaults, diff --git a/sql/civicrm_option_groups/accept_creditcard.sqldata.php b/sql/civicrm_option_groups/accept_creditcard.sqldata.php index d086e8281d..5a79615e28 100644 --- a/sql/civicrm_option_groups/accept_creditcard.sqldata.php +++ b/sql/civicrm_option_groups/accept_creditcard.sqldata.php @@ -4,9 +4,10 @@ return CRM_Core_CodeGen_OptionGroup::create('accept_creditcard', 'a/0009') 'title' => ts('Accepted Credit Cards'), 'description' => ts('The following credit card options will be offered to contributors using Online Contribution pages. You will need to verify which cards are accepted by your chosen Payment Processor and update these entries accordingly.') . ts('IMPORTANT: These options do not control credit card/payment method choices for sites and/or contributors using the PayPal Express service (e.g. where billing information is collected on the Payment Processor\\\'s website).'), ]) - ->addValueTable(['label', 'name', 'value'], [ - ['Visa', 'Visa', 1], - ['MasterCard', 'MasterCard', 2], - ['Amex', 'Amex', 3], - ['Discover', 'Discover', 4], - ]); + ->addValueTable(['name', 'value'], [ + ['Visa', 1], + ['MasterCard', 2], + ['Amex', 3], + ['Discover', 4], + ]) + ->syncColumns('fill', ['name' => 'label']); diff --git a/sql/civicrm_option_groups/activity_type.sqldata.php b/sql/civicrm_option_groups/activity_type.sqldata.php index f42f87185a..9f6b191973 100644 --- a/sql/civicrm_option_groups/activity_type.sqldata.php +++ b/sql/civicrm_option_groups/activity_type.sqldata.php @@ -12,7 +12,6 @@ return CRM_Core_CodeGen_OptionGroup::create('activity_type', 'a/0002') 'label' => ts('Meeting'), 'value' => 1, 'name' => 'Meeting', - 'weight' => 1, 'is_reserved' => 1, 'icon' => 'fa-slideshare', ], @@ -20,7 +19,6 @@ return CRM_Core_CodeGen_OptionGroup::create('activity_type', 'a/0002') 'label' => ts('Phone Call'), 'value' => 2, 'name' => 'Phone Call', - 'weight' => 2, 'is_reserved' => 1, 'icon' => 'fa-phone', ], @@ -29,7 +27,6 @@ return CRM_Core_CodeGen_OptionGroup::create('activity_type', 'a/0002') 'value' => 3, 'name' => 'Email', 'filter' => 1, - 'weight' => 3, 'description' => ts('Email sent.'), 'is_reserved' => 1, 'icon' => 'fa-envelope-o', @@ -39,7 +36,6 @@ return CRM_Core_CodeGen_OptionGroup::create('activity_type', 'a/0002') 'value' => 4, 'name' => 'SMS', 'filter' => 1, - 'weight' => 4, 'description' => ts('Text message (SMS) sent.'), 'is_reserved' => 1, 'icon' => 'fa-mobile', @@ -49,7 +45,6 @@ return CRM_Core_CodeGen_OptionGroup::create('activity_type', 'a/0002') 'value' => 5, 'name' => 'Event Registration', 'filter' => 1, - 'weight' => 5, 'description' => ts('Online or offline event registration.'), 'is_reserved' => 1, 'component_id' => 1, @@ -59,7 +54,6 @@ return CRM_Core_CodeGen_OptionGroup::create('activity_type', 'a/0002') 'value' => 6, 'name' => 'Contribution', 'filter' => 1, - 'weight' => 6, 'description' => ts('Online or offline contribution.'), 'is_reserved' => 1, 'component_id' => 2, @@ -69,7 +63,6 @@ return CRM_Core_CodeGen_OptionGroup::create('activity_type', 'a/0002') 'value' => 7, 'name' => 'Membership Signup', 'filter' => 1, - 'weight' => 7, 'description' => ts('Online or offline membership signup.'), 'is_reserved' => 1, 'component_id' => 3, @@ -79,7 +72,6 @@ return CRM_Core_CodeGen_OptionGroup::create('activity_type', 'a/0002') 'value' => 8, 'name' => 'Membership Renewal', 'filter' => 1, - 'weight' => 8, 'description' => ts('Online or offline membership renewal.'), 'is_reserved' => 1, 'component_id' => 3, @@ -89,7 +81,6 @@ return CRM_Core_CodeGen_OptionGroup::create('activity_type', 'a/0002') 'value' => 9, 'name' => 'Tell a Friend', 'filter' => 1, - 'weight' => 9, 'description' => ts('Send information about a contribution campaign or event to a friend.'), 'is_reserved' => 1, ], @@ -98,7 +89,6 @@ return CRM_Core_CodeGen_OptionGroup::create('activity_type', 'a/0002') 'value' => 10, 'name' => 'Pledge Acknowledgment', 'filter' => 1, - 'weight' => 10, 'description' => ts('Send Pledge Acknowledgment.'), 'is_reserved' => 1, 'component_id' => 6, @@ -108,7 +98,6 @@ return CRM_Core_CodeGen_OptionGroup::create('activity_type', 'a/0002') 'value' => 11, 'name' => 'Pledge Reminder', 'filter' => 1, - 'weight' => 11, 'description' => ts('Send Pledge Reminder.'), 'is_reserved' => 1, 'component_id' => 6, @@ -118,7 +107,6 @@ return CRM_Core_CodeGen_OptionGroup::create('activity_type', 'a/0002') 'value' => 12, 'name' => 'Inbound Email', 'filter' => 1, - 'weight' => 12, 'description' => ts('Inbound Email.'), 'is_reserved' => 1, ], @@ -126,7 +114,6 @@ return CRM_Core_CodeGen_OptionGroup::create('activity_type', 'a/0002') 'label' => ts('Open Case'), 'value' => 13, 'name' => 'Open Case', - 'weight' => 13, 'is_reserved' => 1, 'component_id' => 7, 'icon' => 'fa-folder-open-o', @@ -136,7 +123,6 @@ return CRM_Core_CodeGen_OptionGroup::create('activity_type', 'a/0002') 'label' => ts('Follow up'), 'value' => 14, 'name' => 'Follow up', - 'weight' => 14, 'is_reserved' => 1, 'component_id' => 7, 'icon' => 'fa-share-square-o', @@ -146,7 +132,6 @@ return CRM_Core_CodeGen_OptionGroup::create('activity_type', 'a/0002') 'label' => ts('Change Case Type'), 'value' => 15, 'name' => 'Change Case Type', - 'weight' => 15, 'is_reserved' => 1, 'component_id' => 7, 'icon' => 'fa-random', @@ -156,7 +141,6 @@ return CRM_Core_CodeGen_OptionGroup::create('activity_type', 'a/0002') 'label' => ts('Change Case Status'), 'value' => 16, 'name' => 'Change Case Status', - 'weight' => 16, 'is_reserved' => 1, 'component_id' => 7, 'icon' => 'fa-pencil-square-o', @@ -166,7 +150,6 @@ return CRM_Core_CodeGen_OptionGroup::create('activity_type', 'a/0002') 'label' => ts('Change Case Subject'), 'value' => 53, 'name' => 'Change Case Subject', - 'weight' => 53, 'is_reserved' => 1, 'component_id' => 7, 'icon' => 'fa-pencil-square-o', @@ -176,7 +159,6 @@ return CRM_Core_CodeGen_OptionGroup::create('activity_type', 'a/0002') 'label' => ts('Change Custom Data'), 'value' => 33, 'name' => 'Change Custom Data', - 'weight' => 33, 'is_reserved' => 1, 'component_id' => 7, 'icon' => 'fa-table', @@ -187,7 +169,6 @@ return CRM_Core_CodeGen_OptionGroup::create('activity_type', 'a/0002') 'value' => 17, 'name' => 'Membership Renewal Reminder', 'filter' => 1, - 'weight' => 17, 'description' => ts('offline membership renewal reminder.'), 'is_reserved' => 1, 'component_id' => 3, @@ -196,7 +177,6 @@ return CRM_Core_CodeGen_OptionGroup::create('activity_type', 'a/0002') 'label' => ts('Change Case Start Date'), 'value' => 18, 'name' => 'Change Case Start Date', - 'weight' => 18, 'is_reserved' => 1, 'component_id' => 7, 'icon' => 'fa-calendar', @@ -207,7 +187,6 @@ return CRM_Core_CodeGen_OptionGroup::create('activity_type', 'a/0002') 'value' => 19, 'name' => 'Bulk Email', 'filter' => 1, - 'weight' => 19, 'description' => ts('Bulk Email Sent.'), 'is_reserved' => 1, ], @@ -215,7 +194,6 @@ return CRM_Core_CodeGen_OptionGroup::create('activity_type', 'a/0002') 'label' => ts('Assign Case Role'), 'value' => 20, 'name' => 'Assign Case Role', - 'weight' => 20, 'is_reserved' => 1, 'component_id' => 7, 'icon' => 'fa-user-plus', @@ -225,7 +203,6 @@ return CRM_Core_CodeGen_OptionGroup::create('activity_type', 'a/0002') 'label' => ts('Remove Case Role'), 'value' => 21, 'name' => 'Remove Case Role', - 'weight' => 21, 'is_reserved' => 1, 'component_id' => 7, 'icon' => 'fa-user-times', @@ -235,7 +212,6 @@ return CRM_Core_CodeGen_OptionGroup::create('activity_type', 'a/0002') 'label' => ts('Print/Merge Document'), 'value' => 22, 'name' => 'Print PDF Letter', - 'weight' => 22, 'description' => ts('Export letters and other printable documents.'), 'is_reserved' => 1, 'icon' => 'fa-file-pdf-o', @@ -244,7 +220,6 @@ return CRM_Core_CodeGen_OptionGroup::create('activity_type', 'a/0002') 'label' => ts('Merge Case'), 'value' => 23, 'name' => 'Merge Case', - 'weight' => 23, 'is_reserved' => 1, 'component_id' => 7, 'icon' => 'fa-compress', @@ -254,7 +229,6 @@ return CRM_Core_CodeGen_OptionGroup::create('activity_type', 'a/0002') 'label' => ts('Reassigned Case'), 'value' => 24, 'name' => 'Reassigned Case', - 'weight' => 24, 'is_reserved' => 1, 'component_id' => 7, 'icon' => 'fa-user-circle-o', @@ -264,7 +238,6 @@ return CRM_Core_CodeGen_OptionGroup::create('activity_type', 'a/0002') 'label' => ts('Link Cases'), 'value' => 25, 'name' => 'Link Cases', - 'weight' => 25, 'is_reserved' => 1, 'component_id' => 7, 'icon' => 'fa-link', @@ -274,7 +247,6 @@ return CRM_Core_CodeGen_OptionGroup::create('activity_type', 'a/0002') 'label' => ts('Change Case Tags'), 'value' => 26, 'name' => 'Change Case Tags', - 'weight' => 26, 'is_reserved' => 1, 'component_id' => 7, 'icon' => 'fa-tags', @@ -365,7 +337,6 @@ return CRM_Core_CodeGen_OptionGroup::create('activity_type', 'a/0002') 'value' => 36, 'name' => 'Change Membership Type', 'filter' => 1, - 'weight' => 36, 'description' => ts('Change Membership Type.'), 'is_reserved' => 1, 'component_id' => 3, @@ -375,7 +346,6 @@ return CRM_Core_CodeGen_OptionGroup::create('activity_type', 'a/0002') 'value' => 37, 'name' => 'Cancel Recurring Contribution', 'filter' => 1, - 'weight' => 37, 'is_reserved' => 1, 'component_id' => 2, 'description' => '', @@ -385,7 +355,6 @@ return CRM_Core_CodeGen_OptionGroup::create('activity_type', 'a/0002') 'value' => 38, 'name' => 'Update Recurring Contribution Billing Details', 'filter' => 1, - 'weight' => 38, 'is_reserved' => 1, 'component_id' => 2, 'description' => '', @@ -395,7 +364,6 @@ return CRM_Core_CodeGen_OptionGroup::create('activity_type', 'a/0002') 'value' => 39, 'name' => 'Update Recurring Contribution', 'filter' => 1, - 'weight' => 39, 'is_reserved' => 1, 'component_id' => 2, 'description' => '', @@ -405,7 +373,6 @@ return CRM_Core_CodeGen_OptionGroup::create('activity_type', 'a/0002') 'value' => 40, 'name' => 'Reminder Sent', 'filter' => 1, - 'weight' => 40, 'is_reserved' => 1, 'description' => '', ], @@ -414,7 +381,6 @@ return CRM_Core_CodeGen_OptionGroup::create('activity_type', 'a/0002') 'value' => 41, 'name' => 'Export Accounting Batch', 'filter' => 1, - 'weight' => 41, // FIXME: Shouldn't this use ts() 'description' => 'Export Accounting Batch', 'is_reserved' => 1, @@ -425,7 +391,6 @@ return CRM_Core_CodeGen_OptionGroup::create('activity_type', 'a/0002') 'value' => 42, 'name' => 'Create Batch', 'filter' => 1, - 'weight' => 42, // FIXME: Shouldn't this use ts() 'description' => 'Create Batch', 'is_reserved' => 1, @@ -436,7 +401,6 @@ return CRM_Core_CodeGen_OptionGroup::create('activity_type', 'a/0002') 'value' => 43, 'name' => 'Edit Batch', 'filter' => 1, - 'weight' => 43, // FIXME: Shouldn't this use ts() 'description' => 'Edit Batch', 'is_reserved' => 1, @@ -447,7 +411,6 @@ return CRM_Core_CodeGen_OptionGroup::create('activity_type', 'a/0002') 'value' => 44, 'name' => 'SMS delivery', 'filter' => 1, - 'weight' => 44, 'description' => ts('SMS delivery'), 'is_reserved' => 1, ], @@ -456,7 +419,6 @@ return CRM_Core_CodeGen_OptionGroup::create('activity_type', 'a/0002') 'value' => 45, 'name' => 'Inbound SMS', 'filter' => 1, - 'weight' => 45, 'description' => ts('Inbound SMS'), 'is_reserved' => 1, ], @@ -465,7 +427,6 @@ return CRM_Core_CodeGen_OptionGroup::create('activity_type', 'a/0002') 'value' => 46, 'name' => 'Payment', 'filter' => 1, - 'weight' => 46, 'description' => ts('Additional payment recorded for event or membership fee.'), 'is_reserved' => 1, 'component_id' => 2, @@ -475,7 +436,6 @@ return CRM_Core_CodeGen_OptionGroup::create('activity_type', 'a/0002') 'value' => 47, 'name' => 'Refund', 'filter' => 1, - 'weight' => 47, 'description' => ts('Refund recorded for event or membership fee.'), 'is_reserved' => 1, 'component_id' => 2, @@ -485,7 +445,6 @@ return CRM_Core_CodeGen_OptionGroup::create('activity_type', 'a/0002') 'value' => 48, 'name' => 'Change Registration', 'filter' => 1, - 'weight' => 48, 'description' => ts('Changes to an existing event registration.'), 'is_reserved' => 1, 'component_id' => 1, @@ -495,7 +454,6 @@ return CRM_Core_CodeGen_OptionGroup::create('activity_type', 'a/0002') 'value' => 49, 'name' => 'Downloaded Invoice', 'filter' => 1, - 'weight' => 49, 'description' => ts('Downloaded Invoice.'), 'is_reserved' => 1, ], @@ -504,7 +462,6 @@ return CRM_Core_CodeGen_OptionGroup::create('activity_type', 'a/0002') 'value' => 50, 'name' => 'Emailed Invoice', 'filter' => 1, - 'weight' => 50, 'description' => ts('Emailed Invoice.'), 'is_reserved' => 1, ], @@ -513,7 +470,6 @@ return CRM_Core_CodeGen_OptionGroup::create('activity_type', 'a/0002') 'value' => 51, 'name' => 'Contact Merged', 'filter' => 1, - 'weight' => 51, 'description' => ts('Contact Merged'), 'is_reserved' => 1, ], @@ -522,7 +478,6 @@ return CRM_Core_CodeGen_OptionGroup::create('activity_type', 'a/0002') 'value' => 52, 'name' => 'Contact Deleted by Merge', 'filter' => 1, - 'weight' => 52, 'description' => ts('Contact was merged into another contact'), 'is_reserved' => 1, ], @@ -531,9 +486,9 @@ return CRM_Core_CodeGen_OptionGroup::create('activity_type', 'a/0002') 'value' => 54, 'name' => 'Failed Payment', 'filter' => 1, - 'weight' => 54, 'description' => ts('Failed Payment'), 'is_reserved' => 1, 'component_id' => 2, ], - ]); + ]) + ->syncColumns('fill', ['value' => 'weight']); diff --git a/sql/civicrm_option_groups/addressee.sqldata.php b/sql/civicrm_option_groups/addressee.sqldata.php index 30c25e3afd..fa95f1cd82 100644 --- a/sql/civicrm_option_groups/addressee.sqldata.php +++ b/sql/civicrm_option_groups/addressee.sqldata.php @@ -5,30 +5,27 @@ return CRM_Core_CodeGen_OptionGroup::create('addressee', 'a/0042') ]) ->addValues([ [ - 'label' => '{contact.prefix_id:label}{ }{contact.first_name}{ }{contact.middle_name}{ }{contact.last_name}{ }{contact.suffix_id:label}', 'value' => 1, 'name' => '{contact.prefix_id:label}{ }{contact.first_name}{ }{contact.middle_name}{ }{contact.last_name}{ }{contact.suffix_id:label}', 'filter' => 1, 'is_default' => 1, ], [ - 'label' => '{contact.household_name}', 'value' => 2, 'name' => '{contact.household_name}', 'filter' => 2, 'is_default' => 1, ], [ - 'label' => '{contact.organization_name}', 'value' => 3, 'name' => '{contact.organization_name}', 'filter' => 3, 'is_default' => 1, ], [ - 'label' => 'Customized', 'value' => 4, 'name' => 'Customized', 'is_reserved' => 1, ], - ]); + ]) + ->syncColumns('fill', ['name' => 'label']); diff --git a/sql/civicrm_option_groups/batch_mode.sqldata.php b/sql/civicrm_option_groups/batch_mode.sqldata.php index 95f9d496ff..19cfa33a00 100644 --- a/sql/civicrm_option_groups/batch_mode.sqldata.php +++ b/sql/civicrm_option_groups/batch_mode.sqldata.php @@ -6,6 +6,10 @@ return CRM_Core_CodeGen_OptionGroup::create('batch_mode', 'a/0065') ]) ->addValueTable(['label', 'name', 'value', 'description'], [ // TODO: Shouldn't we have ts() for these descriptions? - [ts('Manual Batch'), 'Manual Batch', 1, 'Manual Batch', 'is_reserved' => 1, 'component_id' => 2], - [ts('Automatic Batch'), 'Automatic Batch', 2, 'Automatic Batch', 'is_reserved' => 1, 'component_id' => 2], + [ts('Manual Batch'), 'Manual Batch', 1, 'Manual Batch'], + [ts('Automatic Batch'), 'Automatic Batch', 2, 'Automatic Batch'], + ]) + ->addDefaults([ + 'is_reserved' => 1, + 'component_id' => 2, ]); diff --git a/sql/civicrm_option_groups/contact_autocomplete_options.sqldata.php b/sql/civicrm_option_groups/contact_autocomplete_options.sqldata.php index e5ded1102a..1d345481ed 100644 --- a/sql/civicrm_option_groups/contact_autocomplete_options.sqldata.php +++ b/sql/civicrm_option_groups/contact_autocomplete_options.sqldata.php @@ -4,12 +4,13 @@ return CRM_Core_CodeGen_OptionGroup::create('contact_autocomplete_options', 'a/0 'title' => ts('Autocomplete Contact Search'), 'is_locked' => 1, ]) - ->addValueTable(['label', 'name', 'value', 'weight'], [ - [ts('Email Address'), 'email', 2, 2], - [ts('Phone'), 'phone', 3, 3], - [ts('Street Address'), 'street_address', 4, 4], - [ts('City'), 'city', 5, 5], - [ts('State/Province'), 'state_province', 6, 6], - [ts('Country'), 'country', 7, 7], - [ts('Postal Code'), 'postal_code', 8, 8], - ]); + ->addValueTable(['label', 'name', 'value'], [ + [ts('Email Address'), 'email', 2], + [ts('Phone'), 'phone', 3], + [ts('Street Address'), 'street_address', 4], + [ts('City'), 'city', 5], + [ts('State/Province'), 'state_province', 6], + [ts('Country'), 'country', 7], + [ts('Postal Code'), 'postal_code', 8], + ]) + ->syncColumns('fill', ['value' => 'weight']); diff --git a/sql/civicrm_option_groups/contact_reference_options.sqldata.php b/sql/civicrm_option_groups/contact_reference_options.sqldata.php index f5fe5e5c2a..0cf884bc5a 100644 --- a/sql/civicrm_option_groups/contact_reference_options.sqldata.php +++ b/sql/civicrm_option_groups/contact_reference_options.sqldata.php @@ -4,12 +4,14 @@ return CRM_Core_CodeGen_OptionGroup::create('contact_reference_options', 'a/0044 'title' => ts('Contact Reference Autocomplete Options'), 'is_locked' => 1, ]) - ->addValueTable(['label', 'name', 'value', 'weight'], [ - [ts('Email Address'), 'email', 2, 2], - [ts('Phone'), 'phone', 3, 3], - [ts('Street Address'), 'street_address', 4, 4], - [ts('City'), 'city', 5, 5], - [ts('State/Province'), 'state_province', 6, 6], - [ts('Country'), 'country', 7, 7], - [ts('Postal Code'), 'postal_code', 8, 8], - ]); + ->addValueTable(['label', 'name', 'value'], [ + // We don't talk about One-No. We don't talk about One-No! + [ts('Email Address'), 'email', 2], + [ts('Phone'), 'phone', 3], + [ts('Street Address'), 'street_address', 4], + [ts('City'), 'city', 5], + [ts('State/Province'), 'state_province', 6], + [ts('Country'), 'country', 7], + [ts('Postal Code'), 'postal_code', 8], + ]) + ->syncColumns('fill', ['value' => 'weight']); diff --git a/sql/civicrm_option_groups/contact_view_options.sqldata.php b/sql/civicrm_option_groups/contact_view_options.sqldata.php index 2d0a9b333b..e1358ac0a8 100644 --- a/sql/civicrm_option_groups/contact_view_options.sqldata.php +++ b/sql/civicrm_option_groups/contact_view_options.sqldata.php @@ -4,7 +4,7 @@ return CRM_Core_CodeGen_OptionGroup::create('contact_view_options', 'a/0016') 'title' => ts('Contact View Options'), 'is_locked' => 1, ]) - ->addValueTable(['label', 'name', 'value', 'weight'], [ + ->addValueTable(['label', 'name', 'value'], [ // NOTE: The original SQL had this inaccurate comment. It is unclear if the comment is inaccurate // because the situation changed for the better or the worse. @@ -12,16 +12,17 @@ return CRM_Core_CodeGen_OptionGroup::create('contact_view_options', 'a/0016') // -- note that these are not ts'ed since they are used for logic in most cases and not display // -- they are used for display only in the prefernces field settings - [ts('Activities'), 'activity', 1, 1], - [ts('Relationships'), 'rel', 2, 2], - [ts('Groups'), 'group', 3, 3], - [ts('Notes'), 'note', 4, 4], - [ts('Tags'), 'tag', 5, 5], - [ts('Change Log'), 'log', 6, 6], - [ts('Contributions'), 'CiviContribute', 7, 7], - [ts('Memberships'), 'CiviMember', 8, 8], - [ts('Events'), 'CiviEvent', 9, 9], - [ts('Cases'), 'CiviCase', 10, 10], - [ts('Pledges'), 'CiviPledge', 13, 13], - [ts('Mailings'), 'CiviMail', 14, 14], - ]); + [ts('Activities'), 'activity', 1], + [ts('Relationships'), 'rel', 2], + [ts('Groups'), 'group', 3], + [ts('Notes'), 'note', 4], + [ts('Tags'), 'tag', 5], + [ts('Change Log'), 'log', 6], + [ts('Contributions'), 'CiviContribute', 7], + [ts('Memberships'), 'CiviMember', 8], + [ts('Events'), 'CiviEvent', 9], + [ts('Cases'), 'CiviCase', 10], + [ts('Pledges'), 'CiviPledge', 13], + [ts('Mailings'), 'CiviMail', 14], + ]) + ->syncColumns('fill', ['value' => 'weight']); diff --git a/sql/civicrm_option_groups/contribution_status.sqldata.php b/sql/civicrm_option_groups/contribution_status.sqldata.php index 7bcd99673f..0f695b2bdb 100644 --- a/sql/civicrm_option_groups/contribution_status.sqldata.php +++ b/sql/civicrm_option_groups/contribution_status.sqldata.php @@ -4,17 +4,19 @@ return CRM_Core_CodeGen_OptionGroup::create('contribution_status', 'a/0011') 'title' => ts('Contribution Status'), 'is_locked' => 1, ]) - ->addValueTable(['label', 'name', 'value', 'weight'], [ - [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.')], + ->addValueTable(['label', 'name', 'value'], [ + [ts('Completed'), 'Completed', 1], + [ts('Pending'), 'Pending', 2], + [ts('Cancelled'), 'Cancelled', 3], + [ts('Failed'), 'Failed', 4], + // 5 and 6 went fishing. + [ts('Refunded'), 'Refunded', 7], + [ts('Partially paid'), 'Partially paid', 8], + [ts('Pending refund'), 'Pending refund', 9], + [ts('Chargeback'), 'Chargeback', 10], + [ts('Template'), 'Template', 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, - ]); + ]) + ->syncColumns('fill', ['value' => 'weight']); diff --git a/sql/civicrm_option_groups/custom_search.sqldata.php b/sql/civicrm_option_groups/custom_search.sqldata.php index b52d9ae173..16dbb72ccd 100644 --- a/sql/civicrm_option_groups/custom_search.sqldata.php +++ b/sql/civicrm_option_groups/custom_search.sqldata.php @@ -5,49 +5,42 @@ return CRM_Core_CodeGen_OptionGroup::create('custom_search', 'a/0023') ]) ->addValues([ [ - 'label' => 'CRM_Contact_Form_Search_Custom_Sample', 'value' => 1, 'name' => 'CRM_Contact_Form_Search_Custom_Sample', 'weight' => 1, 'description' => ts('Household Name and State'), ], [ - 'label' => 'CRM_Contact_Form_Search_Custom_ContributionAggregate', 'value' => 2, 'name' => 'CRM_Contact_Form_Search_Custom_ContributionAggregate', 'weight' => 2, 'description' => ts('Contribution Aggregate'), ], [ - 'label' => 'CRM_Contact_Form_Search_Custom_Group', 'value' => 4, 'name' => 'CRM_Contact_Form_Search_Custom_Group', 'weight' => 4, 'description' => ts('Include / Exclude Search'), ], [ - 'label' => 'CRM_Contact_Form_Search_Custom_PostalMailing', 'value' => 5, 'name' => 'CRM_Contact_Form_Search_Custom_PostalMailing', 'weight' => 5, 'description' => ts('Postal Mailing'), ], [ - 'label' => 'CRM_Contact_Form_Search_Custom_Proximity', 'value' => 6, 'name' => 'CRM_Contact_Form_Search_Custom_Proximity', 'weight' => 6, 'description' => ts('Proximity Search'), ], [ - 'label' => 'CRM_Contact_Form_Search_Custom_EventAggregate', 'value' => 7, 'name' => 'CRM_Contact_Form_Search_Custom_EventAggregate', 'weight' => 7, 'description' => ts('Event Aggregate'), ], [ - 'label' => 'CRM_Contact_Form_Search_Custom_ActivitySearch', 'value' => 8, 'name' => 'CRM_Contact_Form_Search_Custom_ActivitySearch', 'weight' => 8, @@ -55,52 +48,46 @@ return CRM_Core_CodeGen_OptionGroup::create('custom_search', 'a/0023') 'is_active' => 0, ], [ - 'label' => 'CRM_Contact_Form_Search_Custom_PriceSet', 'value' => 9, 'name' => 'CRM_Contact_Form_Search_Custom_PriceSet', 'weight' => 9, 'description' => ts('Price Set Details for Event Participants'), ], [ - 'label' => 'CRM_Contact_Form_Search_Custom_ZipCodeRange', 'value' => 10, 'name' => 'CRM_Contact_Form_Search_Custom_ZipCodeRange', 'weight' => 10, 'description' => ts('Zip Code Range'), ], [ - 'label' => 'CRM_Contact_Form_Search_Custom_DateAdded', 'value' => 11, 'name' => 'CRM_Contact_Form_Search_Custom_DateAdded', 'weight' => 11, 'description' => ts('Date Added to CiviCRM'), ], [ - 'label' => 'CRM_Contact_Form_Search_Custom_MultipleValues', 'value' => 12, 'name' => 'CRM_Contact_Form_Search_Custom_MultipleValues', 'weight' => 12, 'description' => ts('Custom Group Multiple Values Listing'), ], [ - 'label' => 'CRM_Contact_Form_Search_Custom_ContribSYBNT', 'value' => 13, 'name' => 'CRM_Contact_Form_Search_Custom_ContribSYBNT', 'weight' => 13, 'description' => ts('Contributions made in Year X and not Year Y'), ], [ - 'label' => 'CRM_Contact_Form_Search_Custom_TagContributions', 'value' => 14, 'name' => 'CRM_Contact_Form_Search_Custom_TagContributions', 'weight' => 14, 'description' => ts('Find Contribution Amounts by Tag'), ], [ - 'label' => 'CRM_Contact_Form_Search_Custom_FullText', 'value' => 15, 'name' => 'CRM_Contact_Form_Search_Custom_FullText', 'weight' => 15, 'description' => ts('Full-text Search'), ], - ]); + ]) + ->syncColumns('fill', ['name' => 'label']); diff --git a/sql/civicrm_option_groups/email_greeting.sqldata.php b/sql/civicrm_option_groups/email_greeting.sqldata.php index de7ac44e6f..72527edaa0 100644 --- a/sql/civicrm_option_groups/email_greeting.sqldata.php +++ b/sql/civicrm_option_groups/email_greeting.sqldata.php @@ -5,35 +5,31 @@ return CRM_Core_CodeGen_OptionGroup::create('email_greeting', 'a/0040') ]) ->addValues([ [ - 'label' => 'Dear {contact.first_name}', 'value' => 1, 'name' => 'Dear {contact.first_name}', 'filter' => 1, 'is_default' => 1, ], [ - 'label' => 'Dear {contact.prefix_id:label} {contact.first_name} {contact.last_name}', 'value' => 2, 'name' => 'Dear {contact.prefix_id:label} {contact.first_name} {contact.last_name}', 'filter' => 1, ], [ - 'label' => 'Dear {contact.prefix_id:label} {contact.last_name}', 'value' => 3, 'name' => 'Dear {contact.prefix_id:label} {contact.last_name}', 'filter' => 1, ], [ - 'label' => 'Customized', 'value' => 4, 'name' => 'Customized', 'is_reserved' => 1, ], [ - 'label' => 'Dear {contact.household_name}', 'value' => 5, 'name' => 'Dear {contact.household_name}', 'filter' => 2, 'is_default' => 1, ], - ]); + ]) + ->syncColumns('fill', ['name' => 'label']); diff --git a/sql/civicrm_option_groups/mail_protocol.sqldata.php b/sql/civicrm_option_groups/mail_protocol.sqldata.php index 5bcd96f131..755a269590 100644 --- a/sql/civicrm_option_groups/mail_protocol.sqldata.php +++ b/sql/civicrm_option_groups/mail_protocol.sqldata.php @@ -3,9 +3,10 @@ return CRM_Core_CodeGen_OptionGroup::create('mail_protocol', 'a/0036') ->addMetadata([ 'title' => ts('Mail Protocol'), ]) - ->addValueTable(['label', 'name', 'value'], [ - ['IMAP', 'IMAP', 1], - ['Maildir', 'Maildir', 2], - ['POP3', 'POP3', 3], - ['Localdir', 'Localdir', 4], - ]); + ->addValueTable(['name', 'value'], [ + ['IMAP', 1], + ['Maildir', 2], + ['POP3', 3], + ['Localdir', 4], + ]) + ->syncColumns('fill', ['name' => 'label']); diff --git a/sql/civicrm_option_groups/mapping_type.sqldata.php b/sql/civicrm_option_groups/mapping_type.sqldata.php index d88327027a..4f8bad26f0 100644 --- a/sql/civicrm_option_groups/mapping_type.sqldata.php +++ b/sql/civicrm_option_groups/mapping_type.sqldata.php @@ -4,21 +4,23 @@ return CRM_Core_CodeGen_OptionGroup::create('mapping_type', 'a/0030') 'title' => ts('Mapping Type'), 'is_locked' => 1, ]) - ->addValueTable(['label', 'name', 'value', 'weight'], [ - [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], + ->addValueTable(['label', 'name', 'value'], [ + [ts('Search Builder'), 'Search Builder', 1], + [ts('Import Contact'), 'Import Contact', 2], + [ts('Import Activity'), 'Import Activity', 3], + [ts('Import Contribution'), 'Import Contribution', 4], + [ts('Import Membership'), 'Import Membership', 5], + [ts('Import Participant'), 'Import Participant', 6], + [ts('Export Contact'), 'Export Contact', 7], + [ts('Export Contribution'), 'Export Contribution', 8], + [ts('Export Membership'), 'Export Membership', 9], + [ts('Export Participant'), 'Export Participant', 10], + [ts('Export Pledge'), 'Export Pledge', 11], + [ts('Export Case'), 'Export Case', 12], + // Never go to the 13th floor. + [ts('Export Activity'), 'Export Activity', 14], ]) ->addDefaults([ 'is_reserved' => 1, - ]); + ]) + ->syncColumns('fill', ['value' => 'weight']); diff --git a/sql/civicrm_option_groups/postal_greeting.sqldata.php b/sql/civicrm_option_groups/postal_greeting.sqldata.php index 6929ac8a77..f68249388d 100644 --- a/sql/civicrm_option_groups/postal_greeting.sqldata.php +++ b/sql/civicrm_option_groups/postal_greeting.sqldata.php @@ -5,35 +5,31 @@ return CRM_Core_CodeGen_OptionGroup::create('postal_greeting', 'a/0041') ]) ->addValues([ [ - 'label' => 'Dear {contact.first_name}', 'value' => 1, 'name' => 'Dear {contact.first_name}', 'filter' => 1, 'is_default' => 1, ], [ - 'label' => 'Dear {contact.prefix_id:label} {contact.first_name} {contact.last_name}', 'value' => 2, 'name' => 'Dear {contact.prefix_id:label} {contact.first_name} {contact.last_name}', 'filter' => 1, ], [ - 'label' => 'Dear {contact.prefix_id:label} {contact.last_name}', 'value' => 3, 'name' => 'Dear {contact.prefix_id:label} {contact.last_name}', 'filter' => 1, ], [ - 'label' => 'Customized', 'value' => 4, 'name' => 'Customized', 'is_reserved' => 1, ], [ - 'label' => 'Dear {contact.household_name}', 'value' => 5, 'name' => 'Dear {contact.household_name}', 'filter' => 2, 'is_default' => 1, ], - ]); + ]) + ->syncColumns('fill', ['name' => 'label']); diff --git a/sql/civicrm_option_groups/recent_items_providers.sqldata.php b/sql/civicrm_option_groups/recent_items_providers.sqldata.php index e20fc22cd0..ccc86df7c9 100644 --- a/sql/civicrm_option_groups/recent_items_providers.sqldata.php +++ b/sql/civicrm_option_groups/recent_items_providers.sqldata.php @@ -5,19 +5,19 @@ return CRM_Core_CodeGen_OptionGroup::create('recent_items_providers', 'b/99') ->addMetadata([ 'title' => ts('Recent Items Providers'), ]) - ->addValueTable(['label', 'value', 'name'], [ - [ts('Contacts'), 'Contact', 'Contact'], - [ts('Relationships'), 'Relationship', 'Relationship'], - [ts('Activities'), 'Activity', 'Activity'], - [ts('Notes'), 'Note', 'Note'], - [ts('Groups'), 'Group', 'Group'], - [ts('Cases'), 'Case', 'Case'], - [ts('Contributions'), 'Contribution', 'Contribution'], - [ts('Participants'), 'Participant', 'Participant'], - [ts('Memberships'), 'Membership', 'Membership'], - [ts('Pledges'), 'Pledge', 'Pledge'], - [ts('Events'), 'Event', 'Event'], - [ts('Campaigns'), 'Campaign', 'Campaign'], + ->addValueTable(['label', 'name'], [ + [ts('Contacts'), 'Contact'], + [ts('Relationships'), 'Relationship'], + [ts('Activities'), 'Activity'], + [ts('Notes'), 'Note'], + [ts('Groups'), 'Group'], + [ts('Cases'), 'Case'], + [ts('Contributions'), 'Contribution'], + [ts('Participants'), 'Participant'], + [ts('Memberships'), 'Membership'], + [ts('Pledges'), 'Pledge'], + [ts('Events'), 'Event'], + [ts('Campaigns'), 'Campaign'], ]) ->addDefaults([ 'description' => '', @@ -25,4 +25,5 @@ return CRM_Core_CodeGen_OptionGroup::create('recent_items_providers', 'b/99') 'weight' => 1, // Why do these all have the same weight? Shrug. 'is_reserved' => 1, - ]); + ]) + ->syncColumns('fill', ['name' => 'value']); diff --git a/sql/civicrm_option_groups/recur_frequency_units.sqldata.php b/sql/civicrm_option_groups/recur_frequency_units.sqldata.php index 0d341eddfa..886a429c6f 100644 --- a/sql/civicrm_option_groups/recur_frequency_units.sqldata.php +++ b/sql/civicrm_option_groups/recur_frequency_units.sqldata.php @@ -3,12 +3,13 @@ return CRM_Core_CodeGen_OptionGroup::create('recur_frequency_units', 'a/0032') ->addMetadata([ 'title' => ts('Recurring Frequency Units'), ]) - ->addValueTable(['label', 'name', 'value'], [ - [ts('day'), 'day', 'day'], - [ts('week'), 'week', 'week'], - [ts('month'), 'month', 'month'], - [ts('year'), 'year', 'year'], + ->addValueTable(['label', 'name'], [ + [ts('day'), 'day'], + [ts('week'), 'week'], + [ts('month'), 'month'], + [ts('year'), 'year'], ]) + ->syncColumns('fill', ['name' => 'value']) ->addDefaults([ 'is_reserved' => 1, ]); diff --git a/sql/civicrm_option_groups/relative_date_filters.sqldata.php b/sql/civicrm_option_groups/relative_date_filters.sqldata.php index 569d227f0d..6240b1cbe4 100644 --- a/sql/civicrm_option_groups/relative_date_filters.sqldata.php +++ b/sql/civicrm_option_groups/relative_date_filters.sqldata.php @@ -3,72 +3,74 @@ return CRM_Core_CodeGen_OptionGroup::create('relative_date_filters', 'a/0078') ->addMetadata([ 'title' => ts('Relative Date Filters'), ]) - ->addValueTable(['label', 'name', 'value'], [ - [ts('Today'), 'this.day', 'this.day'], - [ts('This week'), 'this.week', 'this.week'], - [ts('This calendar month'), 'this.month', 'this.month'], - [ts('This quarter'), 'this.quarter', 'this.quarter'], - [ts('This fiscal year'), 'this.fiscal_year', 'this.fiscal_year'], - [ts('This calendar year'), 'this.year', 'this.year'], - [ts('Yesterday'), 'previous.day', 'previous.day'], - [ts('Previous week'), 'previous.week', 'previous.week'], - [ts('Previous calendar month'), 'previous.month', 'previous.month'], - [ts('Previous quarter'), 'previous.quarter', 'previous.quarter'], - [ts('Previous fiscal year'), 'previous.fiscal_year', 'previous.fiscal_year'], - [ts('Previous calendar year'), 'previous.year', 'previous.year'], - [ts('Last 7 days including today'), 'ending.week', 'ending.week'], - [ts('Last 30 days including today'), 'ending.month', 'ending_30.day'], - [ts('Last 60 days including today'), 'ending_2.month', 'ending_60.day'], - [ts('Last 90 days including today'), 'ending.quarter', 'ending_90.day'], - [ts('Last 12 months including today'), 'ending.year', 'ending.year'], - [ts('Last 2 years including today'), 'ending_2.year', 'ending_2.year'], - [ts('Last 3 years including today'), 'ending_3.year', 'ending_3.year'], - [ts('Tomorrow'), 'starting.day', 'starting.day'], - [ts('Next week'), 'next.week', 'next.week'], - [ts('Next calendar month'), 'next.month', 'next.month'], - [ts('Next quarter'), 'next.quarter', 'next.quarter'], - [ts('Next fiscal year'), 'next.fiscal_year', 'next.fiscal_year'], - [ts('Next calendar year'), 'next.year', 'next.year'], - [ts('Next 7 days including today'), 'starting.week', 'starting.week'], - [ts('Next 30 days including today'), 'starting.month', 'starting.month'], - [ts('Next 60 days including today'), 'starting_2.month', 'starting_2.month'], - [ts('Next 90 days including today'), 'starting.quarter', 'starting.quarter'], - [ts('Next 12 months including today'), 'starting.year', 'starting.year'], - [ts('Current week to-date'), 'current.week', 'current.week'], - [ts('Current calendar month to-date'), 'current.month', 'current.month'], - [ts('Current quarter to-date'), 'current.quarter', 'current.quarter'], - [ts('Current calendar year to-date'), 'current.year', 'current.year'], - [ts('To end of yesterday'), 'earlier.day', 'earlier.day'], - [ts('To end of previous week'), 'earlier.week', 'earlier.week'], - [ts('To end of previous calendar month'), 'earlier.month', 'earlier.month'], - [ts('To end of previous quarter'), 'earlier.quarter', 'earlier.quarter'], - [ts('To end of previous calendar year'), 'earlier.year', 'earlier.year'], - [ts('From start of current day'), 'greater.day', 'greater.day'], - [ts('From start of current week'), 'greater.week', 'greater.week'], - [ts('From start of current calendar month'), 'greater.month', 'greater.month'], - [ts('From start of current quarter'), 'greater.quarter', 'greater.quarter'], - [ts('From start of current calendar year'), 'greater.year', 'greater.year'], - [ts('To end of current week'), 'less.week', 'less.week'], - [ts('To end of current calendar month'), 'less.month', 'less.month'], - [ts('To end of current quarter'), 'less.quarter', 'less.quarter'], - [ts('To end of current calendar year'), 'less.year', 'less.year'], - [ts('Previous 2 days'), 'previous_2.day', 'previous_2.day'], - [ts('Previous 2 weeks'), 'previous_2.week', 'previous_2.week'], - [ts('Previous 2 calendar months'), 'previous_2.month', 'previous_2.month'], - [ts('Previous 2 quarters'), 'previous_2.quarter', 'previous_2.quarter'], - [ts('Previous 2 calendar years'), 'previous_2.year', 'previous_2.year'], - [ts('Previous 2 fiscal years'), 'previous_2.fiscal_year', 'previous_2.fiscal_year'], - [ts('Day prior to yesterday'), 'previous_before.day', 'previous_before.day'], - [ts('Week prior to previous week'), 'previous_before.week', 'previous_before.week'], - [ts('Month prior to previous calendar month'), 'previous_before.month', 'previous_before.month', 'is_default' => NULL], - [ts('Quarter prior to previous quarter'), 'previous_before.quarter', 'previous_before.quarter'], - [ts('Year prior to previous calendar year'), 'previous_before.year', 'previous_before.year'], - [ts('Fiscal year prior to previous fiscal year'), 'previous_before.fiscal_year', 'previous_before.fiscal_year'], - [ts('From end of previous week'), 'greater_previous.week', 'greater_previous.week'], - [ts('From end of previous calendar month'), 'greater_previous.month', 'greater_previous.month'], - [ts('From end of previous quarter'), 'greater_previous.quarter', 'greater_previous.quarter'], - [ts('From end of previous calendar year'), 'greater_previous.year', 'greater_previous.year'], + ->addValueTable(['label', 'name'], [ + [ts('Today'), 'this.day'], + [ts('This week'), 'this.week'], + [ts('This calendar month'), 'this.month'], + [ts('This quarter'), 'this.quarter'], + [ts('This fiscal year'), 'this.fiscal_year'], + [ts('This calendar year'), 'this.year'], + [ts('Yesterday'), 'previous.day'], + [ts('Previous week'), 'previous.week'], + [ts('Previous calendar month'), 'previous.month'], + [ts('Previous quarter'), 'previous.quarter'], + [ts('Previous fiscal year'), 'previous.fiscal_year'], + [ts('Previous calendar year'), 'previous.year'], + [ts('Last 7 days including today'), 'ending.week'], + [ts('Last 30 days including today'), 'ending.month', 'value' => 'ending_30.day'], + [ts('Last 60 days including today'), 'ending_2.month', 'value' => 'ending_60.day'], + [ts('Last 90 days including today'), 'ending.quarter', 'value' => 'ending_90.day'], + // Suspicious... name and value disagree... ^^^ + [ts('Last 12 months including today'), 'ending.year'], + [ts('Last 2 years including today'), 'ending_2.year'], + [ts('Last 3 years including today'), 'ending_3.year'], + [ts('Tomorrow'), 'starting.day'], + [ts('Next week'), 'next.week'], + [ts('Next calendar month'), 'next.month'], + [ts('Next quarter'), 'next.quarter'], + [ts('Next fiscal year'), 'next.fiscal_year'], + [ts('Next calendar year'), 'next.year'], + [ts('Next 7 days including today'), 'starting.week'], + [ts('Next 30 days including today'), 'starting.month'], + [ts('Next 60 days including today'), 'starting_2.month'], + [ts('Next 90 days including today'), 'starting.quarter'], + [ts('Next 12 months including today'), 'starting.year'], + [ts('Current week to-date'), 'current.week'], + [ts('Current calendar month to-date'), 'current.month'], + [ts('Current quarter to-date'), 'current.quarter'], + [ts('Current calendar year to-date'), 'current.year'], + [ts('To end of yesterday'), 'earlier.day'], + [ts('To end of previous week'), 'earlier.week'], + [ts('To end of previous calendar month'), 'earlier.month'], + [ts('To end of previous quarter'), 'earlier.quarter'], + [ts('To end of previous calendar year'), 'earlier.year'], + [ts('From start of current day'), 'greater.day'], + [ts('From start of current week'), 'greater.week'], + [ts('From start of current calendar month'), 'greater.month'], + [ts('From start of current quarter'), 'greater.quarter'], + [ts('From start of current calendar year'), 'greater.year'], + [ts('To end of current week'), 'less.week'], + [ts('To end of current calendar month'), 'less.month'], + [ts('To end of current quarter'), 'less.quarter'], + [ts('To end of current calendar year'), 'less.year'], + [ts('Previous 2 days'), 'previous_2.day'], + [ts('Previous 2 weeks'), 'previous_2.week'], + [ts('Previous 2 calendar months'), 'previous_2.month'], + [ts('Previous 2 quarters'), 'previous_2.quarter'], + [ts('Previous 2 calendar years'), 'previous_2.year'], + [ts('Previous 2 fiscal years'), 'previous_2.fiscal_year'], + [ts('Day prior to yesterday'), 'previous_before.day'], + [ts('Week prior to previous week'), 'previous_before.week'], + [ts('Month prior to previous calendar month'), 'previous_before.month', 'is_default' => NULL], + [ts('Quarter prior to previous quarter'), 'previous_before.quarter'], + [ts('Year prior to previous calendar year'), 'previous_before.year'], + [ts('Fiscal year prior to previous fiscal year'), 'previous_before.fiscal_year'], + [ts('From end of previous week'), 'greater_previous.week'], + [ts('From end of previous calendar month'), 'greater_previous.month'], + [ts('From end of previous quarter'), 'greater_previous.quarter'], + [ts('From end of previous calendar year'), 'greater_previous.year'], ]) + ->syncColumns('fill', ['name' => 'value']) ->addDefaults([ 'filter' => NULL, ]); diff --git a/sql/civicrm_option_groups/safe_file_extension.sqldata.php b/sql/civicrm_option_groups/safe_file_extension.sqldata.php index 01ebaa3689..4f0e84b14b 100644 --- a/sql/civicrm_option_groups/safe_file_extension.sqldata.php +++ b/sql/civicrm_option_groups/safe_file_extension.sqldata.php @@ -3,21 +3,22 @@ return CRM_Core_CodeGen_OptionGroup::create('safe_file_extension', 'a/0028') ->addMetadata([ 'title' => ts('Safe File Extension'), ]) - ->addValueTable(['label', 'name', 'value'], [ - ['jpg', 'jpg', 1], - ['jpeg', 'jpeg', 2], - ['png', 'png', 3], - ['gif', 'gif', 4], - ['txt', 'txt', 5], - ['pdf', 'pdf', 6], - ['doc', 'doc', 7], - ['xls', 'xls', 8], - ['rtf', 'rtf', 9], - ['csv', 'csv', 10], - ['ppt', 'ppt', 11], - ['docx', 'docx', 12], - ['xlsx', 'xlsx', 13], - ['odt', 'odt', 14], - ['ics', 'ics', 15], - ['pptx', 'pptx', 16], - ]); + ->addValueTable(['name', 'value'], [ + ['jpg', 1], + ['jpeg', 2], + ['png', 3], + ['gif', 4], + ['txt', 5], + ['pdf', 6], + ['doc', 7], + ['xls', 8], + ['rtf', 9], + ['csv', 10], + ['ppt', 11], + ['docx', 12], + ['xlsx', 13], + ['odt', 14], + ['ics', 15], + ['pptx', 16], + ]) + ->syncColumns('fill', ['name' => 'label']); diff --git a/sql/civicrm_option_groups/user_dashboard_options.sqldata.php b/sql/civicrm_option_groups/user_dashboard_options.sqldata.php index 955fef7d95..34a162abf1 100644 --- a/sql/civicrm_option_groups/user_dashboard_options.sqldata.php +++ b/sql/civicrm_option_groups/user_dashboard_options.sqldata.php @@ -4,14 +4,16 @@ return CRM_Core_CodeGen_OptionGroup::create('user_dashboard_options', 'a/0020') 'title' => ts('User Dashboard Options'), 'is_locked' => 1, ]) - ->addValueTable(['label', 'name', 'value', 'weight'], [ - [ts('Groups'), 'Groups', 1, 1], - [ts('Contributions'), 'CiviContribute', 2, 2], - [ts('Memberships'), 'CiviMember', 3, 3], - [ts('Events'), 'CiviEvent', 4, 4], - [ts('My Contacts / Organizations'), 'Permissioned Orgs', 5, 5], - [ts('Pledges'), 'CiviPledge', 7, 7], - [ts('Personal Campaign Pages'), 'PCP', 8, 8], - [ts('Assigned Activities'), 'Assigned Activities', 9, 9], - [ts('Invoices / Credit Notes'), 'Invoices / Credit Notes', 10, 10], - ]); + ->addValueTable(['label', 'name', 'value'], [ + [ts('Groups'), 'Groups', 1], + [ts('Contributions'), 'CiviContribute', 2], + [ts('Memberships'), 'CiviMember', 3], + [ts('Events'), 'CiviEvent', 4], + [ts('My Contacts / Organizations'), 'Permissioned Orgs', 5], + // Wait, I like the number 6. What's wrong with 6? + [ts('Pledges'), 'CiviPledge', 7], + [ts('Personal Campaign Pages'), 'PCP', 8], + [ts('Assigned Activities'), 'Assigned Activities', 9], + [ts('Invoices / Credit Notes'), 'Invoices / Credit Notes', 10], + ]) + ->syncColumns('fill', ['value' => 'weight']); diff --git a/sql/civicrm_option_groups/website_type.sqldata.php b/sql/civicrm_option_groups/website_type.sqldata.php index 697963c152..1aa66a5a97 100644 --- a/sql/civicrm_option_groups/website_type.sqldata.php +++ b/sql/civicrm_option_groups/website_type.sqldata.php @@ -3,16 +3,18 @@ return CRM_Core_CodeGen_OptionGroup::create('website_type', 'a/0045') ->addMetadata([ 'title' => ts('Website Type'), ]) - ->addValueTable(['label', 'name', 'value', 'weight'], [ - ['Work', 'Work', 1, 1, 'is_default' => 1], - ['Main', 'Main', 2, 2], - ['Facebook', 'Facebook', 3, 3], - ['Instagram', 'Instagram', 5, 5], - ['LinkedIn', 'LinkedIn', 6, 6], - ['MySpace', 'MySpace', 7, 7], - ['Pinterest', 'Pinterest', 8, 8], - ['SnapChat', 'SnapChat', 9, 9], - ['Tumblr', 'Tumblr', 10, 10], - ['Twitter', 'Twitter', 11, 11], - ['Vine', 'Vine ', 12, 12], - ]); + ->addValueTable(['name', 'value'], [ + ['Work', 1, 'is_default' => 1], + ['Main', 2], + ['Facebook', 3], + ['Instagram', 5], + ['LinkedIn', 6], + ['MySpace', 7], + ['Pinterest', 8], + ['SnapChat', 9], + ['Tumblr', 10], + ['Twitter', 11], + ['Vine ', 12, 'label' => 'Vine'], + // This appears to be locking-in a typo on the 'name' side, but they fixed the 'label'. + ]) + ->syncColumns('fill', ['value' => 'weight', 'name' => 'label']);