diff --git a/CRM/Civigiftaid/DAO/BatchSettings.php b/CRM/Civigiftaid/DAO/BatchSettings.php index ade650c..f8021b0 100644 --- a/CRM/Civigiftaid/DAO/BatchSettings.php +++ b/CRM/Civigiftaid/DAO/BatchSettings.php @@ -4,9 +4,9 @@ * @package CRM * @copyright CiviCRM LLC (c) 2004-2019 * - * Generated from xml/schema/CRM/Civigiftaid/BatchSettings.xml + * Generated from /home/dev/civicrm/civicrm-buildkit/build/dmaster/sites/default/files/civicrm/ext/uk.co.compucorp.civicrm.giftaid/xml/schema/CRM/Civigiftaid/BatchSettings.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:03e9148920c213359a8b1d1335dfc451) + * (GenCodeChecksum:9707560ffca052f1c10410999475dccd) */ /** @@ -31,14 +31,14 @@ class CRM_Civigiftaid_DAO_BatchSettings extends CRM_Core_DAO { /** * Unique BatchSettings ID * - * @var int unsigned + * @var int */ public $id; /** * FK to Batch * - * @var int unsigned + * @var int */ public $batch_id; @@ -52,14 +52,14 @@ class CRM_Civigiftaid_DAO_BatchSettings extends CRM_Core_DAO { /** * Globally enabled for this batch * - * @var boolean + * @var bool */ public $globally_enabled; /** * Basic rate tax for the batch. * - * @var decimal(4,2) + * @var float */ public $basic_rate_tax; @@ -97,7 +97,7 @@ public static function &fields() { 'id' => [ 'name' => 'id', 'type' => CRM_Utils_Type::T_INT, - 'description' => ts('Unique BatchSettings ID'), + 'description' => CRM_Civigiftaid_ExtensionUtil::ts('Unique BatchSettings ID'), 'required' => TRUE, 'where' => 'civicrm_civigiftaid_batchsettings.id', 'table_name' => 'civicrm_civigiftaid_batchsettings', @@ -108,19 +108,18 @@ public static function &fields() { 'batch_id' => [ 'name' => 'batch_id', 'type' => CRM_Utils_Type::T_INT, - 'description' => ts('FK to Batch'), + 'description' => CRM_Civigiftaid_ExtensionUtil::ts('FK to Batch'), 'where' => 'civicrm_civigiftaid_batchsettings.batch_id', 'table_name' => 'civicrm_civigiftaid_batchsettings', 'entity' => 'BatchSettings', 'bao' => 'CRM_Civigiftaid_DAO_BatchSettings', 'localizable' => 0, - 'FKClassName' => 'CRM_Batch_DAO_Batch', ], 'financial_types_enabled' => [ 'name' => 'financial_types_enabled', 'type' => CRM_Utils_Type::T_TEXT, - 'title' => ts('Financial Types Enabled'), - 'description' => ts('Financial type enabled for this batch'), + 'title' => CRM_Civigiftaid_ExtensionUtil::ts('Financial Types Enabled'), + 'description' => CRM_Civigiftaid_ExtensionUtil::ts('Financial type enabled for this batch'), 'where' => 'civicrm_civigiftaid_batchsettings.financial_types_enabled', 'table_name' => 'civicrm_civigiftaid_batchsettings', 'entity' => 'BatchSettings', @@ -130,8 +129,8 @@ public static function &fields() { 'globally_enabled' => [ 'name' => 'globally_enabled', 'type' => CRM_Utils_Type::T_BOOLEAN, - 'title' => ts('Globally Enabled'), - 'description' => ts('Globally enabled for this batch'), + 'title' => CRM_Civigiftaid_ExtensionUtil::ts('Globally Enabled'), + 'description' => CRM_Civigiftaid_ExtensionUtil::ts('Globally enabled for this batch'), 'where' => 'civicrm_civigiftaid_batchsettings.globally_enabled', 'table_name' => 'civicrm_civigiftaid_batchsettings', 'entity' => 'BatchSettings', @@ -140,9 +139,14 @@ public static function &fields() { ], 'basic_rate_tax' => [ 'name' => 'basic_rate_tax', - 'type' => CRM_Utils_Type::T_DECIMAL(4, 2), - 'title' => ts('Basic Rate Tax'), - 'description' => ts('Basic rate tax for the batch.'), + 'type' => CRM_Utils_Type::T_MONEY, + 'title' => CRM_Civigiftaid_ExtensionUtil::ts('Basic Rate Tax'), + 'description' => CRM_Civigiftaid_ExtensionUtil::ts('Basic rate tax for the batch.'), + 'required' => TRUE, + 'precision' => [ + 4, + 2, + ], 'where' => 'civicrm_civigiftaid_batchsettings.basic_rate_tax', 'table_name' => 'civicrm_civigiftaid_batchsettings', 'entity' => 'BatchSettings', diff --git a/sql/auto_install.sql b/sql/auto_install.sql new file mode 100644 index 0000000..a5e21df --- /dev/null +++ b/sql/auto_install.sql @@ -0,0 +1,96 @@ +-- +--------------------------------------------------------------------+ +-- | CiviCRM version 5 | +-- +--------------------------------------------------------------------+ +-- | Copyright CiviCRM LLC (c) 2004-2019 | +-- +--------------------------------------------------------------------+ +-- | This file is a part of CiviCRM. | +-- | | +-- | CiviCRM is free software; you can copy, modify, and distribute it | +-- | under the terms of the GNU Affero General Public License | +-- | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. | +-- | | +-- | CiviCRM is distributed in the hope that it will be useful, but | +-- | WITHOUT ANY WARRANTY; without even the implied warranty of | +-- | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | +-- | See the GNU Affero General Public License for more details. | +-- | | +-- | You should have received a copy of the GNU Affero General Public | +-- | License and the CiviCRM Licensing Exception along | +-- | with this program; if not, contact CiviCRM LLC | +-- | at info[AT]civicrm[DOT]org. If you have questions about the | +-- | GNU Affero General Public License or the licensing of CiviCRM, | +-- | see the CiviCRM license FAQ at http://civicrm.org/licensing | +-- +--------------------------------------------------------------------+ +-- +-- Generated from schema.tpl +-- DO NOT EDIT. Generated by CRM_Core_CodeGen +-- + + +-- +--------------------------------------------------------------------+ +-- | CiviCRM version 5 | +-- +--------------------------------------------------------------------+ +-- | Copyright CiviCRM LLC (c) 2004-2019 | +-- +--------------------------------------------------------------------+ +-- | This file is a part of CiviCRM. | +-- | | +-- | CiviCRM is free software; you can copy, modify, and distribute it | +-- | under the terms of the GNU Affero General Public License | +-- | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. | +-- | | +-- | CiviCRM is distributed in the hope that it will be useful, but | +-- | WITHOUT ANY WARRANTY; without even the implied warranty of | +-- | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | +-- | See the GNU Affero General Public License for more details. | +-- | | +-- | You should have received a copy of the GNU Affero General Public | +-- | License and the CiviCRM Licensing Exception along | +-- | with this program; if not, contact CiviCRM LLC | +-- | at info[AT]civicrm[DOT]org. If you have questions about the | +-- | GNU Affero General Public License or the licensing of CiviCRM, | +-- | see the CiviCRM license FAQ at http://civicrm.org/licensing | +-- +--------------------------------------------------------------------+ +-- +-- Generated from drop.tpl +-- DO NOT EDIT. Generated by CRM_Core_CodeGen +-- +-- /******************************************************* +-- * +-- * Clean up the exisiting tables +-- * +-- *******************************************************/ + +SET FOREIGN_KEY_CHECKS=0; + +DROP TABLE IF EXISTS `civicrm_civigiftaid_batchsettings`; + +SET FOREIGN_KEY_CHECKS=1; +-- /******************************************************* +-- * +-- * Create new tables +-- * +-- *******************************************************/ + +-- /******************************************************* +-- * +-- * civicrm_civigiftaid_batchsettings +-- * +-- * FIXME +-- * +-- *******************************************************/ +CREATE TABLE `civicrm_civigiftaid_batchsettings` ( + + + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Unique BatchSettings ID', + `batch_id` int unsigned COMMENT 'FK to Batch', + `financial_types_enabled` text COMMENT 'Financial type enabled for this batch', + `globally_enabled` tinyint COMMENT 'Globally enabled for this batch', + `basic_rate_tax` decimal(4,2) NOT NULL COMMENT 'Basic rate tax for the batch.' +, + PRIMARY KEY (`id`) + + +, CONSTRAINT FK_civicrm_civigiftaid_batchsettings_batch_id FOREIGN KEY (`batch_id`) REFERENCES `civicrm_batch`(`id`) ON DELETE CASCADE +) ; + + diff --git a/sql/auto_uninstall.sql b/sql/auto_uninstall.sql new file mode 100644 index 0000000..59f4082 --- /dev/null +++ b/sql/auto_uninstall.sql @@ -0,0 +1,38 @@ +-- +--------------------------------------------------------------------+ +-- | CiviCRM version 5 | +-- +--------------------------------------------------------------------+ +-- | Copyright CiviCRM LLC (c) 2004-2019 | +-- +--------------------------------------------------------------------+ +-- | This file is a part of CiviCRM. | +-- | | +-- | CiviCRM is free software; you can copy, modify, and distribute it | +-- | under the terms of the GNU Affero General Public License | +-- | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. | +-- | | +-- | CiviCRM is distributed in the hope that it will be useful, but | +-- | WITHOUT ANY WARRANTY; without even the implied warranty of | +-- | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | +-- | See the GNU Affero General Public License for more details. | +-- | | +-- | You should have received a copy of the GNU Affero General Public | +-- | License and the CiviCRM Licensing Exception along | +-- | with this program; if not, contact CiviCRM LLC | +-- | at info[AT]civicrm[DOT]org. If you have questions about the | +-- | GNU Affero General Public License or the licensing of CiviCRM, | +-- | see the CiviCRM license FAQ at http://civicrm.org/licensing | +-- +--------------------------------------------------------------------+ +-- +-- Generated from drop.tpl +-- DO NOT EDIT. Generated by CRM_Core_CodeGen +-- +-- /******************************************************* +-- * +-- * Clean up the exisiting tables +-- * +-- *******************************************************/ + +SET FOREIGN_KEY_CHECKS=0; + +DROP TABLE IF EXISTS `civicrm_civigiftaid_batchsettings`; + +SET FOREIGN_KEY_CHECKS=1; diff --git a/sql/upgrade_3000.sql b/sql/upgrade_3000.sql index e1ffed9..f6d063f 100644 --- a/sql/upgrade_3000.sql +++ b/sql/upgrade_3000.sql @@ -3,11 +3,11 @@ -- *******************************************************/ CREATE TABLE IF NOT EXISTS `civicrm_civigiftaid_batchsettings` ( - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Primary key.', - `batch_id` INT UNSIGNED COMMENT 'Foreign key for the batch in `civicrm_batch`.', - `financial_types_enabled` TEXT COMMENT 'Only enabled for selected financial types for the batch.', - `globally_enabled` TINYINT COMMENT 'Enabled for all financial types for the batch.', - `basic_rate_tax` DECIMAL(4,2) NOT NULL COMMENT 'Basic rate tax for the batch.', + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Unique BatchSettings ID', + `batch_id` int unsigned COMMENT 'FK to Batch', + `financial_types_enabled` text COMMENT 'Financial type enabled for this batch', + `globally_enabled` tinyint COMMENT 'Globally enabled for this batch', + `basic_rate_tax` decimal(4,2) NOT NULL COMMENT 'Basic rate tax for the batch.', PRIMARY KEY (`id`), CONSTRAINT FK_civicrm_civigiftaid_batchsettings_batch_id FOREIGN KEY (`batch_id`) REFERENCES `civicrm_batch` (`id`) ON DELETE CASCADE ) diff --git a/xml/schema/CRM/BatchSettings/BatchSettings.entityType.php b/xml/schema/CRM/Civigiftaid/BatchSettings.entityType.php similarity index 97% rename from xml/schema/CRM/BatchSettings/BatchSettings.entityType.php rename to xml/schema/CRM/Civigiftaid/BatchSettings.entityType.php index c84ef02..18c40a7 100644 --- a/xml/schema/CRM/BatchSettings/BatchSettings.entityType.php +++ b/xml/schema/CRM/Civigiftaid/BatchSettings.entityType.php @@ -2,7 +2,6 @@ // This file declares a new entity type. For more details, see "hook_civicrm_entityTypes" at: // http://wiki.civicrm.org/confluence/display/CRMDOC/Hook+Reference return [ - 0 => [ 'name' => 'BatchSettings', 'class' => 'CRM_Civigiftaid_DAO_BatchSettings', diff --git a/xml/schema/CRM/BatchSettings/BatchSettings.xml b/xml/schema/CRM/Civigiftaid/BatchSettings.xml similarity index 94% rename from xml/schema/CRM/BatchSettings/BatchSettings.xml rename to xml/schema/CRM/Civigiftaid/BatchSettings.xml index 0f713b7..0f605f8 100644 --- a/xml/schema/CRM/BatchSettings/BatchSettings.xml +++ b/xml/schema/CRM/Civigiftaid/BatchSettings.xml @@ -52,7 +52,9 @@ basic_rate_tax - decimal(4,2) + decimal + 4,2 + true Basic Rate Tax Basic rate tax for the batch. 4.4 diff --git a/xml/schema/CRM/BatchSettings/files.xml b/xml/schema/CRM/Civigiftaid/files.xml similarity index 66% rename from xml/schema/CRM/BatchSettings/files.xml rename to xml/schema/CRM/Civigiftaid/files.xml index 3c7d2a9..8c97dce 100644 --- a/xml/schema/CRM/BatchSettings/files.xml +++ b/xml/schema/CRM/Civigiftaid/files.xml @@ -1,5 +1,5 @@ - + \ No newline at end of file diff --git a/xml/schema/Schema.xml.inc b/xml/schema/Schema.xml.inc index 4ef445b..bfed30c 100644 --- a/xml/schema/Schema.xml.inc +++ b/xml/schema/Schema.xml.inc @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file