Bugzilla – Attachment 139317 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), 4.67 KB, created by
David Cook
on 2022-08-18 05:51:17 UTC
(
hide
)
Description:
Bug 31380: Add plugin hook for choosing Mojolicious or CGI script controller
Filename:
MIME Type:
Creator:
David Cook
Created:
2022-08-18 05:51:17 UTC
Size:
4.67 KB
patch
obsolete
>From b3a13e0766b4ba0131864ed115e5f88aeef9829a Mon Sep 17 00:00:00 2001 >From: David Cook <dcook@prosentient.com.au> >Date: Thu, 18 Aug 2022 04:07:36 +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. >--- > .../intranet-tmpl/prog/en/modules/plugins/plugins-home.tt | 7 ++++--- > .../intranet-tmpl/prog/en/modules/tools/tools-home.tt | 4 +++- > 2 files changed, 7 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 c43c5fb2ee..ba877072fd 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 >@@ -177,21 +177,22 @@ > Actions <b class="caret"></b> > </a> > <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="pluginactions[% plugin.class | html %]"> >+ [% plugin_link = '/cgi-bin/koha/plugins/run.pl'; IF ( plugin.can('use_mojolicious') ); plugin_link = '/cgi-bin/koha/staff/plugins/run'; END; %] > [% 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 7efa6aba1c..a9cbabc83c 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 >@@ -1,3 +1,4 @@ >+[% USE raw %] > [% USE Koha %] > [% USE Branches %] > [% USE Registers %] >@@ -140,7 +141,8 @@ > <ul> > [% FOREACH plugin IN tool_plugins %] > <li class="plugin_link"> >- <a href="/cgi-bin/koha/plugins/run.pl?class=[% plugin.class | uri %]&method=tool"> >+ [% plugin_link = '/cgi-bin/koha/plugins/run.pl'; IF ( plugin.can('use_mojolicious') ); plugin_link = '/cgi-bin/koha/staff/plugins/run'; END; %] >+ <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