From 0c640db0e2c0f3a802eda17ca0246648a0dfe1d2 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Thu, 9 Jun 2022 16:09:43 -0700 Subject: [PATCH] Queue - Add column `is_template` --- CRM/Queue/DAO/Queue.php | 29 +++++++++++++++++++- CRM/Upgrade/Incremental/php/FiveFiftyOne.php | 2 ++ xml/schema/Queue/Queue.xml | 13 +++++++++ 3 files changed, 43 insertions(+), 1 deletion(-) diff --git a/CRM/Queue/DAO/Queue.php b/CRM/Queue/DAO/Queue.php index 48debc8284..65b349c53e 100644 --- a/CRM/Queue/DAO/Queue.php +++ b/CRM/Queue/DAO/Queue.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Queue/Queue.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:0b068d0a6ba5d6348f11706b3854feb1) + * (GenCodeChecksum:85012d3cc88cad6b1c868665e0b490c3) */ /** @@ -118,6 +118,15 @@ class CRM_Queue_DAO_Queue extends CRM_Core_DAO { */ public $error; + /** + * Is this a template configuration (for use by other/future queues)? + * + * @var bool|string + * (SQL type: tinyint) + * Note that values will be retrieved from the database as a string. + */ + public $is_template; + /** * Class constructor. */ @@ -327,6 +336,24 @@ class CRM_Queue_DAO_Queue extends CRM_Core_DAO { ], 'add' => '5.51', ], + 'is_template' => [ + 'name' => 'is_template', + 'type' => CRM_Utils_Type::T_BOOLEAN, + 'title' => ts('Is Template'), + 'description' => ts('Is this a template configuration (for use by other/future queues)?'), + 'required' => TRUE, + 'where' => 'civicrm_queue.is_template', + 'default' => '0', + 'table_name' => 'civicrm_queue', + 'entity' => 'Queue', + 'bao' => 'CRM_Queue_BAO_Queue', + 'localizable' => 0, + 'html' => [ + 'type' => 'CheckBox', + 'label' => ts("Is Template"), + ], + 'add' => '5.51', + ], ]; CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']); } diff --git a/CRM/Upgrade/Incremental/php/FiveFiftyOne.php b/CRM/Upgrade/Incremental/php/FiveFiftyOne.php index 4f440dfb01..a7246c2503 100644 --- a/CRM/Upgrade/Incremental/php/FiveFiftyOne.php +++ b/CRM/Upgrade/Incremental/php/FiveFiftyOne.php @@ -36,6 +36,8 @@ class CRM_Upgrade_Incremental_php_FiveFiftyOne extends CRM_Upgrade_Incremental_B 'status', "varchar(16) NULL DEFAULT 'active' COMMENT 'Execution status'"); $this->addTask('Add column "civicrm_queue.error"', 'addColumn', 'civicrm_queue', 'error', "varchar(16) NULL COMMENT 'Fallback behavior for unhandled errors'"); + $this->addTask('Add column "civicrm_queue.is_template"', 'addColumn', 'civicrm_queue', + 'is_template', "tinyint NOT NULL DEFAULT 0 COMMENT 'Is this a template configuration (for use by other/future queues)?'"); $this->addTask('Backfill "civicrm_queue.status" and "civicrm_queue.error")', 'fillQueueColumns'); } diff --git a/xml/schema/Queue/Queue.xml b/xml/schema/Queue/Queue.xml index 9f91aa5800..de777a9c81 100644 --- a/xml/schema/Queue/Queue.xml +++ b/xml/schema/Queue/Queue.xml @@ -154,4 +154,17 @@ CRM_Queue_BAO_Queue::getErrorModes + + is_template + Is Template + boolean + true + 0 + Is this a template configuration (for use by other/future queues)? + + CheckBox + + + 5.51 + -- 2.25.1