From 58a622754fcb52e2951438d6c0e42e1364637fa0 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 'Event' --- CRM/Event/Cart/DAO/Cart.php | 5 +-- CRM/Event/DAO/Participant.php | 8 +++-- CRM/Event/DAO/ParticipantStatusType.php | 13 ++++--- .../php/FiveFortyNine/Event.bool.php | 36 +++++++++++++++++++ xml/schema/Event/Cart/Cart.xml | 1 + xml/schema/Event/Participant.xml | 2 ++ xml/schema/Event/ParticipantStatusType.xml | 6 ++++ 7 files changed, 62 insertions(+), 9 deletions(-) create mode 100644 CRM/Upgrade/Incremental/php/FiveFortyNine/Event.bool.php diff --git a/CRM/Event/Cart/DAO/Cart.php b/CRM/Event/Cart/DAO/Cart.php index e5998e7532..9f9ff82103 100644 --- a/CRM/Event/Cart/DAO/Cart.php +++ b/CRM/Event/Cart/DAO/Cart.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Event/Cart/Cart.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:58e30874811fa80b8a405f368004e697) + * (GenCodeChecksum:e88efc43107d7828fa4b0d2c29abb564) */ /** @@ -50,7 +50,7 @@ class CRM_Event_Cart_DAO_Cart extends CRM_Core_DAO { public $user_id; /** - * @var bool|string|null + * @var bool|string * (SQL type: tinyint) * Note that values will be retrieved from the database as a string. */ @@ -134,6 +134,7 @@ class CRM_Event_Cart_DAO_Cart extends CRM_Core_DAO { 'name' => 'completed', 'type' => CRM_Utils_Type::T_BOOLEAN, 'title' => ts('Complete?'), + 'required' => TRUE, 'where' => 'civicrm_event_carts.completed', 'default' => '0', 'table_name' => 'civicrm_event_carts', diff --git a/CRM/Event/DAO/Participant.php b/CRM/Event/DAO/Participant.php index 6a4624cf81..bc23252332 100644 --- a/CRM/Event/DAO/Participant.php +++ b/CRM/Event/DAO/Participant.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Event/Participant.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:62382336b5251b2ee93828d70138cd7e) + * (GenCodeChecksum:9d1b4abcd8bb1106b31c610026aed0d5) */ /** @@ -112,14 +112,14 @@ class CRM_Event_DAO_Participant extends CRM_Core_DAO { public $fee_level; /** - * @var bool|string|null + * @var bool|string * (SQL type: tinyint) * Note that values will be retrieved from the database as a string. */ public $is_test; /** - * @var bool|string|null + * @var bool|string * (SQL type: tinyint) * Note that values will be retrieved from the database as a string. */ @@ -437,6 +437,7 @@ class CRM_Event_DAO_Participant extends CRM_Core_DAO { 'name' => 'is_test', 'type' => CRM_Utils_Type::T_BOOLEAN, 'title' => ts('Test'), + 'required' => TRUE, 'import' => TRUE, 'where' => 'civicrm_participant.is_test', 'export' => TRUE, @@ -451,6 +452,7 @@ class CRM_Event_DAO_Participant extends CRM_Core_DAO { 'name' => 'is_pay_later', 'type' => CRM_Utils_Type::T_BOOLEAN, 'title' => ts('Is Pay Later'), + 'required' => TRUE, 'import' => TRUE, 'where' => 'civicrm_participant.is_pay_later', 'headerPattern' => '/(is.)?(pay(.)?later)$/i', diff --git a/CRM/Event/DAO/ParticipantStatusType.php b/CRM/Event/DAO/ParticipantStatusType.php index bdb75e0e43..160c3f56b1 100644 --- a/CRM/Event/DAO/ParticipantStatusType.php +++ b/CRM/Event/DAO/ParticipantStatusType.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Event/ParticipantStatusType.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:bb9ea5411d4ab4f767d891f2e0f20858) + * (GenCodeChecksum:ed0f2b22eb6983f73fa5b87fc4fa7c9c) */ /** @@ -70,7 +70,7 @@ class CRM_Event_DAO_ParticipantStatusType extends CRM_Core_DAO { /** * whether this is a status type required by the system * - * @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_Event_DAO_ParticipantStatusType extends CRM_Core_DAO { /** * whether this status type is active * - * @var bool|string|null + * @var bool|string * (SQL type: tinyint) * Note that values will be retrieved from the database as a string. */ @@ -88,7 +88,7 @@ class CRM_Event_DAO_ParticipantStatusType extends CRM_Core_DAO { /** * whether this status type is counted against event size limit * - * @var bool|string|null + * @var bool|string * (SQL type: tinyint) * Note that values will be retrieved from the database as a string. */ @@ -210,7 +210,9 @@ class CRM_Event_DAO_ParticipantStatusType extends CRM_Core_DAO { 'type' => CRM_Utils_Type::T_BOOLEAN, 'title' => ts('Participant Status Is Reserved?>'), 'description' => ts('whether this is a status type required by the system'), + 'required' => TRUE, 'where' => 'civicrm_participant_status_type.is_reserved', + 'default' => '0', 'table_name' => 'civicrm_participant_status_type', 'entity' => 'ParticipantStatusType', 'bao' => 'CRM_Event_BAO_ParticipantStatusType', @@ -222,6 +224,7 @@ class CRM_Event_DAO_ParticipantStatusType extends CRM_Core_DAO { 'type' => CRM_Utils_Type::T_BOOLEAN, 'title' => ts('Participant Status is Active'), 'description' => ts('whether this status type is active'), + 'required' => TRUE, 'where' => 'civicrm_participant_status_type.is_active', 'default' => '1', 'table_name' => 'civicrm_participant_status_type', @@ -235,7 +238,9 @@ class CRM_Event_DAO_ParticipantStatusType extends CRM_Core_DAO { 'type' => CRM_Utils_Type::T_BOOLEAN, 'title' => ts('Participant Status Counts?'), 'description' => ts('whether this status type is counted against event size limit'), + 'required' => TRUE, 'where' => 'civicrm_participant_status_type.is_counted', + 'default' => '0', 'table_name' => 'civicrm_participant_status_type', 'entity' => 'ParticipantStatusType', 'bao' => 'CRM_Event_BAO_ParticipantStatusType', diff --git a/CRM/Upgrade/Incremental/php/FiveFortyNine/Event.bool.php b/CRM/Upgrade/Incremental/php/FiveFortyNine/Event.bool.php new file mode 100644 index 0000000000..3e17cfa48c --- /dev/null +++ b/CRM/Upgrade/Incremental/php/FiveFortyNine/Event.bool.php @@ -0,0 +1,36 @@ + [ + 'is_public' => "DEFAULT 1 COMMENT 'Public events will be included in the iCal feeds. Access to private event information may be limited using ACLs.'", + 'is_online_registration' => "DEFAULT 0 COMMENT 'If true, include registration link on Event Info page.'", + 'is_monetary' => "DEFAULT 0 COMMENT 'If true, one or more fee amounts must be set and a Payment Processor must be configured for Online Event Registration.'", + 'is_map' => "DEFAULT 0 COMMENT 'Include a map block on the Event Information page when geocode info is available and a mapping provider has been specified?'", + 'is_active' => "DEFAULT 0 COMMENT 'Is this Event enabled or disabled/cancelled?'", + 'is_show_location' => "DEFAULT 1 COMMENT 'If true, show event location.'", + 'is_email_confirm' => "DEFAULT 0 COMMENT 'If true, confirmation is automatically emailed to contact on successful registration.'", + 'is_pay_later' => "DEFAULT 0 COMMENT 'if true - allows the user to send payment directly to the org later'", + 'is_partial_payment' => "DEFAULT 0 COMMENT 'is partial payment enabled for this event'", + 'is_multiple_registrations' => "DEFAULT 0 COMMENT 'if true - allows the user to register multiple participants for event'", + 'allow_same_participant_emails' => "DEFAULT 0 COMMENT 'if true - allows the user to register multiple registrations from same email address.'", + 'has_waitlist' => "DEFAULT 0 COMMENT 'Whether the event has waitlist support.'", + 'requires_approval' => "DEFAULT 0 COMMENT 'Whether participants require approval before they can finish registering.'", + 'allow_selfcancelxfer' => "DEFAULT 0 COMMENT 'Allow self service cancellation or transfer for event?'", + 'is_template' => "DEFAULT 0 COMMENT 'whether the event has template'", + 'is_share' => "DEFAULT 1 COMMENT 'Can people share the event through social media?'", + 'is_confirm_enabled' => "DEFAULT 1 COMMENT 'If false, the event booking confirmation screen gets skipped'", + 'is_billing_required' => "DEFAULT 0 COMMENT 'if true than billing block is required this event'", + ], + 'civicrm_event_carts' => [ + 'completed' => "DEFAULT 0", + ], + 'civicrm_participant' => [ + 'is_test' => "DEFAULT 0", + 'is_pay_later' => "DEFAULT 0", + ], + 'civicrm_participant_status_type' => [ + 'is_reserved' => "DEFAULT 0 COMMENT 'whether this is a status type required by the system'", + 'is_active' => "DEFAULT 1 COMMENT 'whether this status type is active'", + 'is_counted' => "DEFAULT 0 COMMENT 'whether this status type is counted against event size limit'", + ], +]; diff --git a/xml/schema/Event/Cart/Cart.xml b/xml/schema/Event/Cart/Cart.xml index 5aae1932b0..a7884aee2b 100644 --- a/xml/schema/Event/Cart/Cart.xml +++ b/xml/schema/Event/Cart/Cart.xml @@ -37,6 +37,7 @@ Complete? boolean 0 + true 4.1 diff --git a/xml/schema/Event/Participant.xml b/xml/schema/Event/Participant.xml index 7f0ce2367e..9247cbb441 100644 --- a/xml/schema/Event/Participant.xml +++ b/xml/schema/Event/Participant.xml @@ -172,6 +172,7 @@ Test boolean 0 + true true 1.7 @@ -181,6 +182,7 @@ Is Pay Later boolean 0 + true true /(is.)?(pay(.)?later)$/i 2.1 diff --git a/xml/schema/Event/ParticipantStatusType.xml b/xml/schema/Event/ParticipantStatusType.xml index 9df2ce9c1c..5899eafec9 100644 --- a/xml/schema/Event/ParticipantStatusType.xml +++ b/xml/schema/Event/ParticipantStatusType.xml @@ -62,6 +62,8 @@ Participant Status Is Reserved?> boolean whether this is a status type required by the system + 0 + true 3.0 @@ -70,6 +72,8 @@ boolean 1 whether this status type is active + 0 + true 3.0 @@ -77,6 +81,8 @@ Participant Status Counts? boolean whether this status type is counted against event size limit + 0 + true 3.0 -- 2.25.1