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

(-)a/debian/templates/koha-conf-site.xml.in (+1 lines)
Lines 266-271 __END_SRU_PUBLICSERVER__ Link Here
266
 <authorityservershadow>1</authorityservershadow>
266
 <authorityservershadow>1</authorityservershadow>
267
 <pluginsdir>__PLUGINS_DIR__</pluginsdir> <!-- This entry can be repeated to use multiple directories -->
267
 <pluginsdir>__PLUGINS_DIR__</pluginsdir> <!-- This entry can be repeated to use multiple directories -->
268
 <enable_plugins>0</enable_plugins>
268
 <enable_plugins>0</enable_plugins>
269
 <enable_plugin_browser_upload>0</enable_plugin_browser_upload>
269
 <upload_path>__UPLOAD_PATH__</upload_path>
270
 <upload_path>__UPLOAD_PATH__</upload_path>
270
 <tmp_path>__TMP_PATH__</tmp_path>
271
 <tmp_path>__TMP_PATH__</tmp_path>
271
 <intranetdir>/usr/share/koha/intranet/cgi-bin</intranetdir>
272
 <intranetdir>/usr/share/koha/intranet/cgi-bin</intranetdir>
(-)a/etc/koha-conf.xml (+1 lines)
Lines 79-84 Link Here
79
 <authorityservershadow>1</authorityservershadow>
79
 <authorityservershadow>1</authorityservershadow>
80
 <pluginsdir>__PLUGINS_DIR__</pluginsdir> <!-- This entry can be repeated to use multiple directories -->
80
 <pluginsdir>__PLUGINS_DIR__</pluginsdir> <!-- This entry can be repeated to use multiple directories -->
81
 <enable_plugins>0</enable_plugins>
81
 <enable_plugins>0</enable_plugins>
82
 <enable_plugin_browser_upload>0</enable_plugin_browser_upload>
82
 <upload_path></upload_path>
83
 <upload_path></upload_path>
83
 <tmp_path></tmp_path>
84
 <tmp_path></tmp_path>
84
 <intranetdir>__INTRANET_CGI_DIR__</intranetdir>
85
 <intranetdir>__INTRANET_CGI_DIR__</intranetdir>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/plugins/plugins-disabled.tt (-1 / +5 lines)
Lines 29-37 Link Here
29
    <div class="container-fluid">
29
    <div class="container-fluid">
30
        <div class="row">
30
        <div class="row">
31
            <div class="col-sm-6 col-sm-offset-3 col-md-6 col-md-offset-3">
31
            <div class="col-sm-6 col-sm-offset-3 col-md-6 col-md-offset-3">
32
                [% IF ( browser_upload_enabled.defined ) && ( browser_upload_enabled == 0 ) %]
33
                <h1>Plugin browser upload disabled</h1>
34
                <p>To enable Koha plugin browser upload, the flag enable_plugin_browser_upload must be set in the Koha configuration file</p>
35
                [% ELSE %]
32
                <h1>Plugins disabled</h1>
36
                <h1>Plugins disabled</h1>
33
34
                <p>To enable Koha plugins, the flag enable_plugins must be set in the Koha configuration file</p>
37
                <p>To enable Koha plugins, the flag enable_plugins must be set in the Koha configuration file</p>
38
                [% END %]
35
            </div>
39
            </div>
36
        </div>
40
        </div>
37
41
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/plugins/plugins-home.tt (+2 lines)
Lines 46-52 Link Here
46
46
47
                    [% IF ( CAN_user_plugins_manage ) %]
47
                    [% IF ( CAN_user_plugins_manage ) %]
48
                        <div class="btn-toolbar" id="toolbar">
48
                        <div class="btn-toolbar" id="toolbar">
49
                            [% IF ( enable_browser_upload ) %]
49
                            <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>
50
                            <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>
51
                            [% END %]
50
52
51
                            <div class="btn-group">
53
                            <div class="btn-group">
52
                                <button class="btn btn-default dropdown-toggle" data-toggle="dropdown"><i class="fa-solid fa-eye"></i> View plugins by class <span class="caret"></span></button>
54
                                <button class="btn btn-default dropdown-toggle" data-toggle="dropdown"><i class="fa-solid 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 31-47 use Koha::Logger; Link Here
31
use Koha::Plugins;
31
use Koha::Plugins;
32
32
33
my $plugins_enabled = C4::Context->config("enable_plugins");
33
my $plugins_enabled = C4::Context->config("enable_plugins");
34
my $browser_upload_enabled = C4::Context->config('enable_plugin_browser_upload');
34
35
35
my $input = CGI->new;
36
my $input = CGI->new;
36
37
37
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
38
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
38
    {   template_name => ($plugins_enabled) ? "plugins/plugins-upload.tt" : "plugins/plugins-disabled.tt",
39
    {   template_name => ($plugins_enabled && $browser_upload_enabled) ? "plugins/plugins-upload.tt" : "plugins/plugins-disabled.tt",
39
        query         => $input,
40
        query         => $input,
40
        type          => "intranet",
41
        type          => "intranet",
41
        flagsrequired   => { plugins => 'manage' },
42
        flagsrequired   => { plugins => 'manage' },
42
    }
43
    }
43
);
44
);
44
45
46
if ($plugins_enabled){
47
    $template->param( browser_upload_enabled => $browser_upload_enabled );
48
}
49
45
my $uploadfilename = $input->param('uploadfile');
50
my $uploadfilename = $input->param('uploadfile');
46
my $uploadfile     = $input->upload('uploadfile');
51
my $uploadfile     = $input->upload('uploadfile');
47
my $uploadlocation = $input->param('uploadlocation');
52
my $uploadlocation = $input->param('uploadlocation');
Lines 51-57 my ( $tempfile, $tfh ); Link Here
51
56
52
my %errors;
57
my %errors;
53
58
54
if ($plugins_enabled) {
59
if ($plugins_enabled && $browser_upload_enabled) {
55
    if ( ( $op eq 'Upload' ) && ( $uploadfile || $uploadlocation ) ) {
60
    if ( ( $op eq 'Upload' ) && ( $uploadfile || $uploadlocation ) ) {
56
        my $plugins_dir = C4::Context->config("pluginsdir");
61
        my $plugins_dir = C4::Context->config("pluginsdir");
57
        $plugins_dir = ref($plugins_dir) eq 'ARRAY' ? $plugins_dir->[0] : $plugins_dir;
62
        $plugins_dir = ref($plugins_dir) eq 'ARRAY' ? $plugins_dir->[0] : $plugins_dir;
58
- 

Return to bug 25672