Bugzilla – Attachment 162615 Details for
Bug 36206
Administrative plugins
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36206: Add 'admin' plugins option
Bug-36206-Add-admin-plugins-option.patch (text/plain), 4.59 KB, created by
Martin Renvoize (ashimema)
on 2024-02-29 19:00:43 UTC
(
hide
)
Description:
Bug 36206: Add 'admin' plugins option
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2024-02-29 19:00:43 UTC
Size:
4.59 KB
patch
obsolete
>From bc843884d95f6bfe00a00cc76fe1488219324372 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Thu, 29 Feb 2024 18:08:41 +0000 >Subject: [PATCH] Bug 36206: Add 'admin' plugins option > >This patch adds an admin plugins class to the plugins system and >displays such plugins under the 'Plugins' section in the Administration >page. >--- > admin/admin-home.pl | 7 +++++++ > .../data/mysql/atomicupdate/bug_36206.pl | 20 +++++++++++++++++++ > .../data/mysql/mandatory/userpermissions.sql | 1 + > .../prog/en/includes/permissions.inc | 5 +++++ > .../prog/en/modules/admin/admin-home.tt | 6 ++++++ > 5 files changed, 39 insertions(+) > create mode 100644 installer/data/mysql/atomicupdate/bug_36206.pl > >diff --git a/admin/admin-home.pl b/admin/admin-home.pl >index 6595841e709..95338b0bf5b 100755 >--- a/admin/admin-home.pl >+++ b/admin/admin-home.pl >@@ -35,6 +35,13 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( > } > ); > >+if ( C4::Context->config('enable_plugins') ) { >+ my @admin_plugins = Koha::Plugins->new()->GetPlugins({ >+ method => 'admin', >+ }); >+ $template->param( admin_plugins => \@admin_plugins ); >+} >+ > $template->param( mana_url => $mana_url, ); > > output_html_with_http_headers $query, $cookie, $template->output; >diff --git a/installer/data/mysql/atomicupdate/bug_36206.pl b/installer/data/mysql/atomicupdate/bug_36206.pl >new file mode 100644 >index 00000000000..c371d51ac21 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_36206.pl >@@ -0,0 +1,20 @@ >+use Modern::Perl; >+ >+return { >+ bug_number => "32602", >+ description => "Add administrative plugins type", >+ up => sub { >+ my ($args) = @_; >+ my ( $dbh, $out ) = @$args{qw(dbh out)}; >+ >+ my $permission_added = $dbh->do( >+ q{ >+ INSERT IGNORE INTO permissions (module_bit, code, description) VALUES ( 19, 'admin', 'Use administrative plugins'); >+ } >+ ); >+ >+ if ( $permission_added == 1 ) { >+ say $out "Added new permission 'edit_any_item'"; >+ } >+ }, >+}; >diff --git a/installer/data/mysql/mandatory/userpermissions.sql b/installer/data/mysql/mandatory/userpermissions.sql >index 729c075548a..394024a9926 100644 >--- a/installer/data/mysql/mandatory/userpermissions.sql >+++ b/installer/data/mysql/mandatory/userpermissions.sql >@@ -138,6 +138,7 @@ INSERT INTO permissions (module_bit, code, description) VALUES > (19, 'manage', 'Manage plugins ( install / uninstall )'), > (19, 'tool', 'Use tool plugins'), > (19, 'report', 'Use report plugins'), >+ (19, 'admin', 'Use administrative plugins'), > (19, 'configure', 'Configure plugins'), > (20, 'delete_public_lists', 'Delete public lists'), > (20, 'edit_public_lists', 'Edit public lists'), >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc >index 742e6e1c359..205f6afcfee 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc >@@ -737,6 +737,11 @@ > Use tool plugins > </span> > <span class="permissioncode">([% name | html %])</span> >+ [%- CASE 'admin' -%] >+ <span class="sub_permission admin_subpermission"> >+ Use adminitstrative plugins >+ </span> >+ <span class="permissioncode">([% name | html %])</span> > [%- CASE 'delete_public_lists' -%] > <span class="sub_permission delete_public_lists_subpermission"> > Delete public lists >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/admin-home.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/admin-home.tt >index d5582effc2c..f74e4274a10 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/admin-home.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/admin-home.tt >@@ -153,6 +153,12 @@ > <dl> > <dt><a href="/cgi-bin/koha/plugins/plugins-home.pl">Manage plugins</a></dt> > <dd>View, manage, configure and run plugins.</dd> >+ [% IF ( CAN_user_plugins_admin && admin_plugins ) %] >+ [% FOREACH plugin IN admin_plugins %] >+ <dt><a href="/cgi-bin/koha/plugins/run.pl?class=[% plugin.class | uri %]&method=admin"><span class="plugin_name">[% plugin.metadata.name | html %]</span></a></dt> >+ <dd>[% plugin.metadata.description | html %]</dd> >+ [% END %] >+ [% END %] > </dl> > [% END %] > >-- >2.44.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 36206
:
162615
|
162639
|
162640
|
162641
|
162779
|
162780
|
162781
|
162782
|
162783
|
163270
|
163271
|
163272
|
163273
|
163274
|
165533
|
165534
|
165695