Bugzilla – Attachment 144970 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.54 KB, created by
David Cook
on 2023-01-04 05:59:26 UTC
(
hide
)
Description:
Bug 31380: Add plugin hook for choosing Mojolicious or CGI script controller
Filename:
MIME Type:
Creator:
David Cook
Created:
2023-01-04 05:59:26 UTC
Size:
5.54 KB
patch
obsolete
>From be91938409b3dc85803161a65f68d21b36fa6698 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 | 12 +++++++++--- > .../prog/en/modules/tools/tools-home.tt | 9 ++++++++- > 2 files changed, 17 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 fd55daf828..5b574c98df 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 >@@ -136,6 +136,12 @@ > </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> >@@ -187,19 +193,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 73508b2c64..bcd5de08ce 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 %] >@@ -160,8 +161,14 @@ > 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