@@ -, +, @@
---
C4/Auth.pm | 3 ++-
C4/InstallAuth.pm | 1 +
.../bug-4461_manage_problem_reports_userflags.perl | 9 +++++++++
installer/data/mysql/userflags.sql | 3 ++-
installer/data/mysql/userpermissions.sql | 3 ++-
koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc | 9 +++++++++
6 files changed, 25 insertions(+), 3 deletions(-)
create mode 100644 installer/data/mysql/atomicupdate/bug-4461_manage_problem_reports_userflags.perl
--- a/C4/Auth.pm
+++ a/C4/Auth.pm
@@ -298,7 +298,7 @@ sub get_template_and_user {
my $all_perms = get_all_subpermissions();
my @flagroots = qw(circulate catalogue parameters borrowers permissions reserveforothers borrow
- editcatalogue updatecharges tools editauthorities serials reports acquisition clubs);
+ editcatalogue updatecharges tools editauthorities serials reports acquisition clubs problem_reports);
# We are going to use the $flags returned by checkauth
# to create the template's parameters that will indicate
@@ -323,6 +323,7 @@ sub get_template_and_user {
$template->param( CAN_user_clubs => 1 );
$template->param( CAN_user_ill => 1 );
$template->param( CAN_user_stockrotation => 1 );
+ $template->param( CAN_user_problem_reports => 1 );
foreach my $module ( keys %$all_perms ) {
foreach my $subperm ( keys %{ $all_perms->{$module} } ) {
--- a/C4/InstallAuth.pm
+++ a/C4/InstallAuth.pm
@@ -147,6 +147,7 @@ sub get_template_and_user {
$template->param( CAN_user_editauthorities => 1 );
$template->param( CAN_user_serials => 1 );
$template->param( CAN_user_reports => 1 );
+ $template->param( CAN_user_problem_reports => 1 );
}
my $minPasswordLength = C4::Context->preference('minPasswordLength');
--- a/installer/data/mysql/atomicupdate/bug-4461_manage_problem_reports_userflags.perl
+++ a/installer/data/mysql/atomicupdate/bug-4461_manage_problem_reports_userflags.perl
@@ -0,0 +1,9 @@
+$DBversion = 'XXX'; # will be replaced by the RM
+if( CheckVersion( $DBversion ) ) {
+ $dbh->do(q{INSERT IGNORE INTO userflags (bit, flag, flagdesc, defaulton) VALUES (26, 'problem_reports', 'Manage problem reports', 0) });
+ $dbh->do(q{INSERT IGNORE INTO permissions (module_bit, code, description) VALUES (26, 'manage_problem_reports', 'Manage OPAC problem reports') });
+
+ # Always end with this (adjust the bug info)
+ SetVersion( $DBversion );
+ print "Upgrade to $DBversion done (Bug 4461 - Add user permissions for managing OPAC problem reports)\n";
+}
--- a/installer/data/mysql/userflags.sql
+++ a/installer/data/mysql/userflags.sql
@@ -22,5 +22,6 @@ INSERT INTO userflags (bit, flag, flagdesc, defaulton) VALUES
(22,'ill','The Interlibrary Loans Module',0),
(23,'self_check','Self check modules',0),
(24, 'stockrotation', 'Manage stockrotation operations', 0),
-(25, 'cash_management', 'Cash management', 0)
+(25, 'cash_management', 'Cash management', 0),
+(26, 'problem_reports', 'Manage problem reports', 0)
;
--- a/installer/data/mysql/userpermissions.sql
+++ a/installer/data/mysql/userpermissions.sql
@@ -124,5 +124,6 @@ INSERT INTO permissions (module_bit, code, description) VALUES
(24, 'manage_rota_items', 'Add and remove items from rotas'),
(25, 'anonymous_refund', 'Perform refund actions from cash registers'),
(25, 'cashup', 'Perform cash register cashup action'),
- (25, 'takepayment', 'Access the point of sale page and take payments')
+ (25, 'takepayment', 'Access the point of sale page and take payments'),
+ (26, 'manage_problem_reports', 'Manage OPAC problem reports')
;
--- a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc
+++ a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc
@@ -72,6 +72,9 @@
[%- CASE 'cash_management' -%]
Cash management
([% name | html %])
+ [%- CASE 'problem_reports' -%]
+ OPAC problem reports management
+ ([% name | html %])
[%- END -%]
[%- END -%]
@@ -709,5 +712,11 @@
Perform anonymous refund actions
([% name | html %])
+ [%# problem_reports %]
+ [%- CASE 'manage_problem_reports' -%]
+
+ Manage OPAC problem reports
+
+ ([% name | html %])
[%- END -%]
[%- END -%]
--