[Bug 43744] New: Make report object available when running report with template
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43744 Bug ID: 43744 Summary: Make report object available when running report with template Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Reports Assignee: koha-bugs@lists.koha-community.org Reporter: andrew@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org CC: lisette@bywatersolutions.com Depends on: 34136 Target Milestone: --- When using a template to display report data, it would be helpful to be able to put data about the report itself into the template. The use case that comes immediately to mind is being able to include the report title -- currently running a report with a template causes the title to disappear. In some cases this is desired -- like when using a template to render letters to be printed and mailed to patrons. In other cases, staff could like to see that title to know which report they're looking at. If we passed the report object to GetPreparedLetter when rendering the template, one could use [% report.report_name %] in the template. It seems possible folks would come up with uses for displaying other bits of the report object, too, like the SQL query or the notes field. Being able to include any runtime parameter values in the template would also be useful, but seems more involved. Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34136 [Bug 34136] Add ability to render a report using a notice template -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43744 Olivia Reynolds <olivia.reynolds@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |olivia.reynolds@openfifth.c | |o.uk Assignee|koha-bugs@lists.koha-commun |olivia.reynolds@openfifth.c |ity.org |o.uk -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43744 Olivia Reynolds <olivia.reynolds@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch Status|NEW |Needs Signoff Sponsorship status|--- |Sponsored Comma delimited| |Open Fifth list of Sponsors| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43744 --- Comment #1 from Olivia Reynolds <olivia.reynolds@openfifth.co.uk> --- Created attachment 207393 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=207393&action=edit Bug 43744: Make the invoking report accessible in templates This patch adds support for fetching from the reports table to GetPreparedLetter, and uses this new functionality to make the relevant report available to the template as the "report" variable. Test plan: 1. Under Tools > Notices and Slips, create a notice in the Reports module. Choose a code and a name, and use "[% report.report_name %]" as the print *and* email body. 2. Under Reports, create a new report from SQL with a name and the following query: SELECT 1 AS borrowernumber, 'to@example.com' AS email; 4. Run this report with the template created earlier, and verify there is no output. 5. From the base of Koha, run the following command, replacing CODE with the notice code created earlier, and the ID with the report ID created earlier: misc/cronjobs/patron_emailer.pl -module report -from from@example.com -notice CODE -report ID 6. Verify that the email is generated successfully, and that there is no output from the template. 7. Apply patch. 8. Repeat steps 4-6, and verify both instances of template output now display the name of the report you're using to run it. Sponsored-by: Open Fifth -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43744 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |43736 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43736 [Bug 43736] Reports should allow use of any format when rendering with a template -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43744 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43744 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #207393|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43744 --- Comment #2 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 207400 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=207400&action=edit Bug 43744: Make the invoking report accessible in templates This patch adds support for fetching from the reports table to GetPreparedLetter, and uses this new functionality to make the relevant report available to the template as the "report" variable. Test plan: 1. Under Tools > Notices and Slips, create a notice in the Reports module. Choose a code and a name, and use "[% report.report_name %]" as the print *and* email body. 2. Under Reports, create a new report from SQL with a name and the following query: SELECT 1 AS borrowernumber, 'to@example.com' AS email; 4. Run this report with the template created earlier, and verify there is no output. 5. From the base of Koha, run the following command, replacing CODE with the notice code created earlier, and the ID with the report ID created earlier: misc/cronjobs/patron_emailer.pl -module report -from from@example.com -notice CODE -report ID 6. Verify that the email is generated successfully, and that there is no output from the template. 7. Apply patch. 8. Repeat steps 4-6, and verify both instances of template output now display the name of the report you're using to run it. Sponsored-by: Open Fifth Signed-off-by: Barbara Johnson <Barbara.Johnson@bedfordtx.gov> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43744 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA QA Contact|testopia@bugs.koha-communit |andrew@bywatersolutions.com |y.org | --- Comment #3 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Can you please add some POD coverage here? [FAIL] C4/Reports/Guided.pm FAIL pod_coverage sub _build_query has no pod coverage. sub _get_display_value has no pod coverage. sub _get_columns has no pod coverage. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43744 --- Comment #4 from Olivia Reynolds <olivia.reynolds@openfifth.co.uk> --- Thanks for spotting that. I'm pretty sure those are all false alarms - this patch only touches `sub EmailReport` in that file. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43744 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Signed Off --- Comment #5 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- (In reply to Olivia Reynolds from comment #4)
Thanks for spotting that. I'm pretty sure those are all false alarms - this patch only touches `sub EmailReport` in that file.
Oop, you are correct, my apologies :) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43744 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43744 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #207400|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43744 --- Comment #6 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 207408 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=207408&action=edit Bug 43744: Make the invoking report accessible in templates This patch adds support for fetching from the reports table to GetPreparedLetter, and uses this new functionality to make the relevant report available to the template as the "report" variable. Test plan: 1. Under Tools > Notices and Slips, create a notice in the Reports module. Choose a code and a name, and use "[% report.report_name %]" as the print *and* email body. 2. Under Reports, create a new report from SQL with a name and the following query: SELECT 1 AS borrowernumber, 'to@example.com' AS email; 4. Run this report with the template created earlier, and verify there is no output. 5. From the base of Koha, run the following command, replacing CODE with the notice code created earlier, and the ID with the report ID created earlier: misc/cronjobs/patron_emailer.pl -module report -from from@example.com -notice CODE -report ID 6. Verify that the email is generated successfully, and that there is no output from the template. 7. Apply patch. 8. Repeat steps 4-6, and verify both instances of template output now display the name of the report you're using to run it. Sponsored-by: Open Fifth Signed-off-by: Barbara Johnson <Barbara.Johnson@bedfordtx.gov> Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org