From 297edcd87977b3b72f7e07064ca1e7c823945e81 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 4b5c8ebe2c..24dc7d2bea 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 b8f2c2b040..aa6158a4be 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc @@ -437,6 +437,11 @@ Add manual credits to a patron account ([% name | html %]) + [%- CASE 'edit_notes' -%] + + Edit accountline notes + + ([% name | html %]) [%- CASE 'suggestions_manage' -%] Manage purchase suggestions -- 2.39.2