jethro-pmm
jethro-pmm copied to clipboard
Derived fields
Jethro currently has the concept of user defined fields, which is useful. In document merge I have found it useful to create derived/calculated fields. An example being a comma separated list of people on the roster for a particular role on the same date. It would make sense to push these into the database classes. Furthermore, particularly for person and family, there could be a call to a function in config.php to allow site specific calculated fields. A couple of examples I have in templates for contact list, which are quite unique to my installation, are
- a version of the family telephone number that does not allow mobile numbers
- a version of a person's mobile number that uses spaces instead of dashes
Can you give some more examples / use cases for what these would achieve? I'm not quite getting the need for this yet.
A couple of examples I have in templates for contact list, which are quite unique to my installation, are a version of the family telephone number that does not allow mobile numbers a version of a person's mobile number that uses spaces instead of dashes
See the system config page - you can edit the phone number formats to use spaces instead of dashes. And you could require home phone to be, for example, 8 digits beginning with a 9.
It sounds like you just want the data formatted differently? That's not really a "derived field" which implies some sort of calculation.
Point taken and the cases where lists (usually of people) separated by commas is probably not really a field that makes general sense. In that instance too, putting new lines instead of commas into a document requires some knowledge of how they are represented in that particular document type.
OK perhaps the better idea here is "special flavours of keywords for mail merge" ?