From 6043b4fb2490b910a5af29e5989c8e5d1d87b638 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Thu, 21 Nov 2019 14:28:03 +0000 Subject: [PATCH] Bug 24080: Add updatecharge payout permission Add a new subpermission called 'payout' to the 'updatecharges' permission group which will allow/prevent payout actions to be performed by staff. Signed-off-by: Kyle M Hall Signed-off-by: Tomas Cohen Arazi Signed-off-by: Martin Renvoize --- installer/data/mysql/atomicupdate/bug_24080.perl | 7 +++++++ installer/data/mysql/userpermissions.sql | 1 + koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc | 5 +++++ 3 files changed, 13 insertions(+) diff --git a/installer/data/mysql/atomicupdate/bug_24080.perl b/installer/data/mysql/atomicupdate/bug_24080.perl index dd8de49e93..514317ff8d 100644 --- a/installer/data/mysql/atomicupdate/bug_24080.perl +++ b/installer/data/mysql/atomicupdate/bug_24080.perl @@ -19,7 +19,14 @@ if ( CheckVersion($DBversion) ) { INSERT IGNORE INTO account_offset_types ( type ) VALUES ('PAYOUT'); }); + $dbh->do(qq{ + INSERT IGNORE permissions (module_bit, code, description) + VALUES + (10, 'payout', 'Perform account payout action') + }); + SetVersion($DBversion); print "Upgrade to $DBversion done (Bug 24080 - Add PAYOUT account_debit_type)\n"; print "Upgrade to $DBversion done (Bug 24080 - Add PAYOUT account_offset_type)\n"; + print "Upgrade to $DBversion done (Bug 24080 - Add accounts payout permission)\n"; } diff --git a/installer/data/mysql/userpermissions.sql b/installer/data/mysql/userpermissions.sql index 085024e78c..3fdbbf8e8e 100644 --- a/installer/data/mysql/userpermissions.sql +++ b/installer/data/mysql/userpermissions.sql @@ -43,6 +43,7 @@ INSERT INTO permissions (module_bit, code, description) VALUES ( 9, 'edit_items', 'Edit items'), ( 9, 'edit_items_restricted', 'Limit item modification to subfields defined in the SubfieldsToAllowForRestrictedEditing preference (please note that edit_item is still required)'), ( 9, 'delete_all_items', 'Delete all items at once'), + (10, 'payout', 'Perform account payout action'), (10, 'writeoff', 'Write off fines and fees'), (10, 'remaining_permissions', 'Remaining permissions for managing fines and fees'), (11, 'currencies_manage', 'Manage currencies and exchange rates'), diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc index 1c0b981c98..352286e032 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc @@ -304,6 +304,11 @@ Remaining permissions for managing fines and fees ([% name | html %]) + [%- CASE 'payout' -%] + + Payout credits to patrons + + ([% name | html %]) [%- CASE 'writeoff' -%] Write off fines and fees -- 2.39.5