Lines 430-440
Link Here
|
430 |
} |
430 |
} |
431 |
|
431 |
|
432 |
function exportItems(format) { |
432 |
function exportItems(format) { |
433 |
let item_search_selections = JSON.parse( localStorage.getItem("item_search_selections") ) || []; |
433 |
let item_search_selections = JSON.parse(localStorage.getItem("item_search_selections")) || []; |
434 |
if (item_search_selections.length > 0) { |
434 |
if (item_search_selections.length > 0) { |
435 |
var href = '/cgi-bin/koha/catalogue/item-export.pl?format=' + format; |
435 |
let inputs = item_search_selections.map(itemnumber => |
436 |
href += '&itemnumber=' + Array.from( item_search_selections ).join('&itemnumber='); |
436 |
`<input type="hidden" name="itemnumber" value="${itemnumber}">` |
437 |
location = href; |
437 |
).join(''); |
|
|
438 |
|
439 |
let form = $(` |
440 |
<form method="POST" action="/cgi-bin/koha/catalogue/item-export.pl"> |
441 |
[% INCLUDE 'csrf-token.inc' %] |
442 |
<input type="hidden" name="format" value="${format}"> |
443 |
${inputs} |
444 |
</form> |
445 |
`); |
446 |
|
447 |
$('body').append(form); |
448 |
form.submit(); |
449 |
form.remove(); |
438 |
} else { |
450 |
} else { |
439 |
$('#format-' + format).prop('checked', true); |
451 |
$('#format-' + format).prop('checked', true); |
440 |
$('#itemsearchform').submit(); |
452 |
$('#itemsearchform').submit(); |
441 |
- |
|
|