View | Details | Raw Unified | Return to bug 31401
Collapse All | Expand All

(-)a/Koha/Template/Plugin/Koha.pm (-10 lines)
Lines 84-97 sub Version { Link Here
84
    };
84
    };
85
}
85
}
86
86
87
=head3 ArePluginsEnabled
88
89
Returns true if plugins are enabled, false otherwise.
90
91
=cut
92
93
sub ArePluginsEnabled {
94
    return C4::Context->config('enable_plugins');
95
}
96
97
1;
87
1;
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/reports-menu.inc (-1 / +1 lines)
Lines 28-34 Link Here
28
                <li><a href="/cgi-bin/koha/reports/reserves_stats.pl">Holds</a></li>
28
                <li><a href="/cgi-bin/koha/reports/reserves_stats.pl">Holds</a></li>
29
            </ul>
29
            </ul>
30
30
31
        [% IF Koha.ArePluginsEnabled() %]
31
        [% IF plugins_enabled %]
32
            <h5>Report plugins</h5>
32
            <h5>Report plugins</h5>
33
            <ul>
33
            <ul>
34
                <li><a href="/cgi-bin/koha/plugins/plugins-home.pl?method=report">Report plugins</a></li>
34
                <li><a href="/cgi-bin/koha/plugins/plugins-home.pl?method=report">Report plugins</a></li>
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/tools-menu.inc (-2 / +2 lines)
Lines 95-101 Link Here
95
    [% END %]
95
    [% END %]
96
</ul>
96
</ul>
97
[% END %]
97
[% END %]
98
[% 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 ) %]
98
[% 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 ) %]
99
<h5>Additional tools</h5>
99
<h5>Additional tools</h5>
100
<ul>
100
<ul>
101
    [% IF ( CAN_user_tools_edit_calendar ) %]
101
    [% IF ( CAN_user_tools_edit_calendar ) %]
Lines 118-124 Link Here
118
    [% IF ( CAN_user_tools_edit_quotes ) %]
118
    [% IF ( CAN_user_tools_edit_quotes ) %]
119
       <li><a href="/cgi-bin/koha/tools/quotes.pl">Quote editor</a></li>
119
       <li><a href="/cgi-bin/koha/tools/quotes.pl">Quote editor</a></li>
120
    [% END %]
120
    [% END %]
121
    [% IF ( Koha.ArePluginsEnabled() && CAN_user_plugins_tool ) %]
121
    [% IF ( plugins_enabled && CAN_user_plugins_tool ) %]
122
        <li><a href="/cgi-bin/koha/plugins/plugins-home.pl?method=tool">Tool plugins</a></li>
122
        <li><a href="/cgi-bin/koha/plugins/plugins-home.pl?method=tool">Tool plugins</a></li>
123
    [% END %]
123
    [% END %]
124
    [% IF ( CAN_user_tools_upload_general_files ) %]
124
    [% IF ( CAN_user_tools_upload_general_files ) %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/reports-home.tt (-1 / +1 lines)
Lines 66-72 Link Here
66
            <li><a href="/cgi-bin/koha/reports/reserves_stats.pl">Holds</a></li>
66
            <li><a href="/cgi-bin/koha/reports/reserves_stats.pl">Holds</a></li>
67
      </ul>
67
      </ul>
68
68
69
        [% IF Koha.ArePluginsEnabled() %]
69
        [% IF plugins_enabled %]
70
            <h2>Report plugins</h2>
70
            <h2>Report plugins</h2>
71
            <ul>
71
            <ul>
72
                <li><a href="/cgi-bin/koha/plugins/plugins-home.pl?method=report">Report plugins</a></li>
72
                <li><a href="/cgi-bin/koha/plugins/plugins-home.pl?method=report">Report plugins</a></li>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/tools-home.tt (-2 / +2 lines)
Lines 96-102 Link Here
96
96
97
97
98
<div class="col-sm-4 col-sm-push-4">
98
<div class="col-sm-4 col-sm-push-4">
99
[% 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 ) %]
99
[% 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 ) %]
100
<h3>Additional tools</h3>
100
<h3>Additional tools</h3>
101
[% END %]
101
[% END %]
102
<dl>
102
<dl>
Lines 136-142 Link Here
136
    <dd>Manage 'Quote of the day' quotes</dd>
136
    <dd>Manage 'Quote of the day' quotes</dd>
137
    [% END %]
137
    [% END %]
138
138
139
    [% IF ( Koha.ArePluginsEnabled() && CAN_user_plugins_tool && tool_plugins ) %]
139
    [% IF ( plugins_enabled && CAN_user_plugins_tool && tool_plugins ) %]
140
    <dt><a href="/cgi-bin/koha/plugins/plugins-home.pl?method=tool">Tool plugins</a></dt>
140
    <dt><a href="/cgi-bin/koha/plugins/plugins-home.pl?method=tool">Tool plugins</a></dt>
141
    <dd>
141
    <dd>
142
        Use tool plugins
142
        Use tool plugins
(-)a/t/Koha_Template_Plugin_Koha.t (-14 / +1 lines)
Lines 17-23 Link Here
17
17
18
use Modern::Perl;
18
use Modern::Perl;
19
19
20
use Test::More tests => 5;
20
use Test::More tests => 4;
21
use Test::MockModule;
21
use Test::MockModule;
22
use t::lib::Mocks;
22
use t::lib::Mocks;
23
23
Lines 77-94 subtest "Koha::Template::Plugin::Koha::Version tests" => sub { Link Here
77
77
78
};
78
};
79
79
80
subtest "Koha::Template::Plugin::Koha::ArePluginsEnabled tests" => sub {
81
82
    plan tests => 2;
83
84
    t::lib::Mocks::mock_config( 'enable_plugins', 1 );
85
    is(Koha::Template::Plugin::Koha::ArePluginsEnabled(), 1, "Correct ArePluginsEnabled is yes");
86
87
    t::lib::Mocks::mock_config( 'enable_plugins', 0 );
88
    is(Koha::Template::Plugin::Koha::ArePluginsEnabled(), 0, "Correct ArePluginsEnabled is no");
89
90
};
91
92
subtest "Koha::Template::Plugin::Koha::CSVDelimiter tests" => sub {
80
subtest "Koha::Template::Plugin::Koha::CSVDelimiter tests" => sub {
93
81
94
    plan tests => 8;
82
    plan tests => 8;
95
- 

Return to bug 31401