Nick Clemens
436291452f
This patch updates the holds table to always insert a hidden input when a hold is 'found' and covers the case where the hold is 'found' but doesn't match known statuses To test: 1 - Place two holds on a record for two different patrons, with different pickup locations 2 - Check in one item at expected branch to set waiting 3 - Then either: - Use batch modification or item editor to change the holding branch for the item - Sign in to a different branch and manually transfer the item back to it's home location 4 - View the holds for the record 5 - Note the 'Pickup library' column is blank for that hold 6 - Change pickup location for other hold and press 'Update holds' 7 - Note the waiting hold is still blank, and now second hold has no pickup location 8 - Check the DB and note the first hold has had the pickup location changed 8 - Apply patch 9 - Delete holds and repeat 1-4 10 - Note the waiting hold now displays: Hold expected at {Branch}, please checkin to verify status 11 - Change location for second hold and update holds 12 - COnfirm location chanegd correctly and first hold unaffected Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
235 lines
15 KiB
HTML
235 lines
15 KiB
HTML
[% USE Koha %]
|
|
[% SET hold_cancellation = AuthorisedValues.GetAuthValueDropbox('HOLD_CANCELLATION') %]
|
|
[% USE AuthorisedValues %]
|
|
<table class="holds_table">
|
|
<tr>
|
|
<th><input type="checkbox" class="select_hold_all"/></th>
|
|
[% IF ( CAN_user_reserveforothers_modify_holds_priority ) %]
|
|
<th>Priority</th>
|
|
<th> </th>
|
|
[% ELSE %]
|
|
<th>Delete?</th>
|
|
[% END %]
|
|
<th>Patron</th>
|
|
<th>Notes</th>
|
|
<th>Date</th>
|
|
<th>Expiration</th>
|
|
<th>Pickup library</th>
|
|
<th>Details</th>
|
|
[% IF ( CAN_user_reserveforothers_modify_holds_priority ) %]
|
|
<th><img src="[% interface | html %]/[% theme | html %]/img/go-bottom.png" alt="Toggle set to lowest priority" /></th>
|
|
[% END %]
|
|
<th> </th>
|
|
<th> </th>
|
|
<th>Print hold/transfer slip</th>
|
|
</tr>
|
|
[%- SET first_priority = 0 -%]
|
|
[%- SET found_holds = 0 -%]
|
|
[%- SET last_priority = holds.last.priority -%]
|
|
|
|
[% BLOCK priority_dropdown %]
|
|
[%- SET loop_priority = 1 -%]
|
|
[%- WHILE loop_priority <= last_priority -%]
|
|
[%- IF this_priority == loop_priority -%]
|
|
<option value="[% loop_priority | html %]" selected="selected">[% loop_priority | html %]</option>
|
|
[%- ELSE -%]
|
|
<option value="[% loop_priority | html %]">[% loop_priority | html %]</option>
|
|
[%- END -%]
|
|
[%- loop_priority = loop_priority + 1- %]
|
|
[%- END -%]
|
|
[% END %]
|
|
|
|
[% FOREACH hold IN holds %]
|
|
[%- IF !hold.found && first_priority == 0 -%]
|
|
[%- first_priority = hold.priority -%]
|
|
[%- found_holds = loop.index() -%]
|
|
[%- END -%]
|
|
[%- IF Koha.Preference('HoldsSplitQueueNumbering') == 'actual' -%]
|
|
[%- this_priority = hold.priority -%]
|
|
[%- ELSE -%]
|
|
[%- this_priority = loop.count() - found_holds -%]
|
|
[%- END -%]
|
|
<tr>
|
|
<th><input type="checkbox" class="select_hold" data-id="[% hold.reserve_id | html %]"/></th>
|
|
<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 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 ) %]
|
|
[% PROCESS priority_dropdown %]
|
|
[% 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>
|
|
[% ELSE %]
|
|
<option value="W" selected="selected">Waiting</option>
|
|
[% END %]
|
|
[% ELSE %]
|
|
<option value="[% hold.priority | html %]" selected="selected">[% this_priority | html %]</option>
|
|
[% END %]
|
|
</select>
|
|
[% 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 title="Move hold up" href="request.pl?action=move&where=up&first_priority=[% first_priority | html %]&last_priority=[% last_priority | html %]&prev_priority=[% prev_priority | html %]&next_priority=[% next_priority | html %]&borrowernumber=[% hold.borrowernumber | html %]&biblionumber=[% hold.biblionumber | html %]&reserve_id=[% hold.reserve_id | html %]&date=[% hold.date | html %]">
|
|
<img src="[% interface | html %]/[% theme | html %]/img/go-up.png" alt="Go up" />
|
|
</a>
|
|
<a title="Move hold to top" href="request.pl?action=move&where=top&first_priority=[% first_priority | html %]&last_priority=[% last_priority | html %]&prev_priority=[% prev_priority | html %]&next_priority=[% next_priority | html %]&borrowernumber=[% hold.borrowernumber | html %]&biblionumber=[% hold.biblionumber | html %]&reserve_id=[% hold.reserve_id | html %]&date=[% hold.date | html %]">
|
|
<img src="[% interface | html %]/[% theme | html %]/img/go-top.png" alt="Go top" />
|
|
</a>
|
|
<a title="Move hold to bottom" href="request.pl?action=move&where=bottom&first_priority=[% first_priority | html %]&last_priority=[% last_priority | html %]&prev_priority=[% prev_priority | html %]&next_priority=[% next_priority | html %]&borrowernumber=[% hold.borrowernumber | html %]&biblionumber=[% hold.biblionumber | html %]&reserve_id=[% hold.reserve_id | html %]&date=[% hold.date | html %]">
|
|
<img src="[% interface | html %]/[% theme | html %]/img/go-bottom.png" alt="Go bottom" />
|
|
</a>
|
|
<a title="Move hold down" href="request.pl?action=move&where=down&first_priority=[% first_priority | html %]&last_priority=[% last_priority | html %]&prev_priority=[% prev_priority | html %]&next_priority=[% next_priority | html %]&borrowernumber=[% hold.borrowernumber | html %]&biblionumber=[% hold.biblionumber | html %]&reserve_id=[% hold.reserve_id | html %]&date=[% hold.date | html %]">
|
|
<img src="[% interface | html %]/[% theme | html %]/img/go-down.png" alt="Go down" />
|
|
</a>
|
|
</td>
|
|
[%- 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 Koha.Preference('AllowHoldDateInFuture') %]
|
|
<input type="text" class="flatpickr" value="[% hold.date | $KohaDates %]" required="required" size="10" name="reservedate" />
|
|
[% ELSE %]
|
|
[% hold.date | $KohaDates %]
|
|
[% END %]
|
|
</td>
|
|
<td>
|
|
<input type="text" class="flatpickr" data-flatpickr-futuredate="true" value="[% hold.expirationdate | $KohaDates %]" size="10" name="expirationdate" />
|
|
</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 %]" />
|
|
[%- 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 -%]
|
|
</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 -%]
|
|
<input type="hidden" name="itemnumber" value="[% hold.itemnumber | html %]" />
|
|
[%- ELSE -%]
|
|
No barcode
|
|
[%- END -%]
|
|
</a>
|
|
[%- ELSE -%]
|
|
[%- IF ( hold.item_level_hold ) -%]
|
|
<em>
|
|
Only item
|
|
<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 -%]
|
|
<input type="hidden" name="itemnumber" value="[% hold.itemnumber | html %]" />
|
|
[%- ELSE -%]
|
|
No barcode
|
|
[%- END -%]
|
|
</a>
|
|
</em>
|
|
[%- ELSE -%]
|
|
[%- IF hold.itemtype -%]
|
|
<em>Next available [% ItemTypes.GetDescription( hold.itemtype ) | html %] item</em>
|
|
[%- ELSE -%]
|
|
<em>Next available</em>
|
|
[%- END -%]
|
|
|
|
<input type="hidden" name="itemnumber" value="" />
|
|
[%- END -%]
|
|
[%- END -%]
|
|
[%- IF hold.non_priority -%]
|
|
<br><i>Non priority hold</i>
|
|
[%- END -%]
|
|
</td>
|
|
[%- IF ( CAN_user_reserveforothers_modify_holds_priority ) -%]
|
|
[%- UNLESS hold.found -%]
|
|
<td>
|
|
<a title="Toggle lowest priority" href="request.pl?action=setLowestPriority&borrowernumber=[% hold.borrowernumber | html %]&biblionumber=[% hold.biblionumber | html %]&reserve_id=[% hold.reserve_id | html %]&date=[% hold.date | html %]">
|
|
[%- IF ( hold.lowestPriority ) -%]
|
|
<img src="[% interface | html %]/[% theme | html %]/img/go-bottom.png" alt="Unset lowest priority" />
|
|
[%- ELSE -%]
|
|
<img src="[% interface | html %]/[% theme | html %]/img/go-down.png" alt="Set to lowest priority" />
|
|
[%- END -%]
|
|
</a>
|
|
</td>
|
|
[%- ELSE -%]
|
|
<td></td>
|
|
[%- END -%]
|
|
[%- END -%]
|
|
<td>
|
|
<a class="btn btn-default btn-xs cancel-hold" data-borrowernumber="[% hold.borrowernumber | html %]" data-biblionumber="[% hold.biblionumber | html %]" data-id="[% hold.reserve_id | html %]" href="request.pl?action=cancel&borrowernumber=[% hold.borrowernumber | html %]&biblionumber=[% hold.biblionumber | html %]&reserve_id=[% hold.reserve_id | html %]&date=[% hold.date | html %]">
|
|
<i class="fa fa-trash" aria-hidden="true"></i> Cancel
|
|
</a>
|
|
</td>
|
|
<td>
|
|
[% IF Koha.Preference('SuspendHoldsIntranet') %]
|
|
[% UNLESS ( hold.found ) %]
|
|
<button class="btn btn-default btn-xs toggle-suspend" data-reserve-id="[% hold.reserve_id | html %]" data-biblionumber="[% hold.biblionumber | html %]">
|
|
[% IF ( hold.suspend ) %]
|
|
<i class="fa fa-play" aria-hidden="true"></i> Unsuspend
|
|
[% ELSE %]
|
|
<i class="fa fa-pause" aria-hidden="true"></i> Suspend
|
|
[% END %]
|
|
</button>
|
|
|
|
[% 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 | $KohaDates %]" 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 ) -%]
|
|
<input type="button" id="revert_hold_[% hold.reserve_id | html %]" value="[% IF hold.intransit %]Revert transit status[% ELSE %]Revert waiting status[% END %]" onclick="window.location.href='request.pl?action=move&where=down&first_priority=[% first_priority | uri %]&last_priority=[% last_priority | uri %]&prev_priority=0&next_priority=1&borrowernumber=[% hold.borrowernumber | uri %]&biblionumber=[% hold.biblionumber | uri %]&itemnumber=[% hold.itemnumber | uri %]&reserve_id=[% hold.reserve_id | uri %]&date=[% hold.date | uri %]'">
|
|
[%- 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>
|
|
[% ELSE %]
|
|
<td></td>
|
|
[% END %]
|
|
</tr>
|
|
[% END %]
|
|
</table>
|