Details
-
Type: Improvement
-
Status: Won't Do
-
Priority: Trivial
-
Resolution: Won't Do
-
Affects Version/s: 4.6.8
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
-
Versioning Impact:Patch (backwards-compatible bug fixes)
-
Documentation Required?:Developer Doc
-
Funding Source:Needs Funding
Description
I'm working my way to create custom message templates to export contributions.
The values passed to the template are defined by the _gatherMessageValues and _assignMessageVariablesToTemplate functions in CRM_Contribute_BAO_Contribution
I've noticed we're missing some needed elements in the templates, and i'm adding those needed. See:
https://issues.civicrm.org/jira/browse/CRM-17125
https://issues.civicrm.org/jira/browse/CRM-17106
https://issues.civicrm.org/jira/browse/CRM-17134
This starts to feel hacky in a way. It seems better to clean this up completely, and add more values in a structured way. However we probably should discuss what would be a good format of the values array, and how these should be passed to the template.
As a start i would suggest something like this.
$values = array( // the different contribution values 'softcontributions' => array of softcontributions, 'event' => if event, add event object 'event.participants' => participants of event 'memberships' => memberships );
Probably related could be to clean up the customfield format of an object, to return values in the same format as normal fields.