Bugzilla – Attachment 187318 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: Implement holds history permission
Bug-40364-Implement-holds-history-permission.patch (text/plain), 5.07 KB, created by
Andrew Fuerste-Henry
on 2025-10-02 18:49:22 UTC
(
hide
)
Description:
Bug 40364: Implement holds history permission
Filename:
MIME Type:
Creator:
Andrew Fuerste-Henry
Created:
2025-10-02 18:49:22 UTC
Size:
5.07 KB
patch
obsolete
>From 80aebfd36921c7f77da9191230d15c06f08e3c1c Mon Sep 17 00:00:00 2001 >From: Andrew Fuerste Henry <andrew@bywatersolutions.com> >Date: Mon, 29 Sep 2025 20:04:56 +0000 >Subject: [PATCH] Bug 40364: Implement holds history permission > >To test: >1 - enable IntranetReadingHistoryHolds system preference >2 - make some holds for a patron, confirm you can see Holds History in the patron record when logged in as a superlibrarian >3 - log in as a non-superlibrarian with edit_borrowers permission, confirm you can see holds history in pthe patron record >4 - apply patch, updatedatabase, restat_all >5 - confirm you can see holds history as a superlibrarian >6 - confirm your non-superlibrarian from step 3 was given view_holds_history permission and can view holds history >7 - remove view_holds_history permission from your user, confirm you can no longer access holds history > >Signed-off-by: Trevor Diamond <trevor.diamond@mainlib.org> >--- > installer/data/mysql/mandatory/userpermissions.sql | 1 + > koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc | 10 ++++------ > .../intranet-tmpl/prog/en/includes/permissions.inc | 3 +++ > .../prog/en/modules/members/holdshistory.tt | 2 +- > 4 files changed, 9 insertions(+), 7 deletions(-) > >diff --git a/installer/data/mysql/mandatory/userpermissions.sql b/installer/data/mysql/mandatory/userpermissions.sql >index bae3309ea4a..0a7b1021ac4 100644 >--- a/installer/data/mysql/mandatory/userpermissions.sql >+++ b/installer/data/mysql/mandatory/userpermissions.sql >@@ -52,6 +52,7 @@ INSERT INTO permissions (module_bit, code, description) VALUES > ( 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'), >+ ( 4, 'view_holds_history', 'Viewing holds 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'), >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc >index ec41da18af2..a23cfdea5c8 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc >@@ -201,12 +201,10 @@ > <a href="/cgi-bin/koha/members/readingrec.pl?borrowernumber=[% patron.borrowernumber | uri %]">Circulation history</a> > </li> > [% END %] >- [% IF CAN_user_borrowers_edit_borrowers %] >- [% IF ( IntranetReadingHistoryHolds ) %] >- <li [% IF holdshistoryview %]class="active"[% END %]> >- <a href="/cgi-bin/koha/members/holdshistory.pl?borrowernumber=[% patron.borrowernumber | uri %]">Holds history</a> >- </li> >- [% END %] >+ [% IF (CAN_user_borrowers_view_holds_history && Koha.Preference('IntranetReadingHistoryHolds')) %] >+ <li [% IF holdshistoryview %]class="active"[% END %]> >+ <a href="/cgi-bin/koha/members/holdshistory.pl?borrowernumber=[% patron.borrowernumber | uri %]">Holds history</a> >+ </li> > [% END %] > [% IF ( CAN_user_tools_view_system_logs ) %] > <li [% IF logview %]class="active"[% END %]> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc >index e992cdc80c9..7e86b048985 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc >@@ -323,6 +323,9 @@ > [%- CASE 'view_checkout_history' -%] > <span class="sub_permission view_checkout_history"> Viewing checkout history </span> > <span class="permissioncode">([% name | html %])</span> >+ [%- CASE 'view_holds_history' -%] >+ <span class="sub_permission view_holds_history"> Viewing holds history </span> >+ <span class="permissioncode">([% name | html %])</span> > [%- CASE 'suggestions_manage' -%] > <span class="sub_permission suggestions_manage_subpermission"> Edit purchase suggestions </span> > <span class="permissioncode">([% name | html %])</span> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/holdshistory.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/holdshistory.tt >index 3fa944bdcf0..81bcd01e8bc 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/holdshistory.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/holdshistory.tt >@@ -43,7 +43,7 @@ > [% INCLUDE 'members-toolbar.inc' %] > <h1>Holds history</h1> > >- [% UNLESS Koha.Preference('IntranetReadingHistoryHolds') %] >+ [% UNLESS (Koha.Preference('IntranetReadingHistoryHolds') && CAN_user_borrowers_view_holds_history) %] > <div class="alert alert-warning">Staff members are not allowed to access patron's holds history</div> > [% ELSIF patron.is_anonymous %] > <div class="alert alert-warning">This is the anonymous patron, so no holds history is displayed.</div> >-- >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