From 1e50c06c5bf1509049dbd6098e74eb001f293939 Mon Sep 17 00:00:00 2001 From: Civiware Solutions Date: Sat, 11 Aug 2018 22:13:08 +0530 Subject: [PATCH] updated code to use defined variable --- annualgrantbudgets.php | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/annualgrantbudgets.php b/annualgrantbudgets.php index 0ce55a2..aa59c59 100644 --- a/annualgrantbudgets.php +++ b/annualgrantbudgets.php @@ -3,6 +3,9 @@ require_once 'annualgrantbudgets.civix.php'; use CRM_Annualgrantbudgets_ExtensionUtil as E; +define('GRANT_SCHOLARSHIP_CUSTOM_GROUP', 'grant_scholarship'); +define('GRANT_SCHOLARSHIP_CUSTOM_FIELD', 'is_grant_scholarship'); +define('GRANT_SCHOLARSHIP_CUSTOM_TABLE_NAME', 'civicrm_value_grant_scholarship'); /** * Implements hook_civicrm_config(). * @@ -90,11 +93,11 @@ function annualgrantbudgets_civicrm_managed(&$entities) { _annualgrantbudgets_civix_civicrm_managed($entities); $entities[] = [ 'module' => 'org.agbu.annualgrantbudgets', - 'name' => 'grant_scholarship', + 'name' => GRANT_SCHOLARSHIP_CUSTOM_GROUP, 'entity' => 'CustomGroup', 'params' => [ 'version' => 3, - 'name' => 'grant_scholarship', + 'name' => GRANT_SCHOLARSHIP_CUSTOM_GROUP, 'title' => ts('Grant Scholarship'), 'extends' => 'FinancialType', 'style' => 'Inline', @@ -103,15 +106,16 @@ function annualgrantbudgets_civicrm_managed(&$entities) { 'is_multiple' => FALSE, 'collapse_adv_display' => FALSE, 'is_reserved' => TRUE, + 'table_name' => GRANT_SCHOLARSHIP_CUSTOM_TABLE_NAME, ], ]; $entities[] = [ 'module' => 'org.agbu.annualgrantbudgets', - 'name' => 'is_grant_scholarship', + 'name' => GRANT_SCHOLARSHIP_CUSTOM_FIELD, 'entity' => 'CustomField', 'params' => [ 'version' => 3, - 'name' => 'is_grant_scholarship', + 'name' => GRANT_SCHOLARSHIP_CUSTOM_FIELD, 'label' => ts('Scholarship?'), 'data_type' => 'Boolean', 'html_type' => 'Radio', @@ -121,8 +125,8 @@ function annualgrantbudgets_civicrm_managed(&$entities) { 'default_value' => '0', 'is_active' => TRUE, 'text_length' => 255, - 'column_name' => 'is_grant_scholarship', - 'custom_group_id' => 'grant_scholarship', + 'column_name' => GRANT_SCHOLARSHIP_CUSTOM_FIELD, + 'custom_group_id' => GRANT_SCHOLARSHIP_CUSTOM_GROUP, ], ]; }