6 [% USE TablesSettings %]
7 [% USE AuthorisedValues %]
9 [% INCLUDE 'doc-head-open.inc' %]
10 <title>Holds awaiting pickup › Circulation › Koha</title>
11 [% INCLUDE 'doc-head-close.inc' %]
14 <body id="circ_waitingreserves" class="circ">
15 [% INCLUDE 'header.inc' %]
16 [% INCLUDE 'circ-search.inc' %]
18 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
21 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
24 <a href="/cgi-bin/koha/circ/circulation-home.pl">Circulation</a>
27 <a href="#" aria-current="page">Holds awaiting pickup</a>
32 <div class="main container-fluid">
34 <div class="col-sm-12">
38 [% IF Koha.Preference('CircSidebar') %]
39 <div class="col-sm-10 col-sm-push-2">
41 <div class="col-sm-12">
44 <h2>Holds awaiting pickup for your library on: [% show_date | $KohaDates %]
45 [% IF ( all_branches_link ) %]
46 <span style="margin-left:20px"><a href="[% all_branches_link | url %]">
47 View all libraries</a></span>
50 [% IF ( cancel_result ) %]
51 [% FOREACH cancel_result %]
52 [% IF ( messagetransfert ) %]
53 <div class="dialog message">
54 <h2>This item is on hold for pick-up at [% Branches.GetName( branchname ) | html %]</h2>
55 <p><strong>[% nextreservtitle | html %]</strong> is on hold for <strong> [% nextreservsurname | html %], [% nextreservfirstname | html %]</strong>.
56 Please retain this item and check it in to process the hold.
58 <form name="cancelReservewithtransfert" action="waitingreserves.pl#[% tab | html %]" method="post">
59 <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> OK</button>
64 <div class="dialog message">
65 <h2>This item is on hold for pick-up at your library</h2>
66 <p><strong>[% nextreservtitle | html %]</strong> is on hold for <strong>[% nextreservsurname | html %], [% nextreservfirstname | html %]</strong>.
67 Please retain this item and check it in to process the hold.
69 <form name="cancelReservewithwaiting" action="waitingreserves.pl#[% tab | html %]" method="post">
70 <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> OK</button>
77 <div class="dialog message">
78 <p>The job has been enqueued! It will be processed as soon as possible.</p>
79 <p><a href="/cgi-bin/koha/admin/background_jobs.pl?op=view&id=[% job_id | uri %]" title="View detail of the enqueued job">View detail of the enqueued job</a></p>
82 <div id="resultlist" class="toptabs">
84 <li><a href="#holdswaiting">Holds waiting: [% reservecount | html %]</a></li>
87 Holds waiting over [% Koha.Preference('ReservesMaxPickUpDelay') | html %] days: [% overcount | html %]
91 <div id="holdswaiting">
92 [% IF ( reserveloop ) %]
93 <div id="toolbar" class="btn-toolbar">
94 <button class="cancel_selected_holds" data-bulk="true"></button>
96 [% INCLUDE waiting_holds.inc select_column='1' table_name='holdst' reserveloop=reserveloop tab='holdwaiting' %]
98 <div class="dialog message">No holds found.</div>
102 [% IF ( ReservesMaxPickUpDelay ) %]<p>Holds listed here have been awaiting pickup for more than [% ReservesMaxPickUpDelay | html %] days.</p>[% END %]
103 [% IF ( overloop ) %]
104 <span id="holdsover-cancel-all">
105 <button class="cancel_selected_holds" data-bulk="true"></button>
106 <form name="cancelAllReserve" action="waitingreserves.pl" method="post">
107 <input type="hidden" name="cancelall" value="1" />
108 <input type="hidden" name="allbranches" value="[% allbranches | html %]" />
109 <input type="hidden" name="tab" value="holdsover">
110 [% IF TransferWhenCancelAllWaitingHolds %]
111 <input type="submit" value="Cancel and Transfer all" />
113 <input type="submit" value="Cancel all" />
116 [% UNLESS TransferWhenCancelAllWaitingHolds %]
117 Only items that need not be transferred will be cancelled (TransferWhenCancelAllWaitingHolds syspref)
121 [% INCLUDE waiting_holds.inc select_column='1' table_name='holdso' reserveloop=overloop tab='holdsover' %]
123 <div class="dialog message">No holds found.</div>
129 [% IF Koha.Preference('CircSidebar') %]
130 </div> <!-- /.col-sm-10.col-sm-push-2 -->
131 <div class="col-sm-2 col-sm-pull-10">
133 [% INCLUDE 'circ-nav.inc' %]
135 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
136 </div> <!-- /.row -->
140 </div> <!-- /.col-sm-12 -->
141 </div> <!-- /.row -->
143 <div id="cancelModal" class="modal" tabindex="-1" role="dialog" aria-hidden="true">
144 <div class="modal-dialog" role="document">
145 <div class="modal-content">
146 <div class="modal-header">
147 <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
148 <h3>Confirm deletion</h3>
151 <div class="modal-body">
152 <p>Are you sure you want to cancel this hold?</p>
154 <fieldset class="action">
155 [% SET hold_cancellation = AuthorisedValues.GetAuthValueDropbox('HOLD_CANCELLATION') %]
156 [% IF hold_cancellation %]
157 <label for="cancellation-reason">Cancellation reason: </label>
158 <select class="cancellation-reason" name="modal-cancellation-reason" id="modal-cancellation-reason">
159 <option value="">No reason given</option>
160 [% FOREACH reason IN hold_cancellation %]
161 <option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option>
168 <div class="modal-footer">
169 <button id="cancelModalConfirmBtn" type="button" class="btn btn-danger">Confirm cancellation</button>
170 <a href="#" data-dismiss="modal">Cancel</a>
176 [% MACRO jsinclude BLOCK %]
177 [% INCLUDE 'datatables.inc' %]
178 [% INCLUDE 'columns_settings.inc' %]
180 var MSG_CANCEL_SELECTED = _("Cancel selected (%s)");
181 var holdst_columns_settings = [% TablesSettings.GetColumns( 'circ', 'holds_awaiting_pickup', 'holdst', 'json' ) | $raw %];
182 var holdso_columns_settings = [% TablesSettings.GetColumns( 'circ', 'holds_awaiting_pickup', 'holdso', 'json' ) | $raw %];
184 $(document).ready(function() {
186 KohaTable("holdst", {
187 "sPaginationType": "full",
188 "order": [[1, 'asc']]
189 }, holdst_columns_settings);
191 KohaTable("holdso", {
192 "sPaginationType": "full",
193 "order": [[1, 'asc']]
194 }, holdso_columns_settings);
196 $('#resultlist').tabs();
200 $("#cancelModalConfirmBtn").on("click",function(e) {
201 var ids = cancel_link.data('ids');
202 localStorage.selectedWaitingHolds = JSON.stringify(JSON.parse(localStorage.selectedWaitingHolds).filter(id => !ids.includes(id)));
203 let link = `waitingreserves.pl?cancelBulk=1&ids=${ids.join(',')}`;
204 let reason = $("#modal-cancellation-reason").val();
206 link += "&cancellation-reason=" + reason
208 window.location.href = link;
212 if(!localStorage.selectedWaitingHolds || document.referrer.replace(/\?.*/, '') !== document.location.origin+document.location.pathname) {
213 localStorage.selectedWaitingHolds = '[]';
217 JSON.parse(localStorage.selectedWaitingHolds);
219 localStorage.selectedWaitingHolds = '[]';
222 $('.holds_table .select_hold').each(function() {
223 if(JSON.parse(localStorage.selectedWaitingHolds).includes($(this).data('id'))) {
224 $(this).prop('checked', true);
228 $('.holds_table').each(function() {
230 var parent = table.parents('.ui-tabs-panel');
232 $('.holds_table .select_hold_all', parent).each(function() {
233 var count = $('.select_hold:not(:checked)', table).length;
234 $('.select_hold_all', table).prop('checked', !count);
237 $('.cancel_selected_holds', parent).html(MSG_CANCEL_SELECTED.format($('.holds_table .select_hold:checked', parent).length));
239 $('.holds_table .select_hold_all', parent).click(function() {
240 var count = $('.select_hold:checked', table).length;
241 $('.select_hold', table).prop('checked', !count);
242 $(this).prop('checked', !count);
243 $('.cancel_selected_holds', parent).data('ids', $('.holds_table .select_hold:checked', parent).toArray().map(el => $(el).data('id'))).html(MSG_CANCEL_SELECTED.format($('.holds_table .select_hold:checked', parent).length));
244 localStorage.selectedWaitingHolds = JSON.stringify($('.holds_table .select_hold:checked').toArray().map(el => $(el).data('id')));
247 $('.holds_table .select_hold', parent).click(function() {
248 var count = $('.select_hold:not(:checked)', table).length;
249 $('.select_hold_all', table).prop('checked', !count);
250 $('.cancel_selected_holds', parent).data('ids', $('.holds_table .select_hold:checked', parent).toArray().map(el => $(el).data('id'))).html(MSG_CANCEL_SELECTED.format($('.holds_table .select_hold:checked', parent).length));
251 localStorage.selectedWaitingHolds = JSON.stringify($('.holds_table .select_hold:checked').toArray().map(el => $(el).data('id')));
254 $('.cancel_selected_holds', parent).click(function(e) {
256 if($('.select_hold:checked', table).length) {
257 cancel_link = $(this);
258 $('#cancelModal').modal();
269 [% INCLUDE 'intranet-bottom.inc' %]