Lines 1-6
Link Here
|
1 |
[% USE raw %] |
1 |
[% USE raw %] |
2 |
[% USE To %] |
2 |
[% USE To %] |
3 |
[% USE Asset %] |
3 |
[% USE Asset %] |
|
|
4 |
[% USE AuthorisedValues %] |
4 |
|
5 |
|
5 |
[% BLOCK form_label %] |
6 |
[% BLOCK form_label %] |
6 |
[% SWITCH label %] |
7 |
[% SWITCH label %] |
Lines 110-115
Link Here
|
110 |
[%- To.json(escaped) | $raw -%] |
111 |
[%- To.json(escaped) | $raw -%] |
111 |
[%- END -%] |
112 |
[%- END -%] |
112 |
|
113 |
|
|
|
114 |
[% notforloans = AuthorisedValues.GetDescriptionsByKohaField({ kohafield = 'items.notforloan' }) %] |
115 |
[% FOREACH nfl IN notforloans %] |
116 |
[% nfl.value = nfl.authorised_value %] |
117 |
[% nfl.label = nfl.lib %] |
118 |
[% END %] |
119 |
|
120 |
[% locations = AuthorisedValues.GetDescriptionsByKohaField({ kohafield = 'items.location' }) %] |
121 |
[% FOREACH loc IN locations %] |
122 |
[% loc.value = loc.authorised_value %] |
123 |
[% loc.label = loc.lib %] |
124 |
[% END %] |
125 |
|
113 |
[%# Page starts here %] |
126 |
[%# Page starts here %] |
114 |
|
127 |
|
115 |
[% SET footerjs = 1 %] |
128 |
[% SET footerjs = 1 %] |
Lines 266-271
Link Here
|
266 |
function submitForm($form) { |
279 |
function submitForm($form) { |
267 |
var tr = '' |
280 |
var tr = '' |
268 |
+ ' <tr>' |
281 |
+ ' <tr>' |
|
|
282 |
+ ' <th id="items_checkbox"></th>' |
269 |
+ ' <th id="items_title">' + _("Title") + '</th>' |
283 |
+ ' <th id="items_title">' + _("Title") + '</th>' |
270 |
+ ' <th id="items_pubdate">' + _("Publication date") + '</th>' |
284 |
+ ' <th id="items_pubdate">' + _("Publication date") + '</th>' |
271 |
+ ' <th id="items_publisher">' + _("Publisher") + '</th>' |
285 |
+ ' <th id="items_publisher">' + _("Publisher") + '</th>' |
Lines 301-338
Link Here
|
301 |
$('#item-search-block').show(); |
315 |
$('#item-search-block').show(); |
302 |
}); |
316 |
}); |
303 |
|
317 |
|
|
|
318 |
function exportItems(format) { |
319 |
var itemnumbers = []; |
320 |
$('#results').find('input[name="itemnumber"]:checked').each(function() { |
321 |
itemnumbers.push($(this).val()); |
322 |
}); |
323 |
if (itemnumbers.length) { |
324 |
var href = '/cgi-bin/koha/catalogue/item-export.pl?format=' + format; |
325 |
href += '&itemnumber=' + itemnumbers.join('&itemnumber='); |
326 |
location = href; |
327 |
} else { |
328 |
$('#format-' + format).prop('checked', true); |
329 |
$('#itemsearchform').submit(); |
330 |
$('#format-html').prop('checked', true); |
331 |
} |
332 |
} |
333 |
|
304 |
var csvExportLink = $('<a>') |
334 |
var csvExportLink = $('<a>') |
305 |
.attr('href', '#') |
335 |
.attr('href', '#') |
306 |
.html(_("Export results to CSV")) |
336 |
.html("CSV") |
307 |
.addClass('btn btn-default btn-xs') |
|
|
308 |
.on('click', function(e) { |
337 |
.on('click', function(e) { |
309 |
e.preventDefault(); |
338 |
e.preventDefault(); |
310 |
$('#format-csv').prop('checked', true); |
339 |
exportItems('csv'); |
311 |
$('#itemsearchform').submit(); |
|
|
312 |
$('#format-html').prop('checked', true); |
313 |
}); |
340 |
}); |
314 |
var barcodesExportLink = $('<a>') |
341 |
var barcodesExportLink = $('<a>') |
315 |
.attr('href', '#') |
342 |
.attr('href', '#') |
316 |
.html(_("Export results to barcodes file")) |
343 |
.html(_("Barcodes file")) |
317 |
.addClass('btn btn-default btn-xs') |
|
|
318 |
.on('click', function(e) { |
344 |
.on('click', function(e) { |
319 |
e.preventDefault(); |
345 |
e.preventDefault(); |
320 |
$('#format-barcodes').prop('checked', true); |
346 |
exportItems('barcodes'); |
321 |
$('#itemsearchform').submit(); |
|
|
322 |
$('#format-html').prop('checked', true); |
323 |
}); |
347 |
}); |
324 |
|
348 |
|
325 |
var editSearchAndExportLinks = $('<p>') |
349 |
var exportButton = $('<div>') |
326 |
.append(editSearchLink) |
350 |
.addClass('btn-group') |
327 |
.append(' | ') |
351 |
.append($('<button>') |
328 |
.append(csvExportLink) |
352 |
.addClass('btn btn-default btn-xs dropdown-toggle') |
329 |
.append(' ') |
353 |
.attr('id', 'export-button') |
330 |
.append(barcodesExportLink); |
354 |
.attr('data-toggle', 'dropdown') |
|
|
355 |
.attr('aria-haspopup', 'true') |
356 |
.attr('aria-expanded', 'false') |
357 |
.html(_("Export all results to") + ' <span class="caret"></span>')) |
358 |
.append($('<ul>') |
359 |
.addClass('dropdown-menu') |
360 |
.append($('<li>').append(csvExportLink)) |
361 |
.append($('<li>').append(barcodesExportLink))); |
362 |
|
363 |
var selectVisibleRows = $('<a>') |
364 |
.attr('href', '#') |
365 |
.append('<i class="fa fa-check"></i> ') |
366 |
.append(_("Select visible rows")) |
367 |
.on('click', function(e) { |
368 |
e.preventDefault(); |
369 |
$('#results input[type="checkbox"]').prop('checked', true).change(); |
370 |
}); |
371 |
var clearSelection = $('<a>') |
372 |
.attr('href', '#') |
373 |
.append('<i class="fa fa-remove"></i> ') |
374 |
.append(_("Clear selection")) |
375 |
.on('click', function(e) { |
376 |
e.preventDefault(); |
377 |
$('#results input[type="checkbox"]').prop('checked', false).change(); |
378 |
}); |
379 |
var exportLinks = $('<p>') |
380 |
.append(selectVisibleRows) |
381 |
.append(' ') |
382 |
.append(clearSelection) |
383 |
.append(' | ') |
384 |
.append(exportButton); |
331 |
|
385 |
|
332 |
var results_heading = $('<div>').addClass('results-heading') |
386 |
var results_heading = $('<div>').addClass('results-heading') |
333 |
.append("<h1>" + _("Item search results") + "</h1>") |
387 |
.append("<h1>" + _("Item search results") + "</h1>") |
334 |
.append($('<p>').append(advSearchLink)) |
388 |
.append($('<p>').append(advSearchLink)) |
335 |
.append(editSearchAndExportLinks); |
389 |
.append($('<p>').append(editSearchLink)) |
|
|
390 |
.append(exportLinks); |
336 |
$('#results-wrapper').empty() |
391 |
$('#results-wrapper').empty() |
337 |
.append(results_heading) |
392 |
.append(results_heading) |
338 |
.append(table); |
393 |
.append(table); |
Lines 369-375
Link Here
|
369 |
}); |
424 |
}); |
370 |
}, |
425 |
}, |
371 |
'sDom': '<"top pager"ilp>t<"bottom pager"ip>r', |
426 |
'sDom': '<"top pager"ilp>t<"bottom pager"ip>r', |
|
|
427 |
'aaSorting': [[1, 'asc']], |
372 |
'aoColumns': [ |
428 |
'aoColumns': [ |
|
|
429 |
{ 'sName': 'checkbox', 'bSortable': false }, |
373 |
{ 'sName': 'title' }, |
430 |
{ 'sName': 'title' }, |
374 |
{ 'sName': 'publicationyear' }, |
431 |
{ 'sName': 'publicationyear' }, |
375 |
{ 'sName': 'publishercode' }, |
432 |
{ 'sName': 'publishercode' }, |
Lines 385-396
Link Here
|
385 |
{ 'sName': 'itemlost' }, |
442 |
{ 'sName': 'itemlost' }, |
386 |
{ 'sName': 'withdrawn' }, |
443 |
{ 'sName': 'withdrawn' }, |
387 |
{ 'sName': 'issues' }, |
444 |
{ 'sName': 'issues' }, |
388 |
{ 'sName': 'checkbox', 'bSortable': false } |
445 |
{ 'sName': 'actions', 'bSortable': false } |
389 |
], |
446 |
], |
390 |
"sPaginationType": "full_numbers" |
447 |
"sPaginationType": "full_numbers" |
391 |
})).columnFilter({ |
448 |
})).columnFilter({ |
392 |
'sPlaceHolder': 'head:after', |
449 |
'sPlaceHolder': 'head:after', |
393 |
'aoColumns': [ |
450 |
'aoColumns': [ |
|
|
451 |
null, |
394 |
{ 'type': 'text' }, |
452 |
{ 'type': 'text' }, |
395 |
{ 'type': 'text' }, |
453 |
{ 'type': 'text' }, |
396 |
{ 'type': 'text' }, |
454 |
{ 'type': 'text' }, |
Lines 433-438
Link Here
|
433 |
null |
491 |
null |
434 |
] |
492 |
] |
435 |
}); |
493 |
}); |
|
|
494 |
|
495 |
$('#results').on('change', 'input[type="checkbox"]', function() { |
496 |
var countSelected = $(this).parents('table').find('input:checked').length; |
497 |
var caret = ' <span class="caret">'; |
498 |
if (countSelected > 0) { |
499 |
$('#export-button').html(_("Export selected results to") + caret); |
500 |
} else { |
501 |
$('#export-button').html(_("Export all results to") + caret); |
502 |
} |
503 |
}); |
436 |
} |
504 |
} |
437 |
var Sticky; |
505 |
var Sticky; |
438 |
$(document).ready(function () { |
506 |
$(document).ready(function () { |
439 |
- |
|
|