jethro-pmm
jethro-pmm copied to clipboard
Document merge enhancements
I have just updated my test environment to version 2.31.1 after applying changes I have made in my system.
Most of my 'hacks' are related to document merge. In due course I will construct a pull request when I apply these in my development environment. I will list my changes here. Some of them are not in a suitable state for the 'real world' yet. call_document_merge.class.php
- If the passed template is a .html I display the data using print_r - this enables me to see what template variables are available - not very user friendly in this form!
- For a person query, include 'extended' items (eg a list of groups) which are generated for the query. Currently only works if 'Person ID' is one of the selected fields for the report.
- Replace newlines with spaces in strings call_document_merge_rosters.class.php
- Provide a 'role_cr' field which for some document type (ODS and ODT) inserts the correct code to make each item go to a new line (carriage return and/or new line does not work inside a document) bulk_actions.template.php
- Pass the queryid to document_merge view_6_attendance__2_display.class.php
- The attendance figures are passed to document_merge_rosters in a different, more efficient way
In addition I believe I should turn document_merge around so it gets it's primary data and sequence from the query and then tacks person/family data to that. I currently use a hack of the printCSV process that requires the query to include 'person ID'. I need to modify printCSV so it can return an array which is keyed on person/family ID
I have made significant progress on this. Incorporates the latest version of TBS which is compatible with PHP 8.1
A pull request would be great :)
Re
In addition I believe I should turn document_merge around so it gets it's primary data and sequence from the query and then tacks person/family data to that. I currently use a hack of the printCSV process that requires the query to include 'person ID'. I need to modify printCSV so it can return an array which is keyed on person/family ID
Document merge isn't always triggered from a report/query - bulk actions can also be launched from various other places where persons are listed. Also, the user may tick some persons but not others in the list.
Not ready for the pull request just yet - hopefully next week or maybe the one after.
I think I may have already worked out that it needs to be driven by the tick list and that's how the revised code continues to work.
I'm using PersonQuery (don't have the code in front of me) to get the query data. The options in the GetResults function are now 'html', 'csv' and 'array'. 'array' returns the data as an array - based closely on the 'csv' function.
I have added a debug (maybe [data] dump would be a better description) so people (including myself) can see all the available data and variables. I notice it includes things like notes and history - not sure about the security implications, unless PersonQuery already filters on that.
Anyhow, off to a men's retreat this weekend so doubt I'll get back to it before Monday.