Bugzilla – Attachment 92086 Details for
Bug 23321
Add 'cash registers' to the accounts system
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23321: Add cash register permission
Bug-23321-Add-cash-register-permission.patch (text/plain), 4.41 KB, created by
Martin Renvoize (ashimema)
on 2019-08-08 15:26:48 UTC
(
hide
)
Description:
Bug 23321: Add cash register permission
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2019-08-08 15:26:48 UTC
Size:
4.41 KB
patch
obsolete
>From 0af6a2cc8eb2be03ce442c2cb844c856440e7a7c Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Wed, 17 Jul 2019 14:03:30 +0100 >Subject: [PATCH] Bug 23321: Add cash register permission > >--- > .../atomicupdate/bug_23321_permissions.perl | 18 ++++++++++++++++++ > installer/data/mysql/userflags.sql | 3 ++- > installer/data/mysql/userpermissions.sql | 3 ++- > .../prog/en/includes/permissions.inc | 9 +++++++++ > members/member-flags.pl | 1 + > 5 files changed, 32 insertions(+), 2 deletions(-) > create mode 100644 installer/data/mysql/atomicupdate/bug_23321_permissions.perl > >diff --git a/installer/data/mysql/atomicupdate/bug_23321_permissions.perl b/installer/data/mysql/atomicupdate/bug_23321_permissions.perl >new file mode 100644 >index 0000000000..9d08ac49d7 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_23321_permissions.perl >@@ -0,0 +1,18 @@ >+$DBversion = 'XXX'; # will be replaced by the RM >+if ( CheckVersion($DBversion) ) { >+ >+ $dbh->do(qq{ >+ INSERT IGNORE INTO `userflags` (`bit`, `flag`, `flagdesc`, `defaulton`) >+ VALUES (25, 'cash_management', 'Cash management', 0) >+ }); >+ >+ $dbh->do(qq{ >+ INSERT IGNORE permissions (module_bit, code, description) >+ VALUES >+ (25, 'manage_cash_registers', 'Add and remove cash registers') >+ }); >+ >+ >+ SetVersion($DBversion); >+ print "Upgrade to $DBversion done (Bug 23321 - Add cash register permissions)\n"; >+} >diff --git a/installer/data/mysql/userflags.sql b/installer/data/mysql/userflags.sql >index 7712a9b709..5b1748d15d 100644 >--- a/installer/data/mysql/userflags.sql >+++ b/installer/data/mysql/userflags.sql >@@ -20,5 +20,6 @@ INSERT INTO userflags (bit, flag, flagdesc, defaulton) VALUES > (21, 'clubs', 'Patron clubs', '0'), > (22,'ill','The Interlibrary Loans Module',0), > (23,'self_check','Self check modules',0), >-(24, 'stockrotation', 'Manage stockrotation operations', 0) >+(24, 'stockrotation', 'Manage stockrotation operations', 0), >+(25, 'cash_management', 'Cash management', 0) > ; >diff --git a/installer/data/mysql/userpermissions.sql b/installer/data/mysql/userpermissions.sql >index 4401b5dda6..d9caa0e454 100644 >--- a/installer/data/mysql/userpermissions.sql >+++ b/installer/data/mysql/userpermissions.sql >@@ -116,5 +116,6 @@ INSERT INTO permissions (module_bit, code, description) VALUES > (23, 'self_checkin_module', 'Log into the self check-in module'), > (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') >+ (24, 'manage_rota_items', 'Add and remove items from rotas'), >+ (25, 'manage_cash_registers', 'Add and remove cash registers') > ; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc >index 26f779a1ff..e3faeddbba 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc >@@ -66,6 +66,9 @@ > [%- CASE 'stockrotation' -%] > <span class="main_permission self_check_permission">Manage stockrotation operations</span> > <span class="permissioncode">([% name | html %])</span> >+ [%- CASE 'cash_management' -%] >+ <span class="main_permission cash_management_permission">Cash management</span> >+ <span class="permissioncode">([% name | html %])</span> > [%- END -%] > [%- END -%] > >@@ -667,5 +670,11 @@ > Create, edit and delete rotas > </span> > <span class="permissioncode">([% name | html %])</span> >+ [%# cash_management %] >+ [%- CASE 'manage_cash_registers' -%] >+ <span class="sub_permission manage_cash_registers_subpermission"> >+ Add, edit and archive cash registers >+ </span> >+ <span class="permissioncode">([% name | html %])</span> > [%- END -%] > [%- END -%] >diff --git a/members/member-flags.pl b/members/member-flags.pl >index 9657a92246..f493a0605c 100755 >--- a/members/member-flags.pl >+++ b/members/member-flags.pl >@@ -178,6 +178,7 @@ if ($input->param('newflags')) { > if ($#sub_perm_loop > -1) { > $row{sub_perm_loop} = \@sub_perm_loop; > } >+ next if ( ( $row{flag} eq 'cash_management' ) && !C4::Context->preference('UseCashRegisters') ); > push @loop, \%row; > } > >-- >2.20.1
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 23321
:
91596
|
91597
|
91598
|
91599
|
91600
|
91601
|
91602
|
91621
|
92057
|
92058
|
92059
|
92060
|
92061
|
92062
|
92063
|
92064
|
92065
|
92083
|
92084
|
92085
|
92086
|
92087
|
92088
|
92089
|
92090
|
92091
|
92394
|
92395
|
92396
|
92397
|
92398
|
92399
|
92400
|
92401
|
92402
|
92467
|
92468
|
92469
|
92470
|
92471
|
92472
|
92473
|
92474
|
92475
|
92803
|
92804
|
92805
|
92806
|
92807
|
92808
|
92809
|
92810
|
92811
|
92812
|
92813
|
92814
|
92829
|
92879
|
92880
|
92881
|
92882
|
92883
|
92884
|
92885
|
92886
|
92887
|
92888
|
92889
|
93019
|
93020
|
93021
|
93022
|
93023
|
93024
|
93025
|
93026
|
93027
|
93028
|
93029
|
93030
|
93031
|
93032
|
93033
|
93034
|
93035
|
93188