Lines 4-9
Link Here
|
4 |
[% USE KohaDates %] |
4 |
[% USE KohaDates %] |
5 |
[% USE Branches %] |
5 |
[% USE Branches %] |
6 |
[% USE TablesSettings %] |
6 |
[% USE TablesSettings %] |
|
|
7 |
[% USE AuthorisedValues %] |
7 |
[% SET footerjs = 1 %] |
8 |
[% SET footerjs = 1 %] |
8 |
[% INCLUDE 'doc-head-open.inc' %] |
9 |
[% INCLUDE 'doc-head-open.inc' %] |
9 |
<title>Holds awaiting pickup › Circulation › Koha</title> |
10 |
<title>Holds awaiting pickup › Circulation › Koha</title> |
Lines 72-77
Link Here
|
72 |
[% END %] |
73 |
[% END %] |
73 |
[% END %] |
74 |
[% END %] |
74 |
[% ELSE %] |
75 |
[% ELSE %] |
|
|
76 |
[% IF enqueued %] |
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> |
80 |
</div> |
81 |
[% END %] |
75 |
<div id="resultlist" class="toptabs"> |
82 |
<div id="resultlist" class="toptabs"> |
76 |
<ul> |
83 |
<ul> |
77 |
<li><a href="#holdswaiting">Holds waiting: [% reservecount | html %]</a></li> |
84 |
<li><a href="#holdswaiting">Holds waiting: [% reservecount | html %]</a></li> |
Lines 83-89
Link Here
|
83 |
</ul> |
90 |
</ul> |
84 |
<div id="holdswaiting"> |
91 |
<div id="holdswaiting"> |
85 |
[% IF ( reserveloop ) %] |
92 |
[% IF ( reserveloop ) %] |
86 |
[% INCLUDE waiting_holds.inc table_name='holdst' reserveloop=reserveloop tab='holdwaiting' %] |
93 |
<div id="toolbar" class="btn-toolbar"> |
|
|
94 |
<button class="cancel_selected_holds" data-bulk="true"></button> |
95 |
</div> |
96 |
[% INCLUDE waiting_holds.inc select_column='1' table_name='holdst' reserveloop=reserveloop tab='holdwaiting' %] |
87 |
[% ELSE %] |
97 |
[% ELSE %] |
88 |
<div class="dialog message">No holds found.</div> |
98 |
<div class="dialog message">No holds found.</div> |
89 |
[% END %] |
99 |
[% END %] |
Lines 92-97
Link Here
|
92 |
[% IF ( ReservesMaxPickUpDelay ) %]<p>Holds listed here have been awaiting pickup for more than [% ReservesMaxPickUpDelay | html %] days.</p>[% END %] |
102 |
[% IF ( ReservesMaxPickUpDelay ) %]<p>Holds listed here have been awaiting pickup for more than [% ReservesMaxPickUpDelay | html %] days.</p>[% END %] |
93 |
[% IF ( overloop ) %] |
103 |
[% IF ( overloop ) %] |
94 |
<span id="holdsover-cancel-all"> |
104 |
<span id="holdsover-cancel-all"> |
|
|
105 |
<button class="cancel_selected_holds" data-bulk="true"></button> |
95 |
<form name="cancelAllReserve" action="waitingreserves.pl" method="post"> |
106 |
<form name="cancelAllReserve" action="waitingreserves.pl" method="post"> |
96 |
<input type="hidden" name="cancelall" value="1" /> |
107 |
<input type="hidden" name="cancelall" value="1" /> |
97 |
<input type="hidden" name="allbranches" value="[% allbranches | html %]" /> |
108 |
<input type="hidden" name="allbranches" value="[% allbranches | html %]" /> |
Lines 105-112
Link Here
|
105 |
[% UNLESS TransferWhenCancelAllWaitingHolds %] |
116 |
[% UNLESS TransferWhenCancelAllWaitingHolds %] |
106 |
Only items that need not be transferred will be cancelled (TransferWhenCancelAllWaitingHolds syspref) |
117 |
Only items that need not be transferred will be cancelled (TransferWhenCancelAllWaitingHolds syspref) |
107 |
[% END %] |
118 |
[% END %] |
|
|
119 |
|
108 |
</span> |
120 |
</span> |
109 |
[% INCLUDE waiting_holds.inc table_name='holdso' reserveloop=overloop tab='holdsover' %] |
121 |
[% INCLUDE waiting_holds.inc select_column='1' table_name='holdso' reserveloop=overloop tab='holdsover' %] |
110 |
[% ELSE %] |
122 |
[% ELSE %] |
111 |
<div class="dialog message">No holds found.</div> |
123 |
<div class="dialog message">No holds found.</div> |
112 |
[% END %] |
124 |
[% END %] |
Lines 128-152
Link Here
|
128 |
</div> <!-- /.col-sm-12 --> |
140 |
</div> <!-- /.col-sm-12 --> |
129 |
</div> <!-- /.row --> |
141 |
</div> <!-- /.row --> |
130 |
|
142 |
|
|
|
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> |
149 |
</div> |
150 |
|
151 |
<div class="modal-body"> |
152 |
<p>Are you sure you want to cancel this hold?</p> |
153 |
|
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> |
162 |
[% END %] |
163 |
</select> |
164 |
[% END %] |
165 |
</fieldset> |
166 |
</div> |
167 |
|
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> |
171 |
</div> |
172 |
</div> |
173 |
</div> |
174 |
</div> |
175 |
|
131 |
[% MACRO jsinclude BLOCK %] |
176 |
[% MACRO jsinclude BLOCK %] |
132 |
[% INCLUDE 'datatables.inc' %] |
177 |
[% INCLUDE 'datatables.inc' %] |
133 |
[% INCLUDE 'columns_settings.inc' %] |
178 |
[% INCLUDE 'columns_settings.inc' %] |
134 |
<script> |
179 |
<script> |
|
|
180 |
var MSG_CANCEL_SELECTED = _("Cancel selected (%s)"); |
135 |
var holdst_columns_settings = [% TablesSettings.GetColumns( 'circ', 'holds_awaiting_pickup', 'holdst', 'json' ) | $raw %]; |
181 |
var holdst_columns_settings = [% TablesSettings.GetColumns( 'circ', 'holds_awaiting_pickup', 'holdst', 'json' ) | $raw %]; |
136 |
var holdso_columns_settings = [% TablesSettings.GetColumns( 'circ', 'holds_awaiting_pickup', 'holdso', 'json' ) | $raw %]; |
182 |
var holdso_columns_settings = [% TablesSettings.GetColumns( 'circ', 'holds_awaiting_pickup', 'holdso', 'json' ) | $raw %]; |
137 |
|
183 |
|
138 |
$(document).ready(function() { |
184 |
$(document).ready(function() { |
139 |
|
185 |
|
140 |
KohaTable("holdst", { |
186 |
KohaTable("holdst", { |
141 |
"sPaginationType": "full" |
187 |
"sPaginationType": "full", |
|
|
188 |
"order": [[1, 'asc']] |
142 |
}, holdst_columns_settings); |
189 |
}, holdst_columns_settings); |
143 |
|
190 |
|
144 |
KohaTable("holdso", { |
191 |
KohaTable("holdso", { |
145 |
"sPaginationType": "full" |
192 |
"sPaginationType": "full", |
|
|
193 |
"order": [[1, 'asc']] |
146 |
}, holdso_columns_settings); |
194 |
}, holdso_columns_settings); |
147 |
|
195 |
|
148 |
$('#resultlist').tabs(); |
196 |
$('#resultlist').tabs(); |
149 |
|
197 |
|
|
|
198 |
let cancel_link; |
199 |
|
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(); |
205 |
if ( reason ) { |
206 |
link += "&cancellation-reason=" + reason |
207 |
} |
208 |
window.location.href = link; |
209 |
return false; |
210 |
}); |
211 |
|
212 |
if(!localStorage.selectedWaitingHolds || document.referrer.replace(/\?.*/, '') !== document.location.origin+document.location.pathname) { |
213 |
localStorage.selectedWaitingHolds = '[]'; |
214 |
} |
215 |
|
216 |
try { |
217 |
JSON.parse(localStorage.selectedWaitingHolds); |
218 |
} catch(e) { |
219 |
localStorage.selectedWaitingHolds = '[]'; |
220 |
} |
221 |
|
222 |
$('.holds_table .select_hold').each(function() { |
223 |
if(JSON.parse(localStorage.selectedWaitingHolds).includes($(this).data('id'))) { |
224 |
$(this).prop('checked', true); |
225 |
} |
226 |
}); |
227 |
|
228 |
$('.holds_table').each(function() { |
229 |
var table = $(this); |
230 |
var parent = table.parents('.ui-tabs-panel'); |
231 |
|
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); |
235 |
}); |
236 |
|
237 |
$('.cancel_selected_holds', parent).html(MSG_CANCEL_SELECTED.format($('.holds_table .select_hold:checked', parent).length)); |
238 |
|
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'))); |
245 |
}); |
246 |
|
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'))); |
252 |
}); |
253 |
|
254 |
$('.cancel_selected_holds', parent).click(function(e) { |
255 |
e.preventDefault(); |
256 |
if($('.select_hold:checked', table).length) { |
257 |
cancel_link = $(this); |
258 |
$('#cancelModal').modal(); |
259 |
} |
260 |
return false; |
261 |
}); |
262 |
}); |
263 |
|
264 |
|
150 |
}); |
265 |
}); |
151 |
</script> |
266 |
</script> |
152 |
[% END %] |
267 |
[% END %] |