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 <h1>Holds awaiting pickup for your library on: [% show_date | $KohaDates %]</h1>
46 [% IF ( all_branches_link ) %]
47 <span><a href="[% all_branches_link | url %]">
48 View all libraries</a></span>
51 [% IF ( cancel_result ) %]
52 [% FOREACH cancel_result %]
53 [% IF ( messagetransfert ) %]
54 <div class="dialog message">
55 <h2>This item is on hold for pick-up at [% Branches.GetName( branchname ) | html %]</h2>
56 <p><strong>[% nextreservtitle | html %]</strong> is on hold for <strong> [% nextreservsurname | html %], [% nextreservfirstname | html %]</strong>.
57 Please retain this item and check it in to process the hold.
59 <form name="cancelReservewithtransfert" action="waitingreserves.pl#[% tab | html %]" method="post">
60 <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> OK</button>
65 <div class="dialog message">
66 <h2>This item is on hold for pick-up at your library</h2>
67 <p><strong>[% nextreservtitle | html %]</strong> is on hold for <strong>[% nextreservsurname | html %], [% nextreservfirstname | html %]</strong>.
68 Please retain this item and check it in to process the hold.
70 <form name="cancelReservewithwaiting" action="waitingreserves.pl#[% tab | html %]" method="post">
71 <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> OK</button>
78 <div class="dialog message">
79 <p>The job has been enqueued! It will be processed as soon as possible.</p>
80 <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>
83 <div id="resultlist" class="toptabs">
84 <ul class="nav nav-tabs" role="tablist">
85 <li role="presentation" class="active"><a href="#holdswaiting" aria-controls="holdswaiting" role="tab" data-toggle="tab">Holds waiting: [% reservecount | html %]</a></li>
86 <li role="presentation">
87 <a href="#holdsover" aria-controls="holdsover" role="tab" data-toggle="tab">
88 Holds waiting over [% Koha.Preference('ReservesMaxPickUpDelay') | html %] days: [% overcount | html %]
92 <div class="tab-content">
93 <div role="tabpanel" class="tab-pane active" id="holdswaiting">
94 [% IF ( reserveloop ) %]
95 <div id="toolbar" class="btn-toolbar">
96 <button class="cancel_selected_holds" data-bulk="true"></button>
98 [% INCLUDE waiting_holds.inc select_column='1' table_name='holdst' reserveloop=reserveloop tab='holdwaiting' %]
100 <div class="dialog message">No holds found.</div>
103 <div role="tabpanel" class="tab-pane" id="holdsover">
104 [% IF ( ReservesMaxPickUpDelay ) %]<p>Holds listed here have been awaiting pickup for more than [% ReservesMaxPickUpDelay | html %] days.</p>[% END %]
105 [% IF ( overloop ) %]
106 <span id="holdsover-cancel-all">
107 <button class="cancel_selected_holds" data-bulk="true"></button>
108 <form name="cancelAllReserve" action="waitingreserves.pl" method="post">
109 <input type="hidden" name="cancelall" value="1" />
110 <input type="hidden" name="allbranches" value="[% allbranches | html %]" />
111 <input type="hidden" name="tab" value="holdsover">
112 [% IF TransferWhenCancelAllWaitingHolds %]
113 <input type="submit" value="Cancel and Transfer all" />
115 <input type="submit" value="Cancel all" />
118 [% UNLESS TransferWhenCancelAllWaitingHolds %]
119 Only items that need not be transferred will be cancelled (TransferWhenCancelAllWaitingHolds syspref)
123 [% INCLUDE waiting_holds.inc select_column='1' table_name='holdso' reserveloop=overloop tab='holdsover' %]
125 <div class="dialog message">No holds found.</div>
131 [% IF Koha.Preference('CircSidebar') %]
132 </div> <!-- /.col-sm-10.col-sm-push-2 -->
133 <div class="col-sm-2 col-sm-pull-10">
135 [% INCLUDE 'circ-nav.inc' %]
137 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
138 </div> <!-- /.row -->
142 </div> <!-- /.col-sm-12 -->
143 </div> <!-- /.row -->
145 <div id="cancelModal" class="modal" tabindex="-1" role="dialog" aria-hidden="true">
146 <div class="modal-dialog" role="document">
147 <div class="modal-content">
148 <div class="modal-header">
149 <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
150 <h3>Confirm deletion</h3>
153 <div class="modal-body">
154 <p>Are you sure you want to cancel this hold?</p>
156 <fieldset class="action">
157 [% SET hold_cancellation = AuthorisedValues.GetAuthValueDropbox('HOLD_CANCELLATION') %]
158 [% IF hold_cancellation.count %]
159 <label for="cancellation-reason">Cancellation reason: </label>
160 <select class="cancellation-reason" name="modal-cancellation-reason" id="modal-cancellation-reason">
161 <option value="">No reason given</option>
162 [% FOREACH reason IN hold_cancellation %]
163 <option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option>
170 <div class="modal-footer">
171 <button id="cancelModalConfirmBtn" type="button" class="btn btn-danger">Confirm cancellation</button>
172 <a href="#" data-dismiss="modal">Cancel</a>
178 [% MACRO jsinclude BLOCK %]
179 [% INCLUDE 'datatables.inc' %]
180 [% INCLUDE 'columns_settings.inc' %]
182 var MSG_CANCEL_SELECTED = _("Cancel selected (%s)");
183 var holdst_table_settings = [% TablesSettings.GetTableSettings( 'circ', 'holds_awaiting_pickup', 'holdst', 'json' ) | $raw %];
184 var holdso_table_settings = [% TablesSettings.GetTableSettings( 'circ', 'holds_awaiting_pickup', 'holdso', 'json' ) | $raw %];
186 $(document).ready(function() {
188 KohaTable("holdst", {
189 "sPaginationType": "full",
190 "order": [[1, 'asc']]
191 }, holdst_table_settings);
193 KohaTable("holdso", {
194 "sPaginationType": "full",
195 "order": [[1, 'asc']]
196 }, holdso_table_settings);
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('.tab-pane');
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' %]