Bug 40827

Summary: Update plugin wrapper to include context for method="report"
Product: Koha Reporter: Lisette Scheer <lisette>
Component: Plugin architectureAssignee: Lisette Scheer <lisette>
Status: Pushed to main --- QA Contact: David Cook <dcook>
Severity: enhancement    
Priority: P5 - low CC: dcook
Version: unspecified   
Hardware: All   
OS: All   
GIT URL: Initiative type: ---
Sponsorship status: --- Comma delimited list of Sponsors:
Crowdfunding goal: 0 Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
This enhancement updates the plugin wrapper to include the reports menu and have the breadcrumbs list reports instead of admin or tools when method="report"
Version(s) released in:
25.11.00
Circulation function:
Bug Depends on: 31339    
Bug Blocks:    
Attachments: Bug 40827: Add context to plugin wrapper for report plugins
Bug 40827: Add context to plugin wrapper for report plugins

Description Lisette Scheer 2025-09-17 14:46:20 UTC
Update koha-tmpl/intranet-tmpl/prog/en/includes/wrapper-staff-tool-plugin.into include the reports menu and have the breadcrumbs list reports instead of admin/tools when method="report"
Comment 1 David Cook 2025-09-17 23:25:34 UTC
Makes sense. Having some regrets calling it "wrapper-staff-tool-plugin.inc" now heh.
Comment 2 Lisette Scheer 2025-10-20 17:22:53 UTC
Created attachment 188173 [details] [review]
Bug 40827: Add context to plugin wrapper for report plugins

This patch updates the plugin wrapper to include the reports menu and have the breadcrumbs list reports instead of admin or tools when method="report"

To Test:
1. Install the Kitchen Sink Plugin
2. Navigate to Reports->Report plugins->Run Report.
3. Observe the admin menu shows
4. Apply the patch
5. Repeat step 2
6. Observe the report menu shows and the breadcrumbs are for the report module.
7. Check that the tools and configuration show the appropriate tool/admin context.
Comment 3 David Cook 2025-10-27 01:37:29 UTC
The patch looks good at a glance, but the test plan doesn't work when using either the dev or non-dev Kitchen Sink Plugin v2.6.3. 

It looks like the templates are changed in the main branch, but not in a released version of the plugin.
Comment 4 David Cook 2025-10-27 01:46:43 UTC
That being said... I've hacked on my own plugin which uses the plugin wrapper and the change definitely works and it works well.

If you can provide an updated test plan and get someone to sign off, I can QA this. It's a good change.
Comment 5 David Cook 2025-10-27 01:47:19 UTC
Actually... this is such a small yet useful change... I think we might be able to leapfrog...
Comment 6 David Cook 2025-10-27 01:48:11 UTC
Created attachment 188454 [details] [review]
Bug 40827: Add context to plugin wrapper for report plugins

This patch updates the plugin wrapper to include the reports menu and have the breadcrumbs list reports instead of admin or tools when method="report"

To Test:
1. Install the Kitchen Sink Plugin
2. Navigate to Reports->Report plugins->Run Report.
3. Observe the admin menu shows
4. Apply the patch
5. Repeat step 2
6. Observe the report menu shows and the breadcrumbs are for the report module.
7. Check that the tools and configuration show the appropriate tool/admin context.

Signed-off-by: David Cook <dcook@prosentient.com.au>
Comment 7 David Cook 2025-10-27 01:49:39 UTC
For people implementing this, you can pass the "method" via $template->{VARS}->{method} or you can hard-code it into your template like this:

[% WRAPPER "wrapper-staff-tool-plugin.inc" method="report" plugin_title="Kitchen Sink Plugin: Patron List" %]

They both work.
Comment 8 Lucas Gass (lukeg) 2025-11-03 21:16:31 UTC
Nice work everyone!

Pushed to main for 25.11