Bugzilla – Attachment 179714 Details for
Bug 38040
IndependentBranches doesn't prevent editing other libraries' holds
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38040: [alternate] Restrict hold management if cannot see patron data
Bug-38040-alternate-Restrict-hold-management-if-ca.patch (text/plain), 42.47 KB, created by
David Cook
on 2025-03-26 01:30:27 UTC
(
hide
)
Description:
Bug 38040: [alternate] Restrict hold management if cannot see patron data
Filename:
MIME Type:
Creator:
David Cook
Created:
2025-03-26 01:30:27 UTC
Size:
42.47 KB
patch
obsolete
>From cce39e9d555003da4e2b187227a7d208e102d13a Mon Sep 17 00:00:00 2001 >From: David Cook <dcook@prosentient.com.au> >Date: Wed, 26 Mar 2025 01:26:04 +0000 >Subject: [PATCH] Bug 38040: [alternate] Restrict hold management if cannot see > patron data > >This patch leverages the Koha::Patron->can_see_patron_infos() function >to determine whether or not the UI will display hold management functions. If >the logged in user cannot see the patron info, it seems to follow that they should not >be able to manage the hold either. > >NOTE: This should work for both IndependentBranches and Library Group functionality. > >This is only the front-end modification. > >To be coded: a back-end modification that throws a 403 >for stateful actions to holds the logged in user is not allowed to manage. >--- > .../prog/en/includes/holds_table.inc | 522 +++++++++--------- > reserve/request.pl | 5 + > 2 files changed, 275 insertions(+), 252 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc >index 2d65e83dc1..1db42d0124 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc >@@ -49,249 +49,263 @@ > [%- END -%] > [% SET tr_class = hold.suspend ? 'suspend' : '' %] > <tr class="[% tr_class | html %]"> >- <td><input type="checkbox" class="select_hold" data-id="[% hold.reserve_id | html %]" /></td> >+ <td>[% IF ( hold.can_be_managed ) %]<input type="checkbox" class="select_hold" data-id="[% hold.reserve_id | html %]" />[% END %]</td> > <td> >- <input type="hidden" name="reserve_id" value="[% hold.reserve_id | html %]" /> >- <input type="hidden" name="borrowernumber" value="[% hold.borrowernumber | html %]" /> >- <input type="hidden" name="biblionumber" value="[% hold.biblionumber | html %]" /> >- [% IF ( CAN_user_reserveforothers_modify_holds_priority ) %] >- [% IF Koha.Preference('HoldsSplitQueue') == "nothing" && !hold.found %] >- <select name="rank-request" class="rank-request" data-hold-id="[% hold.reserve_id | html %]"> >- [% IF ( CAN_user_reserveforothers_modify_holds_priority ) %] >- [% FOREACH priority IN all_priorities %] >- [% IF priority == this_priority %] >- <option value="[% priority | html %]" selected="selected">[% priority | html %]</option> >- [% ELSIF priority > 0 %] >- <option value="[% priority | html %]">[% priority | html %]</option> >+ [% IF ( hold.can_be_managed ) %] >+ <input type="hidden" name="reserve_id" value="[% hold.reserve_id | html %]" /> >+ <input type="hidden" name="borrowernumber" value="[% hold.borrowernumber | html %]" /> >+ <input type="hidden" name="biblionumber" value="[% hold.biblionumber | html %]" /> >+ [% IF ( CAN_user_reserveforothers_modify_holds_priority ) %] >+ [% IF Koha.Preference('HoldsSplitQueue') == "nothing" && !hold.found %] >+ <select name="rank-request" class="rank-request" data-hold-id="[% hold.reserve_id | html %]"> >+ [% IF ( CAN_user_reserveforothers_modify_holds_priority ) %] >+ [% FOREACH priority IN all_priorities %] >+ [% IF priority == this_priority %] >+ <option value="[% priority | html %]" selected="selected">[% priority | html %]</option> >+ [% ELSIF priority > 0 %] >+ <option value="[% priority | html %]">[% priority | html %]</option> >+ [% END %] > [% END %] >+ [% ELSE %] >+ <option value="[% hold.priority | html %]" selected="selected">[% this_priority | html %]</option> > [% END %] >- [% ELSE %] >- <option value="[% hold.priority | html %]" selected="selected">[% this_priority | html %]</option> >- [% END %] >- <option value="del">del</option> >- </select> >- [% ELSE %] >- <input type="hidden" name="rank-request" class="rank-request" value="[% hold.priority | html %]" data-hold-id="[% hold.reserve_id | html %]" /> >- <select name="rank-request" class="rank-request" disabled="disabled" data-hold-id="[% hold.reserve_id | html %]"> >- [% IF ( hold.found ) %] >- [% IF ( hold.intransit ) %] >- <option value="T" selected="selected">In transit</option> >- [% ELSIF (hold.inprocessing) %] >- <option value="P" selected="selected">In processing</option> >+ <option value="del">del</option> >+ </select> >+ [% ELSE %] >+ <input type="hidden" name="rank-request" class="rank-request" value="[% hold.priority | html %]" data-hold-id="[% hold.reserve_id | html %]" /> >+ <select name="rank-request" class="rank-request" disabled="disabled" data-hold-id="[% hold.reserve_id | html %]"> >+ [% IF ( hold.found ) %] >+ [% IF ( hold.intransit ) %] >+ <option value="T" selected="selected">In transit</option> >+ [% ELSIF (hold.inprocessing) %] >+ <option value="P" selected="selected">In processing</option> >+ [% ELSE %] >+ <option value="W" selected="selected">Waiting</option> >+ [% END %] > [% ELSE %] >- <option value="W" selected="selected">Waiting</option> >+ <option value="[% hold.priority | html %]" selected="selected">[% this_priority | html %]</option> > [% END %] >- [% ELSE %] >- <option value="[% hold.priority | html %]" selected="selected">[% this_priority | html %]</option> >- [% END %] >- </select> >+ </select> >+ [% END %] >+ [% ELSE %] >+ <input type="hidden" name="rank-request" class="rank-request" value="[% hold.priority | html %]" data-hold-id="[% hold.reserve_id | html %]" /> >+ [% hold.priority | html %] > [% END %] >- [% ELSE %] >- <input type="hidden" name="rank-request" class="rank-request" value="[% hold.priority | html %]" data-hold-id="[% hold.reserve_id | html %]" /> >- [% hold.priority | html %] > [% END %] > </td> > [%- IF ( CAN_user_reserveforothers_modify_holds_priority ) -%] >- [%- UNLESS hold.found -%] >- [%- SET prev_priority = loop.prev.priority -%] >- [%- SET next_priority = loop.next.priority -%] >- <td style="white-space:nowrap;"> >- <a >- class="hold-arrow" >- title="Move hold up" >- data-op="cud-move" >- data-where="up" >- data-first_priority="[% first_priority | html %]" >- data-last_priority="[% last_priority | html %]" >- data-prev_priority="[% prev_priority | html %]" >- data-next_priority="[% next_priority | html %]" >- data-borrowernumber="[% hold.borrowernumber | html %]" >- data-biblionumber="[% hold.biblionumber | html %]" >- data-reserve_id="[% hold.reserve_id | html %]" >- data-date="[% hold.date | html %]" >- > >- <i class="fa fa-lg icon-move-hold-up" aria-hidden="true"></i> >- </a> >+ [% IF ( hold.can_be_managed ) %] >+ [%- UNLESS hold.found -%] >+ [%- SET prev_priority = loop.prev.priority -%] >+ [%- SET next_priority = loop.next.priority -%] >+ <td style="white-space:nowrap;"> >+ <a >+ class="hold-arrow" >+ title="Move hold up" >+ data-op="cud-move" >+ data-where="up" >+ data-first_priority="[% first_priority | html %]" >+ data-last_priority="[% last_priority | html %]" >+ data-prev_priority="[% prev_priority | html %]" >+ data-next_priority="[% next_priority | html %]" >+ data-borrowernumber="[% hold.borrowernumber | html %]" >+ data-biblionumber="[% hold.biblionumber | html %]" >+ data-reserve_id="[% hold.reserve_id | html %]" >+ data-date="[% hold.date | html %]" >+ > >+ <i class="fa fa-lg icon-move-hold-up" aria-hidden="true"></i> >+ </a> > >- <a >- class="hold-arrow" >- title="Move hold to top" >- data-op="cud-move" >- data-where="top" >- data-first_priority="[% first_priority | html %]" >- data-last_priority="[% last_priority | html %]" >- data-prev_priority="[% prev_priority | html %]" >- data-next_priority="[% next_priority | html %]" >- data-borrowernumber="[% hold.borrowernumber | html %]" >- data-biblionumber="[% hold.biblionumber | html %]" >- data-reserve_id="[% hold.reserve_id | html %]" >- data-date="[% hold.date | html %]" >- > >- <i class="fa fa-lg icon-move-hold-top" aria-hidden="true"></i> >- </a> >+ <a >+ class="hold-arrow" >+ title="Move hold to top" >+ data-op="cud-move" >+ data-where="top" >+ data-first_priority="[% first_priority | html %]" >+ data-last_priority="[% last_priority | html %]" >+ data-prev_priority="[% prev_priority | html %]" >+ data-next_priority="[% next_priority | html %]" >+ data-borrowernumber="[% hold.borrowernumber | html %]" >+ data-biblionumber="[% hold.biblionumber | html %]" >+ data-reserve_id="[% hold.reserve_id | html %]" >+ data-date="[% hold.date | html %]" >+ > >+ <i class="fa fa-lg icon-move-hold-top" aria-hidden="true"></i> >+ </a> > >- <a >- class="hold-arrow" >- title="Move hold to bottom" >- data-op="cud-move" >- data-where="bottom" >- data-first_priority="[% first_priority | html %]" >- data-last_priority="[% last_priority | html %]" >- data-prev_priority="[% prev_priority | html %]" >- data-next_priority="[% next_priority | html %]" >- data-borrowernumber="[% hold.borrowernumber | html %]" >- data-biblionumber="[% hold.biblionumber | html %]" >- data-reserve_id="[% hold.reserve_id | html %]" >- data-date="[% hold.date | html %]" >- > >- <i class="fa fa-lg icon-move-hold-bottom" aria-hidden="true"></i> >- </a> >+ <a >+ class="hold-arrow" >+ title="Move hold to bottom" >+ data-op="cud-move" >+ data-where="bottom" >+ data-first_priority="[% first_priority | html %]" >+ data-last_priority="[% last_priority | html %]" >+ data-prev_priority="[% prev_priority | html %]" >+ data-next_priority="[% next_priority | html %]" >+ data-borrowernumber="[% hold.borrowernumber | html %]" >+ data-biblionumber="[% hold.biblionumber | html %]" >+ data-reserve_id="[% hold.reserve_id | html %]" >+ data-date="[% hold.date | html %]" >+ > >+ <i class="fa fa-lg icon-move-hold-bottom" aria-hidden="true"></i> >+ </a> > >- <a >- class="hold-arrow" >- title="Move hold down" >- data-op="cud-move" >- data-where="down" >- data-first_priority="[% first_priority | html %]" >- data-last_priority="[% last_priority | html %]" >- data-prev_priority="[% prev_priority | html %]" >- data-next_priority="[% next_priority | html %]" >- data-borrowernumber="[% hold.borrowernumber | html %]" >- data-biblionumber="[% hold.biblionumber | html %]" >- data-reserve_id="[% hold.reserve_id | html %]" >- data-date="[% hold.date | html %]" >- > >- <i class="fa fa-lg icon-move-hold-down" aria-hidden="true"></i> >- </a> >- </td> >+ <a >+ class="hold-arrow" >+ title="Move hold down" >+ data-op="cud-move" >+ data-where="down" >+ data-first_priority="[% first_priority | html %]" >+ data-last_priority="[% last_priority | html %]" >+ data-prev_priority="[% prev_priority | html %]" >+ data-next_priority="[% next_priority | html %]" >+ data-borrowernumber="[% hold.borrowernumber | html %]" >+ data-biblionumber="[% hold.biblionumber | html %]" >+ data-reserve_id="[% hold.reserve_id | html %]" >+ data-date="[% hold.date | html %]" >+ > >+ <i class="fa fa-lg icon-move-hold-down" aria-hidden="true"></i> >+ </a> >+ </td> >+ [% END %] > [%- ELSE -%] > <td></td> > [%- END -%] > [%- END -%] > <td> [% INCLUDE 'patron-title.inc' patron=hold.patron hide_patron_infos_if_needed=1 %] </td> >- <td>[% hold.notes | html | html_line_break %]</td> >+ <td>[% IF ( hold.can_be_managed ) %][% hold.notes | html | html_line_break %][% END %]</td> > <td data-order="[% hold.date| html %]"> >- [% IF Koha.Preference('AllowHoldDateInFuture') %] >- <input type="text" class="flatpickr" value="[% hold.date | html %]" required="required" size="10" name="reservedate" /> >- [% ELSE %] >- [% hold.date | $KohaDates %] >+ [% IF ( hold.can_be_managed ) %] >+ [% IF Koha.Preference('AllowHoldDateInFuture') %] >+ <input type="text" class="flatpickr" value="[% hold.date | html %]" required="required" size="10" name="reservedate" /> >+ [% ELSE %] >+ [% hold.date | $KohaDates %] >+ [% END %] > [% END %] > </td> > <td> >- <input type="text" class="flatpickr" data-flatpickr-futuredate="true" value="[% hold.expirationdate | html %]" size="10" name="expirationdate" /> >+ [% IF ( hold.can_be_managed ) %] >+ <input type="text" class="flatpickr" data-flatpickr-futuredate="true" value="[% hold.expirationdate | html %]" size="10" name="expirationdate" /> >+ [% END %] > </td> > <td> >- [%- IF ( hold.found ) -%] >- <input type="hidden" name="pickup" value="[% hold.wbrcode | html %]" /> >- [%- IF ( hold.atdestination ) -%] >- Item waiting at <strong> [% hold.wbrname | html %]</strong>[% IF hold.desk_name %], [% hold.desk_name | html %],[% END %] since [% hold.waiting_date | $KohaDates %] >- [%- ELSIF (hold.intransit) -%] >- Item being transferred to <strong> [% hold.wbrname | html %]</strong> >- [%- ELSIF (hold.inprocessing) -%] >- Item being processed at <strong> [% hold.wbrname | html %]</strong> >- [%- ELSE -%] >- Hold expected at <strong>[% hold.wbrname | html %]</strong>, please checkin to verify status >- [%- END -%] >- [%- ELSE -%] >- [%- IF Koha.Preference('IndependentBranches') && Branches.all().size == 1 -%] >- [% Branches.GetName(hold.branchcode) | html %] <input type="hidden" name="pickup" value="[% hold.branchcode | html %]" /> >+ [% IF ( hold.can_be_managed ) %] >+ [%- IF ( hold.found ) -%] >+ <input type="hidden" name="pickup" value="[% hold.wbrcode | html %]" /> >+ [%- IF ( hold.atdestination ) -%] >+ Item waiting at <strong> [% hold.wbrname | html %]</strong>[% IF hold.desk_name %], [% hold.desk_name | html %],[% END %] since [% hold.waiting_date | $KohaDates %] >+ [%- ELSIF (hold.intransit) -%] >+ Item being transferred to <strong> [% hold.wbrname | html %]</strong> >+ [%- ELSIF (hold.inprocessing) -%] >+ Item being processed at <strong> [% hold.wbrname | html %]</strong> >+ [%- ELSE -%] >+ Hold expected at <strong>[% hold.wbrname | html %]</strong>, please checkin to verify status >+ [%- END -%] > [%- ELSE -%] >- <select class="pickup_location_dropdown" data-selected="[% hold.branchcode | html %]" data-hold-id="[% hold.reserve_id | html %]" data-pickup-location-source="hold" name="pickup"> >- <option selected="selected" value="[% hold.branchcode | html %]">[% Branches.GetName(hold.branchcode) | html %]</option> >- <option value="" disabled="disabled" class="loading">Loading...</option> >- </select> >- <img class="loading_[% hold.reserve_id | html %]" src="[% interface | html %]/[% theme | html %]/img/spinner-small.gif" alt="" style="display:none;" /> >+ [%- IF Koha.Preference('IndependentBranches') && Branches.all().size == 1 -%] >+ [% Branches.GetName(hold.branchcode) | html %] <input type="hidden" name="pickup" value="[% hold.branchcode | html %]" /> >+ [%- ELSE -%] >+ <select class="pickup_location_dropdown" data-selected="[% hold.branchcode | html %]" data-hold-id="[% hold.reserve_id | html %]" data-pickup-location-source="hold" name="pickup"> >+ <option selected="selected" value="[% hold.branchcode | html %]">[% Branches.GetName(hold.branchcode) | html %]</option> >+ <option value="" disabled="disabled" class="loading">Loading...</option> >+ </select> >+ <img class="loading_[% hold.reserve_id | html %]" src="[% interface | html %]/[% theme | html %]/img/spinner-small.gif" alt="" style="display:none;" /> >+ [%- END -%] > [%- END -%] >- [%- END -%] >+ [% END %] > </td> > <td> >- [%- IF ( hold.found ) -%] >- <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% hold.biblionumber | uri %]&itemnumber=[% hold.itemnumber | uri %]#item[% hold.itemnumber | uri %]"> >- [%- IF ( hold.barcodenumber ) -%] >- [%- hold.barcodenumber | html -%] >- [%- ELSE -%] >- <span>No barcode</span> >- [%- END -%] >- <input type="hidden" name="itemnumber" value="[% hold.itemnumber | html %]" /> >- </a> >- [%- ELSE -%] >- [%- IF ( hold.item_level_hold ) -%] >- <em> >- [%- IF ! hold.change_hold_type_allowed -%] >- <span>Only item</span> >- <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% hold.biblionumber | uri %]&itemnumber=[% hold.itemnumber | uri %]#item[% hold.itemnumber | uri %]"> >- [%- IF ( hold.barcodenumber ) -%] >- [%- hold.barcodenumber | html -%] >- [%- ELSE -%] >- <span>No barcode</span> >- [%- END -%] >- <input type="hidden" name="itemnumber" value="[% hold.itemnumber | html %]" /> >- </a> >+ [% IF ( hold.can_be_managed ) %] >+ [%- IF ( hold.found ) -%] >+ <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% hold.biblionumber | uri %]&itemnumber=[% hold.itemnumber | uri %]#item[% hold.itemnumber | uri %]"> >+ [%- IF ( hold.barcodenumber ) -%] >+ [%- hold.barcodenumber | html -%] > [%- ELSE -%] >- <select name="change_hold_type_[% hold.reserve_id | html %]"> >- <option selected="selected" value="" >- >Only item >+ <span>No barcode</span> >+ [%- END -%] >+ <input type="hidden" name="itemnumber" value="[% hold.itemnumber | html %]" /> >+ </a> >+ [%- ELSE -%] >+ [%- IF ( hold.item_level_hold ) -%] >+ <em> >+ [%- IF ! hold.change_hold_type_allowed -%] >+ <span>Only item</span> >+ <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% hold.biblionumber | uri %]&itemnumber=[% hold.itemnumber | uri %]#item[% hold.itemnumber | uri %]"> > [%- IF ( hold.barcodenumber ) -%] > [%- hold.barcodenumber | html -%] > [%- ELSE -%] >- No barcode >+ <span>No barcode</span> > [%- END -%] >- </option> >- <option value="1">Next available</option> >- </select> >- [%- IF ( hold.itemnumber ) -%] >- <input type="hidden" name="itemnumber" value="[% hold.itemnumber | html %]" /> >- [%- END -%] >- [%- IF hold.itemtype -%] >- <span style="display:none">Next available [% ItemTypes.GetDescription( hold.itemtype ) | html %] item</span> >+ <input type="hidden" name="itemnumber" value="[% hold.itemnumber | html %]" /> >+ </a> > [%- ELSE -%] >- <span style="display:none">Next available</span> >+ <select name="change_hold_type_[% hold.reserve_id | html %]"> >+ <option selected="selected" value="" >+ >Only item >+ [%- IF ( hold.barcodenumber ) -%] >+ [%- hold.barcodenumber | html -%] >+ [%- ELSE -%] >+ No barcode >+ [%- END -%] >+ </option> >+ <option value="1">Next available</option> >+ </select> >+ [%- IF ( hold.itemnumber ) -%] >+ <input type="hidden" name="itemnumber" value="[% hold.itemnumber | html %]" /> >+ [%- END -%] >+ [%- IF hold.itemtype -%] >+ <span style="display:none">Next available [% ItemTypes.GetDescription( hold.itemtype ) | html %] item</span> >+ [%- ELSE -%] >+ <span style="display:none">Next available</span> >+ [%- END -%] > [%- END -%] >- [%- END -%] >- </em> >- [%- ELSE -%] >- [%- IF hold.itemtype -%] >- <em>Next available [% ItemTypes.GetDescription( hold.itemtype ) | html %] item</em> >- [%- ELSIF hold.object.item_group -%] >- <em>Next available item from group <strong>[% hold.object.item_group.description | html %]</strong></em> >+ </em> > [%- ELSE -%] >- <em>Next available</em> >- [%- END -%] >+ [%- IF hold.itemtype -%] >+ <em>Next available [% ItemTypes.GetDescription( hold.itemtype ) | html %] item</em> >+ [%- ELSIF hold.object.item_group -%] >+ <em>Next available item from group <strong>[% hold.object.item_group.description | html %]</strong></em> >+ [%- ELSE -%] >+ <em>Next available</em> >+ [%- END -%] > >- <input type="hidden" name="itemnumber" value="" /> >+ <input type="hidden" name="itemnumber" value="" /> >+ [%- END -%] > [%- END -%] >- [%- END -%] >- [%- IF hold.non_priority -%] >- <br /><i>Non priority hold</i> >- [%- END -%] >+ [%- IF hold.non_priority -%] >+ <br /><i>Non priority hold</i> >+ [%- END -%] >+ [% END %] > </td> > [%- IF ( CAN_user_reserveforothers_modify_holds_priority ) -%] > [%- UNLESS hold.found -%] > <td> >- [% IF ( hold.lowestPriority ) %] >- <a >- class="hold-arrow" >- title="Remove lowest priority" >- data-op="cud-setLowestPriority" >- data-borrowernumber="[% hold.borrowernumber | html %]" >- data-biblionumber="[% hold.biblionumber | html %]" >- data-reserve_id="[% hold.reserve_id | html %]" >- data-date="[% hold.date | html %]" >- > >- <i class="fa fa-lg fa-rotate-90 icon-unset-lowest" aria-hidden="true"></i> >- </a> >- [% ELSE %] >- <a >- class="hold-arrow" >- title="Set lowest priority" >- data-op="cud-setLowestPriority" >- data-borrowernumber="[% hold.borrowernumber | html %]" >- data-biblionumber="[% hold.biblionumber | html %]" >- data-reserve_id="[% hold.reserve_id | html %]" >- data-date="[% hold.date | html %]" >- > >- <i class="fa fa-lg fa-rotate-90 icon-set-lowest" aria-hidden="true"></i> >- </a> >+ [% IF ( hold.can_be_managed ) %] >+ [% IF ( hold.lowestPriority ) %] >+ <a >+ class="hold-arrow" >+ title="Remove lowest priority" >+ data-op="cud-setLowestPriority" >+ data-borrowernumber="[% hold.borrowernumber | html %]" >+ data-biblionumber="[% hold.biblionumber | html %]" >+ data-reserve_id="[% hold.reserve_id | html %]" >+ data-date="[% hold.date | html %]" >+ > >+ <i class="fa fa-lg fa-rotate-90 icon-unset-lowest" aria-hidden="true"></i> >+ </a> >+ [% ELSE %] >+ <a >+ class="hold-arrow" >+ title="Set lowest priority" >+ data-op="cud-setLowestPriority" >+ data-borrowernumber="[% hold.borrowernumber | html %]" >+ data-biblionumber="[% hold.biblionumber | html %]" >+ data-reserve_id="[% hold.reserve_id | html %]" >+ data-date="[% hold.date | html %]" >+ > >+ <i class="fa fa-lg fa-rotate-90 icon-set-lowest" aria-hidden="true"></i> >+ </a> >+ [% END %] > [% END %] > </td> > [%- ELSE -%] >@@ -299,63 +313,67 @@ > [%- END -%] > [%- END -%] > <td> >- <a class="cancel-hold" title="Cancel hold" data-borrowernumber="[% hold.borrowernumber | html %]" data-biblionumber="[% hold.biblionumber | html %]" data-id="[% hold.reserve_id | html %]" href="#"> >- <i class="fa fa-trash" aria-label="Cancel hold"></i> >- </a> >+ [% IF ( hold.can_be_managed ) %] >+ <a class="cancel-hold" title="Cancel hold" data-borrowernumber="[% hold.borrowernumber | html %]" data-biblionumber="[% hold.biblionumber | html %]" data-id="[% hold.reserve_id | html %]" href="#"> >+ <i class="fa fa-trash" aria-label="Cancel hold"></i> >+ </a> >+ [% END %] > </td> > <td> >- [% IF Koha.Preference('SuspendHoldsIntranet') %] >- [% UNLESS ( hold.found ) %] >- [% IF ( hold.suspend ) %] >- <button class="btn btn-default btn-xs unsuspend-hold" data-reserve-id="[% hold.reserve_id | html %]" data-biblionumber="[% hold.biblionumber | html %]"> >- <i class="fa fa-play" aria-hidden="true"></i> Unsuspend >- </button> >- [% ELSE %] >- <button class="btn btn-default btn-xs suspend-hold" data-reserve-id="[% hold.reserve_id | html %]" data-biblionumber="[% hold.biblionumber | html %]"> >- <i class="fa fa-pause" aria-hidden="true"></i> Suspend >- </button> >- [% END %] >+ [% IF ( hold.can_be_managed ) %] >+ [% IF Koha.Preference('SuspendHoldsIntranet') %] >+ [% UNLESS ( hold.found ) %] >+ [% IF ( hold.suspend ) %] >+ <button class="btn btn-default btn-xs unsuspend-hold" data-reserve-id="[% hold.reserve_id | html %]" data-biblionumber="[% hold.biblionumber | html %]"> >+ <i class="fa fa-play" aria-hidden="true"></i> Unsuspend >+ </button> >+ [% ELSE %] >+ <button class="btn btn-default btn-xs suspend-hold" data-reserve-id="[% hold.reserve_id | html %]" data-biblionumber="[% hold.biblionumber | html %]"> >+ <i class="fa fa-pause" aria-hidden="true"></i> Suspend >+ </button> >+ [% END %] > >- [% IF Koha.Preference('AutoResumeSuspendedHolds') %] >- <label for="suspend_until_[% hold.reserve_id | html %]">[% IF ( hold.suspend ) %]on[% ELSE %]until[% END %]</label> >- <input >- type="text" >- name="suspend_until_[% hold.reserve_id | html %]" >- id="suspend_until_[% hold.reserve_id | html %]" >- size="10" >- value="[% hold.suspend_until | html %]" >- class="flatpickr" >- data-flatpickr-futuredate="true" >- /> >- [%- ELSE -%] >- <input type="hidden" name="suspend_until_[% hold.reserve_id | html %]" id="suspend_until_[% hold.reserve_id | html %]" value="" /> >+ [% IF Koha.Preference('AutoResumeSuspendedHolds') %] >+ <label for="suspend_until_[% hold.reserve_id | html %]">[% IF ( hold.suspend ) %]on[% ELSE %]until[% END %]</label> >+ <input >+ type="text" >+ name="suspend_until_[% hold.reserve_id | html %]" >+ id="suspend_until_[% hold.reserve_id | html %]" >+ size="10" >+ value="[% hold.suspend_until | html %]" >+ class="flatpickr" >+ data-flatpickr-futuredate="true" >+ /> >+ [%- ELSE -%] >+ <input type="hidden" name="suspend_until_[% hold.reserve_id | html %]" id="suspend_until_[% hold.reserve_id | html %]" value="" /> >+ [%- END -%] > [%- END -%] >+ [%- END # IF SuspendHoldsIntranet -%] >+ [%- IF ( hold.found ) -%] >+ <a >+ class="btn btn-default submit-form-link" >+ href="#" >+ id="revert_hold_[% hold.reserve_id | html %]" >+ data-op="cud-move" >+ data-where="down" >+ data-first_priority="[% first_priority | html %]" >+ data-last_priority="[% last_priority | html %]" >+ data-prev_priority="0" >+ data-next_priority="1" >+ data-borrowernumber="[% hold.borrowernumber | html %]" >+ data-biblionumber="[% hold.biblionumber | html %]" >+ data-itemnumber="[% hold.itemnumber | html %]" >+ data-reserve_id="[% hold.reserve_id | html %]" >+ data-date="[% hold.date | html %]" >+ data-action="request.pl" >+ data-method="post" >+ >[% IF hold.intransit %]Revert transit status[% ELSE %]Revert waiting status[% END %]</a >+ > > [%- END -%] >- [%- END # IF SuspendHoldsIntranet -%] >- [%- IF ( hold.found ) -%] >- <a >- class="btn btn-default submit-form-link" >- href="#" >- id="revert_hold_[% hold.reserve_id | html %]" >- data-op="cud-move" >- data-where="down" >- data-first_priority="[% first_priority | html %]" >- data-last_priority="[% last_priority | html %]" >- data-prev_priority="0" >- data-next_priority="1" >- data-borrowernumber="[% hold.borrowernumber | html %]" >- data-biblionumber="[% hold.biblionumber | html %]" >- data-itemnumber="[% hold.itemnumber | html %]" >- data-reserve_id="[% hold.reserve_id | html %]" >- data-date="[% hold.date | html %]" >- data-action="request.pl" >- data-method="post" >- >[% IF hold.intransit %]Revert transit status[% ELSE %]Revert waiting status[% END %]</a >- > >- [%- END -%] >+ [% END %] > </td> > [% IF ( hold.intransit || hold.atdestination ) %] >- <td><input class="printholdslip" type="button" name="printholdslip" value="Print slip" data-reserve_id="[% hold.reserve_id | html %]" /></td> >+ <td>[% IF ( hold.can_be_managed ) %]<input class="printholdslip" type="button" name="printholdslip" value="Print slip" data-reserve_id="[% hold.reserve_id | html %]" />[% END %]</td> > [% ELSE %] > <td></td> > [% END %] >diff --git a/reserve/request.pl b/reserve/request.pl >index c5e354aa7d..88846bc27c 100755 >--- a/reserve/request.pl >+++ b/reserve/request.pl >@@ -671,6 +671,11 @@ if ( ( $findborrower && $borrowernumber_hold || $findclub && $club_hold ) > $reserve{'change_hold_type_allowed'} = 1; > } > >+ my $can_manage_hold = $logged_in_patron->can_see_patron_infos( $res->borrower ); >+ if ($can_manage_hold) { >+ $reserve{'can_be_managed'} = 1; >+ } >+ > push( @reserveloop, \%reserve ); > } > } >-- >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 38040
:
173400
|
176050
|
177197
|
177198
|
177292
|
177472
|
177492
|
178014
|
178015
|
178016
|
179186
|
179187
|
179714
|
180531
|
180532
|
180581
|
180582
|
180898
|
180899
|
180900
|
182444
|
182445
|
182446
|
182447