It would be beneficial to have an 'administrative' plugin type akin to 'tools' and 'reports' plugins. This would allow for adding an administrative plugin to the administration pages as opposed to having to expose it under tools.
Created attachment 162615 [details] [review] Bug 36206: Add 'admin' plugins option This patch adds an admin plugins class to the plugins system and displays such plugins under the 'Plugins' section in the Administration page.
There's a new branch on the crontab plugin to use to test this against.. I'll enlist those trialing it for me to test ;P
Created attachment 162639 [details] [review] Bug 36206: Expose administration page to users with plugins_admin permission This patch updates the intranet home page logic such that the administration button appears for those users with just the 'admin' subpermission of plugins to allow them to access such plugins. We also update the display logic found inside the admin-home page so that user see plugin management appropriately.
Created attachment 162640 [details] [review] Bug 36206: Add 'Run administration tool' to plugin actions This patch adds the new 'Run administration tool' option to the plugin actions dropdown menu for plugins with such a function.
Created attachment 162641 [details] [review] Bug 36206: Add 'Run administration tool' to plugin actions This patch adds the new 'Run administration tool' option to the plugin actions dropdown menu for plugins with such a function.
Currently this is easiest to test using the in-development crontab manager plugin, admin_plugin branch: https://github.com/PTFS-Europe/koha-plugin-crontab/tree/admin_plugin
(In reply to Martin Renvoize from comment #6) > Currently this is easiest to test using the in-development crontab manager > plugin, admin_plugin branch: > https://github.com/PTFS-Europe/koha-plugin-crontab/tree/admin_plugin Can't locate Config/Crontab.pm in @INC (you may need to install the Config::Cron tab module) sudo apt-get install libconfig-crontab-perl sudo sh install_plugins.sh No crontab found, installing default at /var/lib/koha/kohadev/koha-plugin-crontab/Koha/Plugin/Com/PTFSEurope/Crontab.pm line 140. Writing crontab: # This crontab file is managed by the Koha Crontab manager plugin # BLOCKID: 0 PERL5LIB=/usr/share/koha/lib KOHA_CRON_PATH=/usr/share/koha/bin/cronjobs KOHA_CONF=/etc/koha/sites/kohadev/koha-conf.xml Installed Crontab version {VERSION} All plugins successfully re-initialised
Sorry, mate, but I couldn't get this to work. Might be that I wasn't testing it correctly. Can you add a rock-solid test plan for it?
(In reply to David Cook from comment #7) > (In reply to Martin Renvoize from comment #6) > > Currently this is easiest to test using the in-development crontab manager > > plugin, admin_plugin branch: > > https://github.com/PTFS-Europe/koha-plugin-crontab/tree/admin_plugin > > Can't locate Config/Crontab.pm in @INC (you may need to install the > Config::Cron > tab module) > > sudo apt-get install libconfig-crontab-perl > > sudo sh install_plugins.sh > > No crontab found, installing default at > /var/lib/koha/kohadev/koha-plugin-crontab/Koha/Plugin/Com/PTFSEurope/Crontab. > pm line 140. > Writing crontab: # This crontab file is managed by the Koha Crontab manager > plugin > > # BLOCKID: 0 > PERL5LIB=/usr/share/koha/lib > KOHA_CRON_PATH=/usr/share/koha/bin/cronjobs > KOHA_CONF=/etc/koha/sites/kohadev/koha-conf.xml > Installed Crontab version {VERSION} > All plugins successfully re-initialised Yeah, I also have a work-in-progress branch that attempts to use Module::Load::Conditional to output a nicer warning in the UI when the library is missing... that or I'm considering bundling Config::Crontab into the plugin itself.. so far I've not come up with a nice solution for plugins that have cpan dependencies.. any idea's on a nice way to handle such cases would be awesome. Anyway, it looks like you managed to get there on the install and the default template was installed (it'll check for local crontab and load that, or it'll load a very basic template if one isn't found.. local crontab = whatever you may have added to a crontab using koha-shell for example.
Grr... attaching a plugin here is too large for Bugzilla!
Please use : https://github.com/PTFS-Europe/dev-koha-plugin-kitchen-sink/blob/admin/build/koha-plugin-kitchen-sink.kpz to test. The plugin can be installed as usual with this patchset applied to Koha. Once installed, it will appear on the administration page under 'Plugins' with the plugin name as the definition list title and the plugin description as the definition list definition. You should also be able to access the example admin page via the 'Manage plugins' page, from the 'actions' menu at the right side of the plugins table.
Created attachment 162779 [details] [review] Bug 36206: (follow-up) Change file permission
Created attachment 162780 [details] [review] Bug 36206: Add 'admin' plugins option This patch adds an admin plugins class to the plugins system and displays such plugins under the 'Plugins' section in the Administration page. Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Created attachment 162781 [details] [review] Bug 36206: Expose administration page to users with plugins_admin permission This patch updates the intranet home page logic such that the administration button appears for those users with just the 'admin' subpermission of plugins to allow them to access such plugins. We also update the display logic found inside the admin-home page so that user see plugin management appropriately. Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Created attachment 162782 [details] [review] Bug 36206: Add 'Run administration tool' to plugin actions This patch adds the new 'Run administration tool' option to the plugin actions dropdown menu for plugins with such a function. Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Created attachment 162783 [details] [review] Bug 36206: (follow-up) Change file permission Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Created attachment 163270 [details] [review] Bug 36206: Add 'admin' plugins option This patch adds an admin plugins class to the plugins system and displays such plugins under the 'Plugins' section in the Administration page. Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Created attachment 163271 [details] [review] Bug 36206: Expose administration page to users with plugins_admin permission This patch updates the intranet home page logic such that the administration button appears for those users with just the 'admin' subpermission of plugins to allow them to access such plugins. We also update the display logic found inside the admin-home page so that user see plugin management appropriately. Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Created attachment 163272 [details] [review] Bug 36206: Add 'Run administration tool' to plugin actions This patch adds the new 'Run administration tool' option to the plugin actions dropdown menu for plugins with such a function. Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Created attachment 163273 [details] [review] Bug 36206: (follow-up) Change file permission Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Created attachment 163274 [details] [review] Bug 36206: (QA follow-up) Tidy admin-home.pl Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Requires some small fixes: 1) Database update: + say $out "Added new permission 'edit_any_item'"; 2) Logic on the admin page The changed logic here introduces a regression: Before the change "headings" only displayed if the user had permissions and plugins were enabled. Now the heading will always display as soon as plugins are enabled, even to users without any plugin related permissions. 3) Typo in permissions.inc + <span class="sub_permission admin_subpermission"> + Use adminitstrative plugins I would have fixed 1 + 3 inline, but I didn't want to fiddle with 2 right now. Please fix.
Created attachment 165533 [details] [review] Bug 36206: (follow-up) Fix Typos
Created attachment 165534 [details] [review] Bug 36206: (follow-up) More conditions on display
Thanks for the follow-up!
Pushed for 24.05! Well done everyone, thank you!
Please fix! # Failed test 'Expected permissions generated for superlibrarian' # at /kohadevbox/koha/t/Koha/Auth/Permissions.t line 289. # Structures begin differing at: # $got->{CAN_user_plugins_admin} = '1' # $expected->{CAN_user_plugins_admin} = Does not exist # Looks like you failed 1 test of 1.
Created attachment 165695 [details] [review] Bug 36206: (follow-up) Fix Permissions.t Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(In reply to Katrin Fischer from comment #27) > Please fix! > > # Failed test 'Expected permissions generated for superlibrarian' > # at /kohadevbox/koha/t/Koha/Auth/Permissions.t line 289. > # Structures begin differing at: > # $got->{CAN_user_plugins_admin} = '1' > # $expected->{CAN_user_plugins_admin} = Does not exist > # Looks like you failed 1 test of 1. Done and pushed.
Thanks for jumping on that one Tomas
Great :D Maybe add some text in https://wiki.koha-community.org/wiki/Koha_plugins
Not backported to 23.11.x