tbar0970 / jethro-pmm

Jethro Pastoral Ministry Manager
GNU General Public License v3.0
35 stars 25 forks source link

Derived fields #915

Open tim-pearce opened 1 year ago

tim-pearce commented 1 year ago

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

tbar0970 commented 1 year ago

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.

tbar0970 commented 1 year ago

It sounds like you just want the data formatted differently? That's not really a "derived field" which implies some sort of calculation.

tim-pearce commented 1 year ago

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.

tbar0970 commented 1 year ago

OK perhaps the better idea here is "special flavours of keywords for mail merge" ?