From c5810c360544de96bf3fb2000c135836b6e2ee10 Mon Sep 17 00:00:00 2001 From: Kyle Hall Date: Fri, 2 Sep 2022 10:27:39 -0400 Subject: [PATCH] Bug 31401: (QA follow-up) Remove Koha.ArePluginsEnabled, it is no longer needed Signed-off-by: Kyle M Hall Signed-off-by: Tomas Cohen Arazi --- Koha/Template/Plugin/Koha.pm | 10 ---------- .../prog/en/includes/reports-menu.inc | 2 +- .../intranet-tmpl/prog/en/includes/tools-menu.inc | 4 ++-- .../prog/en/modules/reports/reports-home.tt | 2 +- .../prog/en/modules/tools/tools-home.tt | 4 ++-- t/Koha_Template_Plugin_Koha.t | 14 +------------- 6 files changed, 7 insertions(+), 29 deletions(-) diff --git a/Koha/Template/Plugin/Koha.pm b/Koha/Template/Plugin/Koha.pm index 9ecd7fde0d..5e7a303f70 100644 --- a/Koha/Template/Plugin/Koha.pm +++ b/Koha/Template/Plugin/Koha.pm @@ -84,14 +84,4 @@ sub Version { }; } -=head3 ArePluginsEnabled - -Returns true if plugins are enabled, false otherwise. - -=cut - -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 d63b3e923d..3727737311 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/reports-menu.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/reports-menu.inc @@ -28,7 +28,7 @@
  • Holds
  • - [% IF Koha.ArePluginsEnabled() %] + [% IF plugins_enabled %]
    Report plugins
    • Report plugins
    • diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/tools-menu.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/tools-menu.inc index 0cc705c6f4..d994c22ecb 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/tools-menu.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/tools-menu.inc @@ -95,7 +95,7 @@ [% END %]
    [% END %] -[% IF ( CAN_user_tools_edit_calendar || CAN_user_tools_manage_csv_profiles || CAN_user_tools_view_system_logs || CAN_user_tools_edit_additional_contents || CAN_user_tools_schedule_tasks || CAN_user_tools_edit_quotes || ( Koha.ArePluginsEnabled() && CAN_user_plugins_tool ) || CAN_user_tools_upload_general_files || CAN_user_tools_access_files ) %] +[% IF ( CAN_user_tools_edit_calendar || CAN_user_tools_manage_csv_profiles || CAN_user_tools_view_system_logs || CAN_user_tools_edit_additional_contents || CAN_user_tools_schedule_tasks || CAN_user_tools_edit_quotes || ( plugins_enabled && CAN_user_plugins_tool ) || CAN_user_tools_upload_general_files || CAN_user_tools_access_files ) %]
    Additional tools
      [% IF ( CAN_user_tools_edit_calendar ) %] @@ -118,7 +118,7 @@ [% IF ( CAN_user_tools_edit_quotes ) %]
    • Quote editor
    • [% END %] - [% IF ( Koha.ArePluginsEnabled() && CAN_user_plugins_tool ) %] + [% IF ( plugins_enabled && CAN_user_plugins_tool ) %]
    • Tool plugins
    • [% END %] [% IF ( CAN_user_tools_upload_general_files ) %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/reports-home.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/reports-home.tt index 5c2de9cbf3..7dd20f34dd 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/reports-home.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/reports-home.tt @@ -66,7 +66,7 @@
    • Holds
    - [% IF Koha.ArePluginsEnabled() %] + [% IF plugins_enabled %]

    Report plugins

    • Report plugins
    • 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 2ebca53c9e..612cf23b25 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 @@ -96,7 +96,7 @@
      -[% IF ( CAN_user_tools_edit_calendar || CAN_user_tools_manage_csv_profiles || CAN_user_tools_view_system_logs || CAN_user_tools_edit_additional_contents || CAN_user_tools_schedule_tasks || CAN_user_tools_edit_quotes || ( Koha.ArePluginsEnabled() && CAN_user_plugins_tool ) || CAN_user_tools_upload_general_files || CAN_user_tools_access_files ) %] +[% IF ( CAN_user_tools_edit_calendar || CAN_user_tools_manage_csv_profiles || CAN_user_tools_view_system_logs || CAN_user_tools_edit_additional_contents || CAN_user_tools_schedule_tasks || CAN_user_tools_edit_quotes || ( plugins_enabled && CAN_user_plugins_tool ) || CAN_user_tools_upload_general_files || CAN_user_tools_access_files ) %]

      Additional tools

      [% END %]
      @@ -136,7 +136,7 @@
      Manage 'Quote of the day' quotes
      [% END %] - [% IF ( Koha.ArePluginsEnabled() && CAN_user_plugins_tool && tool_plugins ) %] + [% IF ( plugins_enabled && CAN_user_plugins_tool && tool_plugins ) %]
      Tool plugins
      Use tool plugins diff --git a/t/Koha_Template_Plugin_Koha.t b/t/Koha_Template_Plugin_Koha.t index 812f5f96cc..a8d66feb9d 100755 --- a/t/Koha_Template_Plugin_Koha.t +++ b/t/Koha_Template_Plugin_Koha.t @@ -17,7 +17,7 @@ use Modern::Perl; -use Test::More tests => 5; +use Test::More tests => 4; use Test::MockModule; use t::lib::Mocks; @@ -77,18 +77,6 @@ subtest "Koha::Template::Plugin::Koha::Version tests" => sub { }; -subtest "Koha::Template::Plugin::Koha::ArePluginsEnabled tests" => sub { - - plan tests => 2; - - t::lib::Mocks::mock_config( 'enable_plugins', 1 ); - is(Koha::Template::Plugin::Koha::ArePluginsEnabled(), 1, "Correct ArePluginsEnabled is yes"); - - t::lib::Mocks::mock_config( 'enable_plugins', 0 ); - is(Koha::Template::Plugin::Koha::ArePluginsEnabled(), 0, "Correct ArePluginsEnabled is no"); - -}; - subtest "Koha::Template::Plugin::Koha::CSVDelimiter tests" => sub { plan tests => 8; -- 2.39.5