Bug 36206 - Administrative plugins
Summary: Administrative plugins
Status: Passed QA
Alias: None
Product: Koha
Classification: Unclassified
Component: Plugin architecture (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Martin Renvoize
QA Contact: Testopia
URL: https://github.com/PTFS-Europe/koha-p...
Keywords:
Depends on:
Blocks:
 
Reported: 2024-02-29 17:23 UTC by Martin Renvoize
Modified: 2024-03-15 18:20 UTC (History)
7 users (show)

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


Attachments
Bug 36206: Add 'admin' plugins option (4.59 KB, patch)
2024-02-29 19:00 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 36206: Expose administration page to users with plugins_admin permission (2.99 KB, patch)
2024-03-01 08:04 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 36206: Add 'Run administration tool' to plugin actions (2.59 KB, patch)
2024-03-01 08:09 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 36206: Add 'Run administration tool' to plugin actions (2.59 KB, patch)
2024-03-01 08:10 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 36206: (follow-up) Change file permission (552 bytes, patch)
2024-03-05 17:01 UTC, Lucas Gass
Details | Diff | Splinter Review
Bug 36206: Add 'admin' plugins option (4.60 KB, patch)
2024-03-05 17:02 UTC, Lucas Gass
Details | Diff | Splinter Review
Bug 36206: Expose administration page to users with plugins_admin permission (3.01 KB, patch)
2024-03-05 17:02 UTC, Lucas Gass
Details | Diff | Splinter Review
Bug 36206: Add 'Run administration tool' to plugin actions (2.64 KB, patch)
2024-03-05 17:02 UTC, Lucas Gass
Details | Diff | Splinter Review
Bug 36206: (follow-up) Change file permission (607 bytes, patch)
2024-03-05 17:02 UTC, Lucas Gass
Details | Diff | Splinter Review
Bug 36206: Add 'admin' plugins option (4.66 KB, patch)
2024-03-15 18:20 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 36206: Expose administration page to users with plugins_admin permission (3.06 KB, patch)
2024-03-15 18:20 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 36206: Add 'Run administration tool' to plugin actions (2.70 KB, patch)
2024-03-15 18:20 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 36206: (follow-up) Change file permission (663 bytes, patch)
2024-03-15 18:20 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 36206: (QA follow-up) Tidy admin-home.pl (1.60 KB, patch)
2024-03-15 18:20 UTC, Kyle M Hall
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Renvoize 2024-02-29 17:23:01 UTC
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.
Comment 1 Martin Renvoize 2024-02-29 19:00:43 UTC
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.
Comment 2 Martin Renvoize 2024-02-29 19:02:10 UTC
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
Comment 3 Martin Renvoize 2024-03-01 08:04:38 UTC
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.
Comment 4 Martin Renvoize 2024-03-01 08:09:13 UTC
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.
Comment 5 Martin Renvoize 2024-03-01 08:10:24 UTC
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.
Comment 6 Martin Renvoize 2024-03-01 10:27:54 UTC
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
Comment 7 David Cook 2024-03-04 06:11:07 UTC
(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
Comment 8 David Cook 2024-03-04 06:16:13 UTC
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?
Comment 9 Martin Renvoize 2024-03-04 08:15:37 UTC
(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.
Comment 10 Martin Renvoize 2024-03-05 16:38:00 UTC
Grr... attaching a plugin here is too large for Bugzilla!
Comment 11 Martin Renvoize 2024-03-05 16:42:25 UTC
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.
Comment 12 Lucas Gass 2024-03-05 17:01:49 UTC
Created attachment 162779 [details] [review]
Bug 36206: (follow-up) Change file permission
Comment 13 Lucas Gass 2024-03-05 17:02:35 UTC
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>
Comment 14 Lucas Gass 2024-03-05 17:02:38 UTC
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>
Comment 15 Lucas Gass 2024-03-05 17:02:40 UTC
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>
Comment 16 Lucas Gass 2024-03-05 17:02:42 UTC
Created attachment 162783 [details] [review]
Bug 36206: (follow-up) Change file permission

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 17 Kyle M Hall 2024-03-15 18:20:00 UTC
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>
Comment 18 Kyle M Hall 2024-03-15 18:20:07 UTC
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>
Comment 19 Kyle M Hall 2024-03-15 18:20:09 UTC
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>
Comment 20 Kyle M Hall 2024-03-15 18:20:12 UTC
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>
Comment 21 Kyle M Hall 2024-03-15 18:20:14 UTC
Created attachment 163274 [details] [review]
Bug 36206: (QA follow-up) Tidy admin-home.pl

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>