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

(-)a/Koha/Template/Plugin/Koha.pm (+4 lines)
Lines 58-61 sub Version { Link Here
58
    };
58
    };
59
}
59
}
60
60
61
sub ArePluginsEnabled {
62
    return C4::Context->config('enable_plugins');
63
}
64
61
1;
65
1;
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/reports-menu.inc (-1 / +3 lines)
Lines 1-3 Link Here
1
[% USE Koha %]
2
1
<div id="navmenu">
3
<div id="navmenu">
2
    <div id="navmenulist">
4
    <div id="navmenulist">
3
5
Lines 26-32 Link Here
26
                <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>
27
            </ul>
29
            </ul>
28
30
29
        [% IF UseKohaPlugins %]
31
        [% IF Koha.ArePluginsEnabled() %]
30
            <h5>Report plugins</h5>
32
            <h5>Report plugins</h5>
31
            <ul>
33
            <ul>
32
                <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 102-108 Link Here
102
</ul>
102
</ul>
103
[% END %]
103
[% END %]
104
[% IF ( CAN_user_tools_edit_calendar || CAN_user_tools_manage_csv_profiles || CAN_user_tools_view_system_logs || CAN_user_tools_edit_news
104
[% IF ( CAN_user_tools_edit_calendar || CAN_user_tools_manage_csv_profiles || CAN_user_tools_view_system_logs || CAN_user_tools_edit_news
105
  || CAN_user_tools_schedule_tasks || CAN_user_tools_edit_quotes || ( UseKohaPlugins && CAN_user_plugins_tool )
105
  || CAN_user_tools_schedule_tasks || CAN_user_tools_edit_quotes || ( Koha.ArePluginsEnabled() && CAN_user_plugins_tool )
106
  || CAN_user_tools_upload_general_files || CAN_user_tools_access_files ) %]
106
  || CAN_user_tools_upload_general_files || CAN_user_tools_access_files ) %]
107
<h5>Additional tools</h5>
107
<h5>Additional tools</h5>
108
<ul>
108
<ul>
Lines 124-130 Link Here
124
    [% IF ( CAN_user_tools_edit_quotes ) %]
124
    [% IF ( CAN_user_tools_edit_quotes ) %]
125
       <li><a href="/cgi-bin/koha/tools/quotes.pl">Quote editor</a></li>
125
       <li><a href="/cgi-bin/koha/tools/quotes.pl">Quote editor</a></li>
126
    [% END %]
126
    [% END %]
127
    [% IF ( UseKohaPlugins && CAN_user_plugins_tool ) %]
127
    [% IF ( Koha.ArePluginsEnabled() && CAN_user_plugins_tool ) %]
128
        <li><a href="/cgi-bin/koha/plugins/plugins-home.pl?method=tool">Tool plugins</a></li>
128
        <li><a href="/cgi-bin/koha/plugins/plugins-home.pl?method=tool">Tool plugins</a></li>
129
    [% END %]
129
    [% END %]
130
    [% IF ( CAN_user_tools_upload_general_files ) %]
130
    [% IF ( CAN_user_tools_upload_general_files ) %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/plugins/plugins-disabled.tt (-1 / +1 lines)
Lines 19-25 Link Here
19
            <div class="col-sm-6 col-sm-offset-3 col-md-6 col-md-offset-3">
19
            <div class="col-sm-6 col-sm-offset-3 col-md-6 col-md-offset-3">
20
                <h1>Plugins disabled!</h1>
20
                <h1>Plugins disabled!</h1>
21
21
22
                <p>To enable Koha plugins, the system preference UseKohaPlugins must be enabled, and the flag enable_plugins must be set in the Koha configuration file</p>
22
                <p>To enable Koha plugins, the flag enable_plugins must be set in the Koha configuration file</p>
23
            </div>
23
            </div>
24
        </div>
24
        </div>
25
25
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/reports-home.tt (-1 / +1 lines)
Lines 55-61 Link Here
55
            <li><a href="/cgi-bin/koha/reports/reserves_stats.pl">Holds</a></li>
55
            <li><a href="/cgi-bin/koha/reports/reserves_stats.pl">Holds</a></li>
56
      </ul>
56
      </ul>
57
57
58
        [% IF UseKohaPlugins %]
58
        [% IF Koha.ArePluginsEnabled() %]
59
            <h2>Report plugins</h2>
59
            <h2>Report plugins</h2>
60
            <ul>
60
            <ul>
61
                <li><a href="/cgi-bin/koha/plugins/plugins-home.pl?method=report">Report plugins</a></li>
61
                <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 84-90 Link Here
84
84
85
<div class="col-sm-4 col-sm-push-4">
85
<div class="col-sm-4 col-sm-push-4">
86
[% IF ( CAN_user_tools_edit_calendar || CAN_user_tools_manage_csv_profiles || CAN_user_tools_view_system_logs || CAN_user_tools_edit_news
86
[% IF ( CAN_user_tools_edit_calendar || CAN_user_tools_manage_csv_profiles || CAN_user_tools_view_system_logs || CAN_user_tools_edit_news
87
  || CAN_user_tools_schedule_tasks || CAN_user_tools_edit_quotes || ( UseKohaPlugins && CAN_user_plugins_tool )
87
  || CAN_user_tools_schedule_tasks || CAN_user_tools_edit_quotes || ( Koha.ArePluginsEnabled() && CAN_user_plugins_tool )
88
  || CAN_user_tools_upload_general_files || CAN_user_tools_access_files ) %]
88
  || CAN_user_tools_upload_general_files || CAN_user_tools_access_files ) %]
89
<h3>Additional tools</h3>
89
<h3>Additional tools</h3>
90
[% END %]
90
[% END %]
Lines 119-125 Link Here
119
    <dd>Quote editor for Quote-of-the-day feature in OPAC</dd>
119
    <dd>Quote editor for Quote-of-the-day feature in OPAC</dd>
120
    [% END %]
120
    [% END %]
121
121
122
    [% IF ( UseKohaPlugins && CAN_user_plugins_tool ) %]
122
    [% IF ( Koha.ArePluginsEnabled() && CAN_user_plugins_tool ) %]
123
    <dt><a href="/cgi-bin/koha/plugins/plugins-home.pl?method=tool">Tool plugins</a></dt>
123
    <dt><a href="/cgi-bin/koha/plugins/plugins-home.pl?method=tool">Tool plugins</a></dt>
124
    <dd>Use tool plugins</dd>
124
    <dd>Use tool plugins</dd>
125
    [% END %]
125
    [% END %]
(-)a/t/Koha_Template_Plugin_Koha.t (-2 / +13 lines)
Lines 17-24 Link Here
17
17
18
use Modern::Perl;
18
use Modern::Perl;
19
19
20
use Test::More tests => 3;
20
use Test::More tests => 4;
21
use Test::MockModule;
21
use Test::MockModule;
22
use t::lib::Mocks;
22
23
23
use String::Random;
24
use String::Random;
24
25
Lines 76-78 subtest "Koha::Template::Plugin::Koha::Version tests" => sub { Link Here
76
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
};

Return to bug 20415