From 30736cbc90f70dfdf5fe7562c6cf640455924eed Mon Sep 17 00:00:00 2001 From: Monish Deb Date: Thu, 7 Apr 2022 18:12:16 -0700 Subject: [PATCH] Schema - Fix boolean fields in 'Case' --- CRM/Case/DAO/Case.php | 5 +++-- CRM/Case/DAO/CaseType.php | 9 ++++++--- .../Incremental/php/FiveFortyNine/Case.bool.php | 10 ++++++++++ xml/schema/Case/Case.xml | 1 + xml/schema/Case/CaseType.xml | 3 +++ 5 files changed, 23 insertions(+), 5 deletions(-) create mode 100644 CRM/Upgrade/Incremental/php/FiveFortyNine/Case.bool.php diff --git a/CRM/Case/DAO/Case.php b/CRM/Case/DAO/Case.php index 49e5ba5611..55a0083105 100644 --- a/CRM/Case/DAO/Case.php +++ b/CRM/Case/DAO/Case.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Case/Case.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:9255efc8fc0b791899a006e23eb55341) + * (GenCodeChecksum:cc7bc9034e7487e1913aa45fc4c119b8) */ /** @@ -109,7 +109,7 @@ class CRM_Case_DAO_Case extends CRM_Core_DAO { public $status_id; /** - * @var bool|string|null + * @var bool|string * (SQL type: tinyint) * Note that values will be retrieved from the database as a string. */ @@ -326,6 +326,7 @@ class CRM_Case_DAO_Case extends CRM_Core_DAO { 'name' => 'is_deleted', 'type' => CRM_Utils_Type::T_BOOLEAN, 'title' => ts('Case is in the Trash'), + 'required' => TRUE, 'import' => TRUE, 'where' => 'civicrm_case.is_deleted', 'export' => TRUE, diff --git a/CRM/Case/DAO/CaseType.php b/CRM/Case/DAO/CaseType.php index 8b5f4651a4..3fbe29126d 100644 --- a/CRM/Case/DAO/CaseType.php +++ b/CRM/Case/DAO/CaseType.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Case/CaseType.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:1102802dc49a9899f93c16fce57fa141) + * (GenCodeChecksum:7b3029a4b42f22a060fadb39b7b2c678) */ /** @@ -70,7 +70,7 @@ class CRM_Case_DAO_CaseType extends CRM_Core_DAO { /** * Is this case type enabled? * - * @var bool|string|null + * @var bool|string * (SQL type: tinyint) * Note that values will be retrieved from the database as a string. */ @@ -79,7 +79,7 @@ class CRM_Case_DAO_CaseType extends CRM_Core_DAO { /** * Is this case type a predefined system type? * - * @var bool|string|null + * @var bool|string * (SQL type: tinyint) * Note that values will be retrieved from the database as a string. */ @@ -195,6 +195,7 @@ class CRM_Case_DAO_CaseType extends CRM_Core_DAO { 'type' => CRM_Utils_Type::T_BOOLEAN, 'title' => ts('Case Type Is Active'), 'description' => ts('Is this case type enabled?'), + 'required' => TRUE, 'where' => 'civicrm_case_type.is_active', 'default' => '1', 'table_name' => 'civicrm_case_type', @@ -208,7 +209,9 @@ class CRM_Case_DAO_CaseType extends CRM_Core_DAO { 'type' => CRM_Utils_Type::T_BOOLEAN, 'title' => ts('Case Type Is Reserved'), 'description' => ts('Is this case type a predefined system type?'), + 'required' => TRUE, 'where' => 'civicrm_case_type.is_reserved', + 'default' => '0', 'table_name' => 'civicrm_case_type', 'entity' => 'CaseType', 'bao' => 'CRM_Case_BAO_CaseType', diff --git a/CRM/Upgrade/Incremental/php/FiveFortyNine/Case.bool.php b/CRM/Upgrade/Incremental/php/FiveFortyNine/Case.bool.php new file mode 100644 index 0000000000..c108542e1c --- /dev/null +++ b/CRM/Upgrade/Incremental/php/FiveFortyNine/Case.bool.php @@ -0,0 +1,10 @@ + [ + 'is_deleted' => "DEFAULT 0", + ], + 'civicrm_case_type' => [ + 'is_active' => "DEFAULT 1 COMMENT 'Is this case type enabled?'", + 'is_reserved' => "DEFAULT 0 COMMENT 'Is this case type a predefined system type?'", + ], +]; diff --git a/xml/schema/Case/Case.xml b/xml/schema/Case/Case.xml index acc66e4ede..d26e06f56a 100644 --- a/xml/schema/Case/Case.xml +++ b/xml/schema/Case/Case.xml @@ -131,6 +131,7 @@ case_deleted boolean 0 + true true CheckBox diff --git a/xml/schema/Case/CaseType.xml b/xml/schema/Case/CaseType.xml index ba361ba9e1..3c8a18ff55 100644 --- a/xml/schema/Case/CaseType.xml +++ b/xml/schema/Case/CaseType.xml @@ -62,12 +62,15 @@ boolean Is this case type enabled? 1 + true 4.5 is_reserved Case Type Is Reserved boolean + 0 + true Is this case type a predefined system type? 4.5 -- 2.25.1