From ef91b1004323086225d50f8079784ba8d9f68eac Mon Sep 17 00:00:00 2001 From: eileen Date: Sun, 6 Oct 2019 18:21:52 +0200 Subject: [PATCH] Add is_active to status pref --- CRM/Core/DAO/StatusPreference.php | 21 +++++++++++++++++++- CRM/Upgrade/Incremental/php/FiveNineteen.php | 2 ++ xml/schema/Core/StatusPreference.xml | 8 ++++++++ 3 files changed, 30 insertions(+), 1 deletion(-) diff --git a/CRM/Core/DAO/StatusPreference.php b/CRM/Core/DAO/StatusPreference.php index 3e2bf54ec0..1cbbc92187 100644 --- a/CRM/Core/DAO/StatusPreference.php +++ b/CRM/Core/DAO/StatusPreference.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Core/StatusPreference.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:bb8e5ce5e19462083928dc256fe1ebf2) + * (GenCodeChecksum:ce861431549af8024fdbfe418607202f) */ /** @@ -77,6 +77,13 @@ class CRM_Core_DAO_StatusPreference extends CRM_Core_DAO { */ public $check_info; + /** + * Is this status check active? + * + * @var bool + */ + public $is_active; + /** * Class constructor. */ @@ -211,6 +218,18 @@ class CRM_Core_DAO_StatusPreference extends CRM_Core_DAO { 'bao' => 'CRM_Core_BAO_StatusPreference', 'localizable' => 0, ], + 'is_active' => [ + 'name' => 'is_active', + 'type' => CRM_Utils_Type::T_BOOLEAN, + 'title' => ts('Check Is Active'), + 'description' => ts('Is this status check active?'), + 'where' => 'civicrm_status_pref.is_active', + 'default' => '1', + 'table_name' => 'civicrm_status_pref', + 'entity' => 'StatusPreference', + 'bao' => 'CRM_Core_BAO_StatusPreference', + 'localizable' => 0, + ], ]; CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']); } diff --git a/CRM/Upgrade/Incremental/php/FiveNineteen.php b/CRM/Upgrade/Incremental/php/FiveNineteen.php index 588f70106a..09ca6201ce 100644 --- a/CRM/Upgrade/Incremental/php/FiveNineteen.php +++ b/CRM/Upgrade/Incremental/php/FiveNineteen.php @@ -69,6 +69,8 @@ class CRM_Upgrade_Incremental_php_FiveNineteen extends CRM_Upgrade_Incremental_B public function upgrade_5_19_alpha1($rev) { $this->addTask(ts('Upgrade DB to %1: SQL', [1 => $rev]), 'runSql', $rev); $this->addTask('Add api4 menu', 'api4Menu'); + $this->addTask('Add is_active field to civicrm_status_pref', 'addColumn', 'civicrm_status_pref', 'is_active', + "tinyint(4) DEFAULT '1' COMMENT 'Is this status check active'", TRUE, '5.19.0'); } /** diff --git a/xml/schema/Core/StatusPreference.xml b/xml/schema/Core/StatusPreference.xml index 7e924e641a..7ae28e74bd 100644 --- a/xml/schema/Core/StatusPreference.xml +++ b/xml/schema/Core/StatusPreference.xml @@ -89,4 +89,12 @@ These values are per-check, and can't be compared across checks. 4.7 + + is_active + Check Is Active + boolean + 1 + Is this status check active? + 5.19 + -- 2.25.1