Schema - Fix boolean fields in 'Event'
authorMonish Deb <monish.deb@jmaconsulting.biz>
Fri, 8 Apr 2022 01:12:16 +0000 (18:12 -0700)
committerTim Otten <totten@civicrm.org>
Fri, 8 Apr 2022 01:12:16 +0000 (18:12 -0700)
CRM/Event/Cart/DAO/Cart.php
CRM/Event/DAO/Participant.php
CRM/Event/DAO/ParticipantStatusType.php
CRM/Upgrade/Incremental/php/FiveFortyNine/Event.bool.php [new file with mode: 0644]
xml/schema/Event/Cart/Cart.xml
xml/schema/Event/Participant.xml
xml/schema/Event/ParticipantStatusType.xml

index e5998e753208a4295a4a7d01b51c5149e58ea37d..9f9ff821031e71a707e186893bd452759e8fddf2 100644 (file)
@@ -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',
index 6a4624cf812000b96df858bba0f9d806e4f58345..bc2325233220f14095f917e0287726c32fc80a3d 100644 (file)
@@ -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',
index bdb75e0e43cabb7f7939c0e0d136b9e033ff13ec..160c3f56b1fa23af7ab7e38a77cc0f66d524da16 100644 (file)
@@ -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 (file)
index 0000000..3e17cfa
--- /dev/null
@@ -0,0 +1,36 @@
+<?php
+return [
+    // No change in DAO?
+  'civicrm_event' => [
+    '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'",
+  ],
+];
index 5aae1932b05ae97239493d8ab60a2ae463d15e97..a7884aee2b6f7d09074993a8151f794c5f13d6be 100644 (file)
@@ -37,6 +37,7 @@
     <title>Complete?</title>
     <type>boolean</type>
     <default>0</default>
+    <required>true</required>
     <add>4.1</add>
   </field>
   <foreignKey>
index 7f0ce2367eba202aa9fb0484f0277a19e7a913f5..9247cbb44191df73be50e0b40f9c941266051ea7 100644 (file)
     <title>Test</title>
     <type>boolean</type>
     <default>0</default>
+    <required>true</required>
     <import>true</import>
     <add>1.7</add>
   </field>
     <title>Is Pay Later</title>
     <type>boolean</type>
     <default>0</default>
+    <required>true</required>
     <import>true</import>
     <headerPattern>/(is.)?(pay(.)?later)$/i</headerPattern>
     <add>2.1</add>
index 9df2ce9c1c79943d664eaa85e2808bdd72551492..5899eafec9b324a1f5695b92b06068c5512c379f 100644 (file)
@@ -62,6 +62,8 @@
     <title>Participant Status Is Reserved?></title>
     <type>boolean</type>
     <comment>whether this is a status type required by the system</comment>
+    <default>0</default>
+    <required>true</required>
     <add>3.0</add>
   </field>
   <field>
@@ -70,6 +72,8 @@
     <type>boolean</type>
     <default>1</default>
     <comment>whether this status type is active</comment>
+    <default>0</default>
+    <required>true</required>
     <add>3.0</add>
   </field>
   <field>
@@ -77,6 +81,8 @@
     <title>Participant Status Counts?</title>
     <type>boolean</type>
     <comment>whether this status type is counted against event size limit</comment>
+    <default>0</default>
+    <required>true</required>
     <add>3.0</add>
   </field>
   <field>