From 52da03d126a3c2a73695266d1e07d08553a81eb4 Mon Sep 17 00:00:00 2001 From: Sam Lau Date: Thu, 27 Jun 2024 18:53:09 +0000 Subject: [PATCH] Bug 37211: Add new subpermission in updatecharge 'edit_notes' --- .../data/mysql/atomicupdate/bug_37211.pl | 23 +++++++++++++++++++ .../data/mysql/mandatory/userpermissions.sql | 1 + .../prog/en/includes/permissions.inc | 5 ++++ 3 files changed, 29 insertions(+) create mode 100755 installer/data/mysql/atomicupdate/bug_37211.pl diff --git a/installer/data/mysql/atomicupdate/bug_37211.pl b/installer/data/mysql/atomicupdate/bug_37211.pl new file mode 100755 index 0000000000..cc66438cae --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_37211.pl @@ -0,0 +1,23 @@ +use Modern::Perl; +use Koha::Installer::Output qw(say_warning say_failure say_success say_info); + +return { + bug_number => "37211", + description => "Add permission updatecharges:edit_notes", + up => sub { + my ($args) = @_; + my ( $dbh, $out ) = @$args{qw(dbh out)}; + + # Do you stuffs here + $dbh->do( + q{ + INSERT INTO permissions (module_bit, code, description) + VALUES (10, 'edit_notes', 'Edit accountline notes') + } + ); + + # permissions + say $out "Added new permission 'updatecharges:edit_notes'"; + + }, +}; diff --git a/installer/data/mysql/mandatory/userpermissions.sql b/installer/data/mysql/mandatory/userpermissions.sql index 83808b97a2..0343cf4732 100644 --- a/installer/data/mysql/mandatory/userpermissions.sql +++ b/installer/data/mysql/mandatory/userpermissions.sql @@ -71,6 +71,7 @@ INSERT INTO permissions (module_bit, code, description) VALUES (10, 'manual_credit', 'Add manual credits to a patron account'), (10, 'manual_invoice', 'Add manual invoices to a patron account'), (10, 'remaining_permissions', 'Remaining permissions for managing fines and fees'), + (10, 'edit_notes', 'Edit accountline notes'), (11, 'currencies_manage', 'Manage currencies and exchange rates'), (11, 'vendors_manage', 'Manage vendors'), (11, 'contracts_manage', 'Manage contracts'), diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc index f5396703e7..243daa7e3e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc @@ -442,6 +442,11 @@ Create purchase suggestions ([% name | html %]) + [%- CASE 'edit_notes' -%] + + Edit accountline notes + + ([% name | html %]) [%- CASE 'suggestions_manage' -%] Edit purchase suggestions -- 2.39.2