From 4d2037914c0481ef5fb5908a3cd3b59304b43ad2 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Fri, 13 Sep 2019 14:48:49 +0100 Subject: [PATCH] Bug 23355: Add cashup permissions Add new 'cashup' sub-permissions to the 'cash_management' permission to allow fine grained control over whome may 'cashup' a cash register. Signed-off-by: Kyle M Hall Signed-off-by: Tomas Cohen Arazi Signed-off-by: Martin Renvoize --- .../mysql/atomicupdate/bug_23355_permissions.perl | 12 ++++++++++++ installer/data/mysql/userpermissions.sql | 1 + .../intranet-tmpl/prog/en/includes/permissions.inc | 5 +++++ .../intranet-tmpl/prog/en/includes/pos-menu.inc | 2 +- 4 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 installer/data/mysql/atomicupdate/bug_23355_permissions.perl diff --git a/installer/data/mysql/atomicupdate/bug_23355_permissions.perl b/installer/data/mysql/atomicupdate/bug_23355_permissions.perl new file mode 100644 index 0000000000..15251c0bb6 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_23355_permissions.perl @@ -0,0 +1,12 @@ +$DBversion = 'XXX'; # will be replaced by the RM +if ( CheckVersion($DBversion) ) { + + $dbh->do(qq{ + INSERT IGNORE permissions (module_bit, code, description) + VALUES + (25, 'cashup', 'Perform cash register cashup action') + }); + + SetVersion($DBversion); + print "Upgrade to $DBversion done (Bug 23355 - Add cash register cashup permissions)\n"; +} diff --git a/installer/data/mysql/userpermissions.sql b/installer/data/mysql/userpermissions.sql index 136c7b16bc..bad1b9ad44 100644 --- a/installer/data/mysql/userpermissions.sql +++ b/installer/data/mysql/userpermissions.sql @@ -121,5 +121,6 @@ INSERT INTO permissions (module_bit, code, description) VALUES (23, 'self_checkout_module', 'Perform self checkout at the OPAC. It should be used for the patron matching the AutoSelfCheckID'), (24, 'manage_rotas', 'Create, edit and delete rotas'), (24, 'manage_rota_items', 'Add and remove items from rotas'), + (25, 'cashup', 'Perform cash register cashup action'), (25, 'takepayment', 'Access the point of sale page and take payments') ; diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc index 3f7cb441c1..1e678c7dae 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc @@ -699,5 +699,10 @@ Access the point of sale page and take payments ([% name | html %]) + [%- CASE 'cashup' -%] + + Perform cash register cashup action + + ([% name | html %]) [%- END -%] [%- END -%] diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/pos-menu.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/pos-menu.inc index 85fd3b0634..bf3e75ba8f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/pos-menu.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/pos-menu.inc @@ -1,6 +1,6 @@