Lines 1-4
Link Here
|
1 |
[% USE raw %] |
1 |
[% USE raw %] |
|
|
2 |
[% USE To %] |
2 |
[% USE Asset %] |
3 |
[% USE Asset %] |
3 |
[% USE Koha %] |
4 |
[% USE Koha %] |
4 |
[% USE KohaDates %] |
5 |
[% USE KohaDates %] |
Lines 251-277
Link Here
|
251 |
</tr> |
252 |
</tr> |
252 |
[% END %] |
253 |
[% END %] |
253 |
</tbody> |
254 |
</tbody> |
254 |
<tfoot> |
|
|
255 |
<tr> |
256 |
<td><input type="text" class="filter" data-column_num="0" placeholder="Pull this many items" style="width:95%"/></td> |
257 |
<td><input type="text" class="filter" data-column_num="1" placeholder="Items available" style="width:95%"/></td> |
258 |
<td><input type="text" class="filter" data-column_num="2" placeholder="Patron holds" style="width:95%"/></td> |
259 |
<td><input type="text" class="filter" data-column_num="3" placeholder="Patron name" style="width:95%"/></td> |
260 |
<td><input type="text" class="filter" data-column_num="4" placeholder="Title" style="width:95%"/></td> |
261 |
<td id="homebranchfilter"></td> |
262 |
<td></td> |
263 |
<td><input type="text" class="filter" data-column_num="7" placeholder="Call number" style="width:95%"/></td> |
264 |
<td><input type="text" class="filter" data-column_num="8" placeholder="Available copy" style="width:95%"/></td> |
265 |
<td><input type="text" class="filter" data-column_num="9" placeholder="Available enumeration" style="width:95%"/></td> |
266 |
<td id="itemtype-filter"></td> |
267 |
<td id="locationfilter"></td> |
268 |
<td></td> |
269 |
<td></td> |
270 |
<td></td> |
271 |
<td id="pickup-location"></td> |
272 |
<td></td> |
273 |
</tr> |
274 |
</tfoot> |
275 |
</table> |
255 |
</table> |
276 |
[% ELSE %] |
256 |
[% ELSE %] |
277 |
<strong>No items found.</strong> |
257 |
<strong>No items found.</strong> |
Lines 326-382
Link Here
|
326 |
[% INCLUDE 'datatables.inc' %] |
306 |
[% INCLUDE 'datatables.inc' %] |
327 |
[% INCLUDE 'columns_settings.inc' %] |
307 |
[% INCLUDE 'columns_settings.inc' %] |
328 |
<script> |
308 |
<script> |
329 |
function add_select(column){ |
309 |
function get_options(column){ |
330 |
// Create select element |
|
|
331 |
let select = document.createElement('select'); |
332 |
select.add(new Option('')); |
333 |
column.footer().replaceChildren(select); |
334 |
|
335 |
// Apply listener for user change in value |
336 |
select.addEventListener('change', function () { |
337 |
column |
338 |
.search(select.value, {exact: false}) |
339 |
.draw(); |
340 |
}); |
341 |
|
342 |
let regex = /(<([^>]+)>)/ig; // Remove html tags |
310 |
let regex = /(<([^>]+)>)/ig; // Remove html tags |
343 |
// Add list of options |
311 |
let options = [... new Set(column |
344 |
column |
|
|
345 |
.data() |
312 |
.data() |
|
|
313 |
.toArray() |
346 |
.map(d => d.replace(regex, '').trim().split(/\n/gi).flat()) |
314 |
.map(d => d.replace(regex, '').trim().split(/\n/gi).flat()) |
347 |
.unique() |
315 |
.flat() |
348 |
.sort() |
316 |
.sort())]; |
349 |
.each(function (d, j) { |
317 |
|
350 |
select.add(new Option(d)); |
318 |
return options |
|
|
319 |
.map(e => { |
320 |
return {_id: e, _str: e} |
351 |
}); |
321 |
}); |
352 |
} |
322 |
} |
353 |
|
323 |
|
354 |
$(document).ready(function() { |
324 |
$(document).ready(function() { |
|
|
325 |
[% SET libraries = Branches.all %] |
326 |
let filters_options = { |
327 |
[5] : (table_dt) => get_options(table_dt.column(5)), |
328 |
[10] : (table_dt) => get_options(table_dt.column(10)), |
329 |
[11] : (table_dt) => get_options(table_dt.column(11)), |
330 |
[15] : (table_dt) => get_options(table_dt.column(15)), |
331 |
}; |
332 |
|
333 |
|
355 |
var table_settings = [% TablesSettings.GetTableSettings('circ', 'holds', 'holds-to-pull', 'json') | $raw %]; |
334 |
var table_settings = [% TablesSettings.GetTableSettings('circ', 'holds', 'holds-to-pull', 'json') | $raw %]; |
356 |
var holdst = KohaTable("holdst", { |
335 |
var holdst = KohaTable("holdst", { |
357 |
"pagingType": "full_numbers", |
336 |
"pagingType": "full_numbers", |
358 |
initComplete: function () { |
337 |
}, table_settings, true, null, filters_options); |
359 |
// homebranch |
|
|
360 |
add_select( |
361 |
this.api() |
362 |
.column(5)); |
363 |
|
364 |
// itemtype |
365 |
add_select( |
366 |
this.api() |
367 |
.column(10)); |
368 |
|
369 |
// location |
370 |
add_select( |
371 |
this.api() |
372 |
.column(11)); |
373 |
|
374 |
// pickup-location |
375 |
add_select( |
376 |
this.api() |
377 |
.column(15)); |
378 |
}, |
379 |
}, table_settings); |
380 |
}); |
338 |
}); |
381 |
</script> |
339 |
</script> |
382 |
[% END %] |
340 |
[% END %] |