From c92b8fdb36d7601513f735782481399c025987b3 Mon Sep 17 00:00:00 2001 From: Andrew Fuerste Henry 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 Signed-off-by: Matt Blenkinsop --- 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 0c475d15ea8..6360d207740 100644 --- a/installer/data/mysql/mandatory/userpermissions.sql +++ b/installer/data/mysql/mandatory/userpermissions.sql @@ -53,6 +53,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 cbe2dcc6d20..3da4df726d1 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc @@ -206,12 +206,10 @@ Circulation history [% END %] - [% IF CAN_user_borrowers_edit_borrowers %] - [% IF ( IntranetReadingHistoryHolds ) %] -
  • - Holds history -
  • - [% END %] + [% IF (CAN_user_borrowers_view_holds_history && Koha.Preference('IntranetReadingHistoryHolds')) %] +
  • + Holds history +
  • [% END %] [% IF ( CAN_user_tools_view_system_logs ) %]
  • diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc index 700b49a0973..02edbcc210d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc @@ -332,6 +332,9 @@ [%- CASE 'view_checkout_history' -%] Viewing checkout history ([% name | html %]) + [%- CASE 'view_holds_history' -%] + Viewing holds history + ([% name | html %]) [%- CASE 'suggestions_manage' -%] Edit purchase suggestions ([% name | html %]) 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 3145bc14241..097c6f5f685 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/holdshistory.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/holdshistory.tt @@ -44,7 +44,7 @@ [% INCLUDE 'members-toolbar.inc' %]

    Holds history

    - [% UNLESS Koha.Preference('IntranetReadingHistoryHolds') %] + [% UNLESS (Koha.Preference('IntranetReadingHistoryHolds') && CAN_user_borrowers_view_holds_history) %]
    Staff members are not allowed to access patron's holds history
    [% ELSIF patron.is_anonymous %]
    This is the anonymous patron, so no holds history is displayed.
    -- 2.39.5