Details
-
Type: Improvement
-
Status: Done/Fixed
-
Priority: Trivial
-
Resolution: Fixed/Completed
-
Affects Version/s: 4.7
-
Fix Version/s: 4.7.9
-
Component/s: CiviContribute
-
Labels:
-
Documentation Required?:None
-
Funding Source:Contributed Code
Description
If you want to add an export format for financial batches, you have to patch core CiviCRM atm, because of these code fragments:
- https://github.com/civicrm/civicrm-core/blob/master/CRM/Batch/BAO/Batch.php#L596
- https://github.com/civicrm/civicrm-core/blob/master/CRM/Financial/BAO/ExportFormat.php#L77
I have a patch that removes the need to adapt these files if you want to add a new export format; I will create a PR in a moment.
If this patch is applied, you can create new export formats in an extension, by doing the following:
- Create a new class in the extension that inherits from ExportFormat, and implements generateExportQuery, makeExport, and getFileExtension. And optionally output.
- Implement civicrm_hook_buildForm to add the export format to the CRM_Financial_Form_Export form
- Create a custom template templates/CRM/Financial/Form/Search.tpl so that it shows your Export format.
It is a first try, maybe more simplifications are possible.