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

(-)a/debian/templates/koha-conf-site.xml.in (+1 lines)
Lines 279-284 __END_SRU_PUBLICSERVER__ Link Here
279
 <authorityservershadow>1</authorityservershadow>
279
 <authorityservershadow>1</authorityservershadow>
280
 <pluginsdir>__PLUGINS_DIR__</pluginsdir> <!-- This entry can be repeated to use multiple directories -->
280
 <pluginsdir>__PLUGINS_DIR__</pluginsdir> <!-- This entry can be repeated to use multiple directories -->
281
 <enable_plugins>0</enable_plugins>
281
 <enable_plugins>0</enable_plugins>
282
 <enable_plugin_browser_upload>0</enable_plugin_browser_upload>
282
 <upload_path>__UPLOAD_PATH__</upload_path>
283
 <upload_path>__UPLOAD_PATH__</upload_path>
283
 <tmp_path>__TMP_PATH__</tmp_path>
284
 <tmp_path>__TMP_PATH__</tmp_path>
284
 <intranetdir>/usr/share/koha/intranet/cgi-bin</intranetdir>
285
 <intranetdir>/usr/share/koha/intranet/cgi-bin</intranetdir>
(-)a/etc/koha-conf.xml (+1 lines)
Lines 92-97 __PAZPAR2_TOGGLE_XML_POST__ Link Here
92
 <authorityservershadow>1</authorityservershadow>
92
 <authorityservershadow>1</authorityservershadow>
93
 <pluginsdir>__PLUGINS_DIR__</pluginsdir> <!-- This entry can be repeated to use multiple directories -->
93
 <pluginsdir>__PLUGINS_DIR__</pluginsdir> <!-- This entry can be repeated to use multiple directories -->
94
 <enable_plugins>0</enable_plugins>
94
 <enable_plugins>0</enable_plugins>
95
 <enable_plugin_browser_upload>0</enable_plugin_browser_upload>
95
 <upload_path></upload_path>
96
 <upload_path></upload_path>
96
 <tmp_path></tmp_path>
97
 <tmp_path></tmp_path>
97
 <intranetdir>__INTRANET_CGI_DIR__</intranetdir>
98
 <intranetdir>__INTRANET_CGI_DIR__</intranetdir>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/plugins/plugins-disabled.tt (-2 / +6 lines)
Lines 1-5 Link Here
1
[% INCLUDE 'doc-head-open.inc' %]
1
[% INCLUDE 'doc-head-open.inc' %]
2
<title>Koha &rsaquo; Tools &rsaquo; Plugins &rsaquo; Upload Plugin
2
<title>Koha &rsaquo; Tools &rsaquo; Plugins &rsaquo; Plugins Disabled
3
 </title>
3
 </title>
4
[% INCLUDE 'doc-head-close.inc' %]
4
[% INCLUDE 'doc-head-close.inc' %]
5
[% INCLUDE 'calendar.inc' %]
5
[% INCLUDE 'calendar.inc' %]
Lines 17-25 Link Here
17
    <div class="container-fluid">
17
    <div class="container-fluid">
18
        <div class="row">
18
        <div class="row">
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
                [% IF ( browser_upload_enabled.defined ) && ( browser_upload_enabled == 0 ) %]
21
                <h1>Plugin browser upload disabled!</h1>
22
                <p>To enable Koha plugin browser upload, the flag enable_plugin_browser_upload must be set in the Koha configuration file</p>
23
                [% ELSE %]
20
                <h1>Plugins disabled!</h1>
24
                <h1>Plugins disabled!</h1>
21
22
                <p>To enable Koha plugins, the flag enable_plugins must be set in the Koha configuration file</p>
25
                <p>To enable Koha plugins, the flag enable_plugins must be set in the Koha configuration file</p>
26
                [% END %]
23
            </div>
27
            </div>
24
        </div>
28
        </div>
25
29
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/plugins/plugins-home.tt (+2 lines)
Lines 26-32 Link Here
26
26
27
                    [% IF ( CAN_user_plugins_manage ) %]
27
                    [% IF ( CAN_user_plugins_manage ) %]
28
                        <div class="btn-toolbar" id="toolbar">
28
                        <div class="btn-toolbar" id="toolbar">
29
                            [% IF ( enable_browser_upload ) %]
29
                            <a href="/cgi-bin/koha/plugins/plugins-upload.pl" id="upload_plugin" class="btn btn-default"><i class="fa fa-upload"></i> Upload plugin</a>
30
                            <a href="/cgi-bin/koha/plugins/plugins-upload.pl" id="upload_plugin" class="btn btn-default"><i class="fa fa-upload"></i> Upload plugin</a>
31
                            [% END %]
30
32
31
                            <div class="btn-group">
33
                            <div class="btn-group">
32
                                <button class="btn btn-default dropdown-toggle" data-toggle="dropdown"><i class="fa fa-eye"></i> View plugins by class <span class="caret"></span></button>
34
                                <button class="btn btn-default dropdown-toggle" data-toggle="dropdown"><i class="fa fa-eye"></i> View plugins by class <span class="caret"></span></button>
(-)a/plugins/plugins-home.pl (+1 lines)
Lines 59-64 if ($plugins_enabled) { Link Here
59
    });
59
    });
60
60
61
    $template->param( plugins => \@plugins, );
61
    $template->param( plugins => \@plugins, );
62
    $template->param( enable_browser_upload => C4::Context->config('enable_plugin_browser_upload') );
62
63
63
    $template->param( can_search => C4::Context->config('plugin_repos') ? 1 : 0 );
64
    $template->param( can_search => C4::Context->config('plugin_repos') ? 1 : 0 );
64
    my @results;
65
    my @results;
(-)a/plugins/plugins-upload.pl (-3 / +7 lines)
Lines 32-42 use C4::Debug; Link Here
32
use Koha::Plugins;
32
use Koha::Plugins;
33
33
34
my $plugins_enabled = C4::Context->config("enable_plugins");
34
my $plugins_enabled = C4::Context->config("enable_plugins");
35
my $browser_upload_enabled = C4::Context->config('enable_plugin_browser_upload');
35
36
36
my $input = new CGI;
37
my $input = new CGI;
37
38
38
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
39
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
39
    {   template_name => ($plugins_enabled) ? "plugins/plugins-upload.tt" : "plugins/plugins-disabled.tt",
40
    {   template_name => ($plugins_enabled && $browser_upload_enabled) ? "plugins/plugins-upload.tt" : "plugins/plugins-disabled.tt",
40
        query         => $input,
41
        query         => $input,
41
        type          => "intranet",
42
        type          => "intranet",
42
        authnotrequired => 0,
43
        authnotrequired => 0,
Lines 45-50 my ( $template, $loggedinuser, $cookie ) = get_template_and_user( Link Here
45
    }
46
    }
46
);
47
);
47
48
49
if ($plugins_enabled){
50
    $template->param( browser_upload_enabled => $browser_upload_enabled );
51
}
52
48
my $uploadfilename = $input->param('uploadfile');
53
my $uploadfilename = $input->param('uploadfile');
49
my $uploadfile     = $input->upload('uploadfile');
54
my $uploadfile     = $input->upload('uploadfile');
50
my $uploadlocation = $input->param('uploadlocation');
55
my $uploadlocation = $input->param('uploadlocation');
Lines 54-60 my ( $tempfile, $tfh ); Link Here
54
59
55
my %errors;
60
my %errors;
56
61
57
if ($plugins_enabled) {
62
if ($plugins_enabled && $browser_upload_enabled) {
58
    if ( ( $op eq 'Upload' ) && ( $uploadfile || $uploadlocation ) ) {
63
    if ( ( $op eq 'Upload' ) && ( $uploadfile || $uploadlocation ) ) {
59
        my $plugins_dir = C4::Context->config("pluginsdir");
64
        my $plugins_dir = C4::Context->config("pluginsdir");
60
        $plugins_dir = ref($plugins_dir) eq 'ARRAY' ? $plugins_dir->[0] : $plugins_dir;
65
        $plugins_dir = ref($plugins_dir) eq 'ARRAY' ? $plugins_dir->[0] : $plugins_dir;
61
- 

Return to bug 25672