From 4cf1c728e14c833e0ad62a8b02f1023d102e4503 Mon Sep 17 00:00:00 2001 From: Jon Goldberg Date: Mon, 19 Aug 2019 17:59:58 -0400 Subject: [PATCH] add note and lock to entity definition --- CRM/AnnualGrantBudgets/DAO/GrantBudget.php | 52 ++++++++++++++++++- sql/auto_install.sql | 4 +- .../CRM/AnnualGrantBudgets/GrantBudget.xml | 29 +++++++++++ 3 files changed, 83 insertions(+), 2 deletions(-) diff --git a/CRM/AnnualGrantBudgets/DAO/GrantBudget.php b/CRM/AnnualGrantBudgets/DAO/GrantBudget.php index e1807a7..5a050f9 100644 --- a/CRM/AnnualGrantBudgets/DAO/GrantBudget.php +++ b/CRM/AnnualGrantBudgets/DAO/GrantBudget.php @@ -6,7 +6,7 @@ * * Generated from /home/jon/local/agbud8/htdocs/web/sites/all/civicrm/extensions/org.agbu.annualgrantbudgets/xml/schema/CRM/AnnualGrantBudgets/GrantBudget.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:7aad27e2f51ebfb640dd921e054f55c9) + * (GenCodeChecksum:36ad4daebed0e606747c4c8c53269a42) */ /** @@ -56,6 +56,20 @@ class CRM_AnnualGrantBudgets_DAO_GrantBudget extends CRM_Core_DAO { */ public $budget; + /** + * Note + * + * @var string + */ + public $note; + + /** + * Is this budget item locked for non-administrators? + * + * @var bool + */ + public $is_reserved; + /** * Class constructor. */ @@ -162,6 +176,42 @@ class CRM_AnnualGrantBudgets_DAO_GrantBudget extends CRM_Core_DAO { 'type' => 'Text', ], ], + 'note' => [ + 'name' => 'note', + 'type' => CRM_Utils_Type::T_STRING, + 'title' => CRM_AnnualGrantBudgets_ExtensionUtil::ts('Note'), + 'description' => CRM_AnnualGrantBudgets_ExtensionUtil::ts('Note'), + 'required' => FALSE, + 'maxlength' => 255, + 'size' => CRM_Utils_Type::HUGE, + 'import' => TRUE, + 'where' => 'civicrm_grant_budget.note', + 'export' => TRUE, + 'table_name' => 'civicrm_grant_budget', + 'entity' => 'GrantBudget', + 'bao' => 'CRM_AnnualGrantBudgets_DAO_GrantBudget', + 'localizable' => 1, + 'html' => [ + 'type' => 'Text', + ], + ], + 'is_reserved' => [ + 'name' => 'is_reserved', + 'type' => CRM_Utils_Type::T_BOOLEAN, + 'title' => CRM_AnnualGrantBudgets_ExtensionUtil::ts('Is Reserved'), + 'description' => CRM_AnnualGrantBudgets_ExtensionUtil::ts('Is this budget item locked for non-administrators?'), + 'import' => TRUE, + 'where' => 'civicrm_grant_budget.is_reserved', + 'export' => TRUE, + 'default' => '0', + 'table_name' => 'civicrm_grant_budget', + 'entity' => 'GrantBudget', + 'bao' => 'CRM_AnnualGrantBudgets_DAO_GrantBudget', + 'localizable' => 1, + 'html' => [ + 'type' => 'CheckBox', + ], + ], ]; CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']); } diff --git a/sql/auto_install.sql b/sql/auto_install.sql index 1c01d29..25bafb0 100644 --- a/sql/auto_install.sql +++ b/sql/auto_install.sql @@ -84,7 +84,9 @@ CREATE TABLE `civicrm_grant_budget` ( `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Unique ScholarshipBudget ID', `financial_type_id` int unsigned NOT NULL COMMENT 'FK to Financial Type', `fiscal_year` int unsigned NOT NULL COMMENT 'Fiscal year', - `budget` decimal(20,2) NOT NULL DEFAULT 0.00 COMMENT 'Scholarship Annual Budget' + `budget` decimal(20,2) NOT NULL DEFAULT 0.00 COMMENT 'Scholarship Annual Budget', + `note` varchar(255) NULL COMMENT 'Note', + `is_reserved` tinyint DEFAULT 0 COMMENT 'Is this budget item locked for non-administrators?' , PRIMARY KEY (`id`) diff --git a/xml/schema/CRM/AnnualGrantBudgets/GrantBudget.xml b/xml/schema/CRM/AnnualGrantBudgets/GrantBudget.xml index 9b12ca6..81da33a 100644 --- a/xml/schema/CRM/AnnualGrantBudgets/GrantBudget.xml +++ b/xml/schema/CRM/AnnualGrantBudgets/GrantBudget.xml @@ -74,4 +74,33 @@ Text + + + note + Note + varchar + 255 + Note + false + true + true + false + + Text + + + + + is_reserved + Is Reserved + boolean + Is this budget item locked for non-administrators? + true + true + false + 0 + + CheckBox + +