From e1791e90d9b84a757b32d7a6a3780cefe125ed87 Mon Sep 17 00:00:00 2001 From: William Lavoie Date: Mon, 27 Jan 2025 14:49:24 -0500 Subject: [PATCH] Bug 38040: Prevent editing other libraries' holds when IndependentBranches is enabled --- .../prog/en/modules/reserve/request.tt | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt index 22bd8a8ab9..804c526168 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt @@ -1860,6 +1860,22 @@ return false; }); + [% IF (!CAN_user_superlibrarian) %] + var user_branch = "[% Branches.GetLoggedInBranchcode %]"; + if(user_branch !== undefined && user_branch !== ""){ + $('#patron_holds_table tbody tr').each(function() { + var link = $(this).find('a[href*="member"]'); + var rankRequest = $(this).find("select[name='rank-request']"); + if (!link.length){ + $(this).find('.cancel-hold, .fa-trash').addClass('disabled_trash'); + } + $(this).find('.select_hold, .rank-request, td a[data-op="cud-move"], .flatpickr, .toggle-suspend, .clear_date, [name*="change_hold_type_"]').addClass('disabled').attr('disabled', 'disabled'); + $('.select_hold_all, .hold-arrow').addClass('disabled').attr('disabled', 'disabled'); + $('.suspend-hold').prop('disabled', true); + }); + } + [% END %] + [% UNLESS ( patron || patron.borrowernumber || borrowers || noitems || nobiblio ) %] [% IF ( PatronAutoComplete ) %] patron_autocomplete($(".search_patron_filter"), { 'link-to': 'reserve', 'url-params': '[% url_biblio_params | url %]' }); -- 2.43.0