convert to using a civix-generated entity

This commit is contained in:
2019-08-19 17:48:04 -04:00
parent b27c080d18
commit 092cb2a184
9 changed files with 309 additions and 80 deletions

View File

@ -0,0 +1,11 @@
<?php
// 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 array (
0 =>
array (
'name' => 'GrantBudget',
'class' => 'CRM_AnnualGrantBudgets_DAO_GrantBudget',
'table' => 'civicrm_grant_budget',
),
);

View File

@ -0,0 +1,77 @@
<?xml version="1.0" encoding="iso-8859-1" ?>
<table>
<base>CRM/AnnualGrantBudgets</base>
<class>GrantBudget</class>
<name>civicrm_grant_budget</name>
<comment>FIXME</comment>
<log>true</log>
<field>
<name>id</name>
<type>int unsigned</type>
<required>true</required>
<comment>Unique GrantBudget ID</comment>
<localizable>true</localizable>
</field>
<primaryKey>
<name>id</name>
<autoincrement>true</autoincrement>
</primaryKey>
<field>
<name>financial_type_id</name>
<title>Financial Type Id</title>
<type>int unsigned</type>
<comment>FK to Financial Type</comment>
<required>true</required>
<import>true</import>
<export>false</export>
<localizable>false</localizable>
<pseudoconstant>
<table>civicrm_financial_type</table>
<keyColumn>id</keyColumn>
<labelColumn>name</labelColumn>
</pseudoconstant>
<html>
<type>Select</type>
</html>
</field>
<foreignKey>
<name>financial_type_id</name>
<table>civicrm_financial_type</table>
<key>id</key>
</foreignKey>
<field>
<name>fiscal_year</name>
<title>Fiscal Year</title>
<type>int unsigned</type>
<comment>Fiscal year</comment>
<required>true</required>
<import>true</import>
<export>false</export>
<localizable>false</localizable>
<pseudoconstant>
<callback>CRM_Grant_BAO_GrantBudget::getFiscalyear</callback>
</pseudoconstant>
<html>
<type>Select</type>
</html>
</field>
<field>
<name>budget</name>
<title>Grant Annual Budget</title>
<type>decimal</type>
<comment>Grant Annual Budget</comment>
<required>true</required>
<import>true</import>
<export>true</export>
<localizable>false</localizable>
<default>0.00</default>
<html>
<type>Text</type>
</html>
</field>
</table>