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.
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.
Duplicate of bug 21352 ?
Definitely a duplicate! *** This bug has been marked as a duplicate of bug 21352 ***