Bugzilla – Attachment 158584 Details for
Bug 31380
Build Mojolicious controller for running Koha plugins
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 31380: Add plugin hook for choosing Mojolicious or CGI script controller
Bug-31380-Add-plugin-hook-for-choosing-Mojolicious.patch (text/plain), 5.30 KB, created by
David Cook
on 2023-11-07 02:21:39 UTC
(
hide
)
Description:
Bug 31380: Add plugin hook for choosing Mojolicious or CGI script controller
Filename:
MIME Type:
Creator:
David Cook
Created:
2023-11-07 02:21:39 UTC
Size:
5.30 KB
patch
obsolete
>From f2113cbc9c3c179bf981c6a5e3504d0a19deaed1 Mon Sep 17 00:00:00 2001 >From: David Cook <dcook@prosentient.com.au> >Date: Wed, 4 Jan 2023 01:21:34 +0000 >Subject: [PATCH] Bug 31380: Add plugin hook for choosing Mojolicious or CGI > script controller > >This change checks for a "use_mojolicious" method in the plugin in order to >determine whether it should use a Mojolicious controller or a CGI script >controller. > >Note that the check is for the existence of the method, so it is backwards >compatible with all existing Koha Plugins. >--- > .../prog/en/modules/plugins/plugins-home.tt | 10 +++++++--- > .../intranet-tmpl/prog/en/modules/tools/tools-home.tt | 6 +++++- > 2 files changed, 12 insertions(+), 4 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/plugins/plugins-home.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/plugins/plugins-home.tt >index ce9d9c5ce2..5e5a23b517 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/plugins/plugins-home.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/plugins/plugins-home.tt >@@ -147,6 +147,10 @@ > </thead> > > [% FOREACH plugin IN plugins %] >+ [% plugin_link = '/cgi-bin/koha/plugins/run.pl' %] >+ [% IF ( plugin.can('use_mojolicious') ) %] >+ [% plugin_link = '/cgi-bin/koha/staff/plugins/run' %] >+ [% END %] > [% IF plugin.error %] > <tr class="warn"> > <td> >@@ -200,19 +204,19 @@ > <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="pluginactions[% plugin.class | html %]"> > [% IF ( CAN_user_plugins_report ) %] > [% IF plugin.can('report') %] >- <li><a href="/cgi-bin/koha/plugins/run.pl?class=[% plugin.class | uri %]&method=report"><i class="fa fa-table fa-fw"></i> Run report</a></li> >+ <li><a href="[% plugin_link | $raw %]?class=[% plugin.class | uri %]&method=report"><i class="fa fa-table fa-fw"></i> Run report</a></li> > [% END %] > [% END %] > > [% IF ( CAN_user_plugins_tool ) %] > [% IF plugin.can('tool') %] >- <li><a href="/cgi-bin/koha/plugins/run.pl?class=[% plugin.class | uri %]&method=tool"><i class="fa fa-wrench fa-fw"></i> Run tool</a></li> >+ <li><a href="[% plugin_link | $raw %]?class=[% plugin.class | uri %]&method=tool"><i class="fa fa-wrench fa-fw"></i> Run tool</a></li> > [% END %] > [% END %] > > [% IF ( CAN_user_plugins_configure ) %] > [% IF plugin.can('configure') %] >- <li><a href="/cgi-bin/koha/plugins/run.pl?class=[% plugin.class | uri %]&method=configure"><i class="fa fa-cog fa-fw"></i> Configure</a></li> >+ <li><a href="[% plugin_link | $raw %]?class=[% plugin.class | uri %]&method=configure"><i class="fa fa-cog fa-fw"></i> Configure</a></li> > [% END %] > [% END %] > [% IF ( CAN_user_plugins_manage ) %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/tools-home.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/tools-home.tt >index b805c6d1b7..0ae7ef84f6 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/tools-home.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/tools-home.tt >@@ -157,8 +157,12 @@ > Use tool plugins > <ul> > [% FOREACH plugin IN tool_plugins %] >+ [% plugin_link = '/cgi-bin/koha/plugins/run.pl' %] >+ [% IF ( plugin.can('use_mojolicious') ) %] >+ [% plugin_link = '/cgi-bin/koha/staff/plugins/run' %] >+ [% END %] > <li class="plugin_link"> >- <a href="/cgi-bin/koha/plugins/run.pl?class=[% plugin.class | uri %]&method=tool"> >+ <a href="[% plugin_link | $raw %]?class=[% plugin.class | uri %]&method=tool"> > <span class="plugin_name">[% plugin.metadata.name | html %]</span> > </a> > </li> >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 31380
:
139308
|
139309
|
139312
|
139313
|
139314
|
139315
|
139316
|
139317
|
139318
|
139319
|
139320
|
139321
|
139322
|
139323
|
139324
|
139325
|
139327
|
139328
|
139394
|
139395
|
139396
|
139818
|
139819
|
139820
|
140673
|
140674
|
140675
|
144968
|
144969
|
144970
|
158583
| 158584