Bug 37033 - Allow plugins to load JavaScript on the cart pop-up in the staff interface
Summary: Allow plugins to load JavaScript on the cart pop-up in the staff interface
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Plugin architecture (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Lari Strand
QA Contact: Katrin Fischer
URL:
Keywords:
Depends on:
Blocks: 38740
  Show dependency treegraph
 
Reported: 2024-06-05 05:57 UTC by Lari Strand
Modified: 2024-12-18 11:36 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
24.11.00
Circulation function:


Attachments
Bug 37033: Plugin intranet_js won't load in Cart popup (intranet-bottom.inc missing) (872 bytes, patch)
2024-06-05 07:11 UTC, Lari Strand
Details | Diff | Splinter Review
Bug 37033: Plugin intranet_js won't load in Cart popup (intranet-bottom.inc missing) (922 bytes, patch)
2024-06-18 13:21 UTC, Owen Leonard
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Lari Strand 2024-06-05 05:57:51 UTC
We need to make a modification to the cart view and tried to create a plugin that injects javascript to the cart view. It won't get applied to cgi-bin/koha/basket/basket.pl since it's template is missing it's [% INCLUDE 'intranet-bottom.inc' %] which loads the plugin subs called intranet_js to the browser. I added the code to basket.tt and now the plugin's intranet_js gets applied to the view.

This issue may occur in similar popup views elsewhere in the Koha intranet too, where we have decided not to include the intranet-bottom.inc to the browser view. Should this ticket be made a generic one dealing with all similar occurences throughout Koha intranet (Z39.50 search for example)? Is there any downside for having the bottom bar in these views?
Comment 1 David Cook 2024-06-05 06:26:49 UTC
I imagine a case by case basis is all right.
Comment 2 Lari Strand 2024-06-05 06:31:18 UTC
It seems Z39.50 search is using  [% INCLUDE 'intranet-bottom.inc' popup_window=1 %] which allows the plugin js to be loaded with the view. I'll make a patch for cart/basket view using this.
Comment 3 Lari Strand 2024-06-05 07:11:14 UTC
Created attachment 167429 [details] [review]
Bug 37033: Plugin intranet_js won't load in Cart popup (intranet-bottom.inc missing)
Comment 4 Owen Leonard 2024-06-18 13:21:44 UTC
Created attachment 167844 [details] [review]
Bug 37033: Plugin intranet_js won't load in Cart popup (intranet-bottom.inc missing)

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 5 Katrin Fischer 2024-09-02 09:45:35 UTC
QA'd by RM. One line change.
Comment 6 Katrin Fischer 2024-09-02 10:21:21 UTC
Pushed for 24.11!

Well done everyone, thank you!