diff --git a/CRM/Grant/BAO/Grant.php b/CRM/Grant/BAO/Grant.php index 7a669d599e6b..5fe5e2b1c9c6 100644 --- a/CRM/Grant/BAO/Grant.php +++ b/CRM/Grant/BAO/Grant.php @@ -34,12 +34,6 @@ */ class CRM_Grant_BAO_Grant extends CRM_Grant_DAO_Grant { - /** - * Static field for all the grant information that we can potentially export. - * @var array - */ - static $_exportableFields = NULL; - /** * Class constructor. */ @@ -346,54 +340,19 @@ public static function del($id) { * array of exportable Fields */ public static function &exportableFields() { - if (!self::$_exportableFields) { - if (!self::$_exportableFields) { - self::$_exportableFields = array(); - } - - $grantFields = array( - 'grant_status' => array( - 'title' => ts('Grant Status'), - 'name' => 'grant_status', - 'data_type' => CRM_Utils_Type::T_STRING, - ), - 'grant_type' => array( - 'title' => ts('Grant Type'), - 'name' => 'grant_type', - 'data_type' => CRM_Utils_Type::T_STRING, - ), - 'grant_money_transfer_date' => array( - 'title' => ts('Grant Money Transfer Date'), - 'name' => 'grant_money_transfer_date', - 'data_type' => CRM_Utils_Type::T_DATE, - ), - 'grant_amount_requested' => array( - 'title' => ts('Grant Amount Requested'), - 'name' => 'grant_amount_requested', - 'data_type' => CRM_Utils_Type::T_FLOAT, - ), - 'grant_application_received_date' => array( - 'title' => ts('Grant Application Received Date'), - 'name' => 'grant_application_received_date', - 'data_type' => CRM_Utils_Type::T_DATE, - ), - ); - - $fields = CRM_Grant_DAO_Grant::export(); - $grantNote = array( - 'grant_note' => array( - 'title' => ts('Grant Note'), - 'name' => 'grant_note', - 'data_type' => CRM_Utils_Type::T_TEXT, - ), - ); - $fields = array_merge($fields, $grantFields, $grantNote, - CRM_Core_BAO_CustomField::getFieldsForImport('Grant') - ); - self::$_exportableFields = $fields; - } + $fields = CRM_Grant_DAO_Grant::export(); + $grantNote = array( + 'grant_note' => array( + 'title' => ts('Grant Note'), + 'name' => 'grant_note', + 'data_type' => CRM_Utils_Type::T_TEXT, + ), + ); + $fields = array_merge($fields, $grantNote, + CRM_Core_BAO_CustomField::getFieldsForImport('Grant') + ); - return self::$_exportableFields; + return $fields; } /** diff --git a/CRM/Grant/DAO/Grant.php b/CRM/Grant/DAO/Grant.php index 979a767c3add..329a05259b71 100644 --- a/CRM/Grant/DAO/Grant.php +++ b/CRM/Grant/DAO/Grant.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Grant/Grant.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:600fc71093543f1c7b31ad663f2325c6) + * (GenCodeChecksum:13652dd0ca88b2b29b17df240790eece) */ /** @@ -205,14 +205,19 @@ public static function &fields() { 'type' => CRM_Utils_Type::T_DATE, 'title' => ts('Application received date'), 'description' => 'Date on which grant application was received by donor.', - 'export' => TRUE, + 'import' => TRUE, 'where' => 'civicrm_grant.application_received_date', 'headerPattern' => '', 'dataPattern' => '', + 'export' => TRUE, 'table_name' => 'civicrm_grant', 'entity' => 'Grant', 'bao' => 'CRM_Grant_BAO_Grant', 'localizable' => 0, + 'html' => [ + 'type' => 'Select Date', + 'formatType' => 'activityDate', + ], ], 'decision_date' => [ 'name' => 'decision_date', @@ -230,6 +235,7 @@ public static function &fields() { 'localizable' => 0, 'html' => [ 'type' => 'Select Date', + 'formatType' => 'activityDate', ], ], 'grant_money_transfer_date' => [ @@ -248,6 +254,7 @@ public static function &fields() { 'localizable' => 0, 'html' => [ 'type' => 'Select Date', + 'formatType' => 'activityDate', ], ], 'grant_due_date' => [ @@ -255,12 +262,18 @@ public static function &fields() { 'type' => CRM_Utils_Type::T_DATE, 'title' => ts('Grant Due Date'), 'description' => 'Date on which grant report is due.', + 'import' => TRUE, + 'where' => 'civicrm_grant.grant_due_date', + 'headerPattern' => '', + 'dataPattern' => '', + 'export' => TRUE, 'table_name' => 'civicrm_grant', 'entity' => 'Grant', 'bao' => 'CRM_Grant_BAO_Grant', 'localizable' => 0, 'html' => [ 'type' => 'Select Date', + 'formatType' => 'activityDate', ], ], 'grant_report_received' => [ diff --git a/xml/schema/Grant/Grant.xml b/xml/schema/Grant/Grant.xml index 9a9d3096b82c..9d09f0c13c13 100644 --- a/xml/schema/Grant/Grant.xml +++ b/xml/schema/Grant/Grant.xml @@ -45,8 +45,13 @@ Application received date date true + true Date on which grant application was received by donor. 1.8 + + Select Date + activityDate + decision_date @@ -57,6 +62,7 @@ 1.8 Select Date + activityDate @@ -69,6 +75,7 @@ 1.8 Select Date + activityDate @@ -77,8 +84,10 @@ Grant Due Date Date on which grant report is due. 1.8 + true Select Date + activityDate