Bugzilla – Attachment 187065 Details for
Bug 40364
Add permission for viewing patron holds history
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 40364: Atomicupdate to add permission
Bug-40364-Atomicupdate-to-add-permission.patch (text/plain), 2.21 KB, created by
Andrew Fuerste-Henry
on 2025-09-29 20:10:16 UTC
(
hide
)
Description:
Bug 40364: Atomicupdate to add permission
Filename:
MIME Type:
Creator:
Andrew Fuerste-Henry
Created:
2025-09-29 20:10:16 UTC
Size:
2.21 KB
patch
obsolete
>From 53c88bf11735e86c376f3b003e0057d2b6fe7a20 Mon Sep 17 00:00:00 2001 >From: Andrew Fuerste Henry <andrew@bywatersolutions.com> >Date: Mon, 29 Sep 2025 19:52:02 +0000 >Subject: [PATCH] Bug 40364: Atomicupdate to add permission > >--- > .../bug_40364_add_holds_history_permission.pl | 41 +++++++++++++++++++ > 1 file changed, 41 insertions(+) > create mode 100755 installer/data/mysql/atomicupdate/bug_40364_add_holds_history_permission.pl > >diff --git a/installer/data/mysql/atomicupdate/bug_40364_add_holds_history_permission.pl b/installer/data/mysql/atomicupdate/bug_40364_add_holds_history_permission.pl >new file mode 100755 >index 00000000000..b59b29126b4 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_40364_add_holds_history_permission.pl >@@ -0,0 +1,41 @@ >+use Modern::Perl; >+use Koha::Installer::Output qw(say_warning say_success say_info); >+ >+return { >+ bug_number => "40364", >+ description => "Add permission for viewing patron holds history", >+ up => sub { >+ my ($args) = @_; >+ my ( $dbh, $out ) = @$args{qw(dbh out)}; >+ >+ $dbh->do( >+ q{ >+ INSERT IGNORE permissions (module_bit, code, description) VALUES >+ (4, 'view_holds_history', 'Viewing holds history') >+ } >+ ); >+ >+ say $out "Added new permission 'view_holds_history'"; >+ >+ my $IntranetHoldsHistory = C4::Context->preference('IntranetReadingHistoryHolds'); >+ if ($IntranetHoldsHistory) { >+ >+ my $insert_sth = $dbh->prepare( >+ "INSERT IGNORE INTO user_permissions (borrowernumber, module_bit, code) VALUES (?, ?, ?)"); >+ >+ my $sth = $dbh->prepare("SELECT borrowernumber FROM user_permissions WHERE code = 'edit_borrowers'"); >+ $sth->execute(); >+ >+ my @borrowernumbers; >+ while ( my ($borrowernumber) = $sth->fetchrow_array() ) { >+ push @borrowernumbers, $borrowernumber; >+ } >+ >+ my @rows_to_insert = ( map { [ $_, 4, "view_holds_history" ] } @borrowernumbers ); >+ foreach my $row (@rows_to_insert) { $insert_sth->execute( @{$row} ); } >+ >+ say_success( $out, "view_holds_history added to all borrowers with edit_borrowers" ); >+ } >+ >+ }, >+}; >-- >2.39.5
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 40364
:
187065
|
187066
|
187298
|
187305
|
187317
|
187318
|
187319
|
188394
|
188395