From f6c322e3253a8c9893144d19da111e5b5c8a55cf Mon Sep 17 00:00:00 2001 From: Fridolin Somers Date: Thu, 19 Mar 2020 17:01:13 +0300 Subject: [PATCH] Bug 20415: add Koha.ArePluginsEnabled Template Toolkit method In order to remove UseKohaPlugins syspref, adds to Koha Template Toolkit plugin a method ArePluginsEnabled(). Test plan: 1) Set syspref UseKohaPlugins enabled 2) Set config enable_plugins=1 3) Check you see "Tool plugins" in "Tools" home page and menu 4) Check you see "Manage plugins" in "Koha administration" home page 5) Check you see "Report plugins" in "Reports" home page and menu 6) Set config enable_plugins=0 7) Check you don't see in 3) 4) 5) 8) Run prove t/Koha_Template_Plugin_Koha.t Signed-off-by: Bernardo Gonzalez Kriegel Signed-off-by: Kyle M Hall Signed-off-by: Martin Renvoize --- Koha/Template/Plugin/Koha.pm | 4 ++++ .../prog/en/includes/reports-menu.inc | 4 +++- .../intranet-tmpl/prog/en/includes/tools-menu.inc | 4 ++-- .../prog/en/modules/plugins/plugins-disabled.tt | 2 +- .../prog/en/modules/reports/reports-home.tt | 2 +- .../prog/en/modules/tools/tools-home.tt | 4 ++-- t/Koha_Template_Plugin_Koha.t | 14 +++++++++++++- 7 files changed, 26 insertions(+), 8 deletions(-) diff --git a/Koha/Template/Plugin/Koha.pm b/Koha/Template/Plugin/Koha.pm index 0532a0479a..87b6f5f9ef 100644 --- a/Koha/Template/Plugin/Koha.pm +++ b/Koha/Template/Plugin/Koha.pm @@ -58,4 +58,8 @@ sub Version { }; } +sub ArePluginsEnabled { + return C4::Context->config('enable_plugins'); +} + 1; diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/reports-menu.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/reports-menu.inc index e79f2db105..d63b3e923d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/reports-menu.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/reports-menu.inc @@ -1,3 +1,5 @@ +[% USE Koha %] +