Bug 21016 - Plugins: Expand usage of opac_js method, or create intranet_js
Summary: Plugins: Expand usage of opac_js method, or create intranet_js
Status: RESOLVED DUPLICATE of bug 21352
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-06-29 09:54 UTC by Andrew Isherwood
Modified: 2022-11-07 10:37 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Isherwood 2018-06-29 09:54:48 UTC
There is an opac_js method which gives the opportunity for a plugin to return some Javascript to be embedded in the OPAC. I propose that we either make this method more generic, perhaps, plugin_js, so it can reasonably be used for JS for either the OPAC or intranet, or we add an intranet_js method for embedding JS in plugins that touch the staff client.

I suspect there's a use case for a plugin wanting to return different JS for the OPAC and staff client, so the latter idea might be preferable.

The inspiration for this proposal is the CLA Check Permissions plugin (Bug 20968), the current workflow is a bit clunky with the button on the Bib toolbar taking the user to a page generated by the plugin, on which the main Javascript is run, opening a modal. The plugin has no use for the additional page, but is necessary to run the Javascript. The proposal would allow us to run the Javascript directly in the Bib view, which would make for a better UX.
Comment 1 Kyle M Hall 2018-06-29 12:51:24 UTC
I would *definitely* say we would want separate intranet_js *AND* intranet_head methods to keep parity with the opac feature. It also makes sense to have separate methods instead of re-using the opac ones.
Comment 2 Julian Maurice 2019-01-09 14:14:05 UTC
Duplicate of bug 21352 ?
Comment 3 Kyle M Hall 2019-01-09 14:21:59 UTC
Definitely a duplicate!

*** This bug has been marked as a duplicate of bug 21352 ***