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