Bugzilla – Attachment 186945 Details for
Bug 32682
Add permission for viewing patron reading history
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32682: Add permission for viewing patron reading history
Bug-32682-Add-permission-for-viewing-patron-readin.patch (text/plain), 3.03 KB, created by
Lucas Gass (lukeg)
on 2025-09-25 20:01:28 UTC
(
hide
)
Description:
Bug 32682: Add permission for viewing patron reading history
Filename:
MIME Type:
Creator:
Lucas Gass (lukeg)
Created:
2025-09-25 20:01:28 UTC
Size:
3.03 KB
patch
obsolete
>From a87b235057ebe5bb3476701e7a2cdd4a0094e6d8 Mon Sep 17 00:00:00 2001 >From: David Flater <flaterdavid@gmail.com> >Date: Mon, 7 Jul 2025 15:10:02 +0000 >Subject: [PATCH] Bug 32682: Add permission for viewing patron reading history > >--- > .../atomicupdate/bug_32682_add_permission.pl | 41 +++++++++++++++++++ > .../data/mysql/mandatory/userpermissions.sql | 1 + > 2 files changed, 42 insertions(+) > create mode 100755 installer/data/mysql/atomicupdate/bug_32682_add_permission.pl > >diff --git a/installer/data/mysql/atomicupdate/bug_32682_add_permission.pl b/installer/data/mysql/atomicupdate/bug_32682_add_permission.pl >new file mode 100755 >index 00000000000..f425e064913 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_32682_add_permission.pl >@@ -0,0 +1,41 @@ >+use Modern::Perl; >+use Koha::Installer::Output qw(say_warning say_success say_info); >+ >+return { >+ bug_number => "32682", >+ description => "Add permission for viewing patron reading 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_checkout_history', 'Viewing checkout history') >+ } >+ ); >+ >+ say $out "Added new permission 'view_checkout_history'"; >+ >+ my $IntranetBrowsingHistory = C4::Context->preference('intranetreadinghistory'); >+ if ($IntranetBrowsingHistory) { >+ >+ 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_checkout_history" ] } @borrowernumbers ); >+ foreach my $row (@rows_to_insert) { $insert_sth->execute( @{$row} ); } >+ >+ say_success( $out, "view_checkout_history added to all borrowers with edit_borrowers" ); >+ } >+ >+ }, >+}; >diff --git a/installer/data/mysql/mandatory/userpermissions.sql b/installer/data/mysql/mandatory/userpermissions.sql >index 509cfd79f38..bae3309ea4a 100644 >--- a/installer/data/mysql/mandatory/userpermissions.sql >+++ b/installer/data/mysql/mandatory/userpermissions.sql >@@ -51,6 +51,7 @@ INSERT INTO permissions (module_bit, code, description) VALUES > ( 4, 'list_borrowers', 'Search, list and view patrons'), > ( 4, 'send_messages_to_borrowers', 'Send messages to patrons'), > ( 4, 'view_borrower_infos_from_any_libraries', 'View patron infos from any libraries'), >+ ( 4, 'view_checkout_history', 'Viewing checkout history'), > ( 6, 'place_holds', 'Place holds for patrons'), > ( 6, 'modify_holds_priority', 'Modify holds priority'), > ( 6, 'alter_hold_targets', 'Move holds between items and records'), >-- >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 32682
:
183844
|
183845
|
183846
|
184571
|
184572
|
184832
|
184833
|
186944
| 186945 |
186946
|
186947
|
187591