We should have plugin hooks for the staff interface just like we have for the OPAC as detailed on bug 20181.
Created attachment 78877 [details] [review] Bug 21352: Allow plugins to add CSS and Javascript to Staff interface We should have plugin hooks for the staff interface just like we have for the OPAC as detailed on bug 20181. Test Plan: 1) Apply this patch 2) Download and install the Kitchen Sink plugin ( v2.1.19 or later ) https://github.com/bywatersolutions/koha-plugin-kitchen-sink/releases/download/v2.1.19/koha-plugin-kitchen-sink-v2.1.19.kpz 3) Install the plugin 4) Restart all the things if you can ( restart_all if you are using kohadevbox ) This will ensure the plugin takes effect right away, it should be necessary but it won't hurt anything! 5) Load the opac, notice you get an alert message and the background for your opac is now orange ( assuming you've not customized the opac in any way ) https://bugs.koha-community.org/show_bug.cgi?id=13692
Super excited for enhancements to plugins! I'm hoping to look at this later today. I was curious though about the order in which the plugin CSS/JS is applied. I'm guessing it's based on the order that plugins have been loaded into Koha? (I seem to recall Kyle and Andreas talking a bit at Kohacon about a way to specify order/priority but maybe I misheard what that was about.)
I think this plugin and test plan might be for the OPAC rather than the staff client? Even on the OPAC, it's escaping the angle brackets so it just prints the CSS out as text. The HTML source looks like this: <style> body { background-color: orange; } </style>
(In reply to David Cook from comment #3) > I think this plugin and test plan might be for the OPAC rather than the > staff client? > > Even on the OPAC, it's escaping the angle brackets so it just prints the CSS > out as text. > > The HTML source looks like this: > > <style> > body { > background-color: orange; > } > </style> Sounds like a regression. You are right about the test plan. It should say intranet, not opac.
Created attachment 79185 [details] [review] Bug 21352: Allow plugins to add CSS and Javascript to Staff interface We should have plugin hooks for the staff interface just like we have for the OPAC as detailed on bug 20181. Test Plan: 1) Apply this patch 2) Download and install the Kitchen Sink plugin ( v2.1.19 or later ) https://github.com/bywatersolutions/koha-plugin-kitchen-sink/releases/download/v2.1.19/koha-plugin-kitchen-sink-v2.1.19.kpz 3) Install the plugin 4) Restart all the things if you can ( restart_all if you are using kohadevbox ) This will ensure the plugin takes effect right away, it should be necessary but it won't hurt anything! 5) Load the staff intranet, notice you get an alert message and the background for your staff intranet is now orange ( assuming you've not customized the staff intranet in any way )
Created attachment 79186 [details] [review] Bug 21352: Use the raw filter for plugin hooks, both opac and staff side
Upping bug severity as followup contains a bug fix.
*** Bug 17490 has been marked as a duplicate of this bug. ***
*** Bug 17491 has been marked as a duplicate of this bug. ***
Created attachment 79440 [details] [review] Bug 21352: Allow plugins to add CSS and Javascript to Staff interface We should have plugin hooks for the staff interface just like we have for the OPAC as detailed on bug 20181. Test Plan: 1) Apply this patch 2) Download and install the Kitchen Sink plugin ( v2.1.19 or later ) https://github.com/bywatersolutions/koha-plugin-kitchen-sink/releases/download/v2.1.19/koha-plugin-kitchen-sink-v2.1.19.kpz 3) Install the plugin 4) Restart all the things if you can ( restart_all if you are using kohadevbox ) This will ensure the plugin takes effect right away, it should be necessary but it won't hurt anything! 5) Load the staff intranet, notice you get an alert message and the background for your staff intranet is now orange ( assuming you've not customized the staff intranet in any way ) Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Created attachment 79441 [details] [review] Bug 21352: Use the raw filter for plugin hooks, both opac and staff side Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Hi Kyle, I've tried this, but I don't see the effect in the staff client as described. Can you please check the plugin and if it still works for you? Installed the plugin from the URl given and restarted everything mulitple times: https://github.com/bywatersolutions/koha-plugin-kitchen-sink/releases/download/v2.1.19/koha-plugin-kitchen-sink-v2.1.19.kpz
(In reply to Katrin Fischer from comment #12) > Hi Kyle, > I've tried this, but I don't see the effect in the staff client as > described. > Can you please check the plugin and if it still works for you? > > Installed the plugin from the URl given and restarted everything mulitple > times: > > https://github.com/bywatersolutions/koha-plugin-kitchen-sink/releases/ > download/v2.1.19/koha-plugin-kitchen-sink-v2.1.19.kpz I had the same experience.
Created attachment 79754 [details] [review] Bug 21352: Allow plugins to add CSS and Javascript to Staff interface We should have plugin hooks for the staff interface just like we have for the OPAC as detailed on bug 20181. Test Plan: 1) Apply this patch 2) Download and install the Kitchen Sink plugin ( v2.1.19 or later ) https://github.com/bywatersolutions/koha-plugin-kitchen-sink/releases/download/v2.1.19/koha-plugin-kitchen-sink-v2.1.19.kpz 3) Install the plugin 4) Restart all the things if you can ( restart_all if you are using kohadevbox ) This will ensure the plugin takes effect right away, it should be necessary but it won't hurt anything! 5) Load the staff intranet, notice you get an console error log message and the background for your staff intranet is now orange ( assuming you've not customized the staff intranet in any way ) Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Created attachment 79755 [details] [review] Bug 21352: Use the raw filter for plugin hooks, both opac and staff side Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Created attachment 79756 [details] [review] Bug 21352: Add missing USE statements
Created attachment 79873 [details] [review] Bug 21352: Allow plugins to add CSS and Javascript to Staff interface We should have plugin hooks for the staff interface just like we have for the OPAC as detailed on bug 20181. Test Plan: 1) Apply this patch 2) Download and install the Kitchen Sink plugin ( v2.1.19 or later ) https://github.com/bywatersolutions/koha-plugin-kitchen-sink/releases/download/v2.1.19/koha-plugin-kitchen-sink-v2.1.19.kpz 3) Install the plugin 4) Restart all the things if you can ( restart_all if you are using kohadevbox ) This will ensure the plugin takes effect right away, it should be necessary but it won't hurt anything! 5) Load the staff intranet, notice you get an console error log message and the background for your staff intranet is now orange ( assuming you've not customized the staff intranet in any way ) Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 79875 [details] [review] Bug 21352: Use the raw filter for plugin hooks, both opac and staff side Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 79876 [details] [review] Bug 21352: Add missing USE statements Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Awesome work all! Pushed to master for 18.11
Pushed to 18.05.x for 18.05.05. As per my policy of backporting invisible Plugin and API enhancements that allow plugin authors to support a broader range of Koha versions I have backported this work too.
(In reply to Martin Renvoize from comment #21) > Pushed to 18.05.x for 18.05.05. > > As per my policy of backporting invisible Plugin and API enhancements that > allow plugin authors to support a broader range of Koha versions I have > backported this work too. Thanks Martin!
Bug 21352
I've decided to backport to 17.11.x, this is very useful and not risky. Pushed to 17.11.x for 17.11.11
*** Bug 21016 has been marked as a duplicate of this bug. ***