Lines 1-5
Link Here
|
1 |
[% USE CGI %] |
1 |
[% USE CGI %] |
2 |
[% USE JSON.Escape %] |
2 |
[% USE JSON.Escape %] |
|
|
3 |
[% USE AuthorisedValues %] |
3 |
|
4 |
|
4 |
[% BLOCK form_label %] |
5 |
[% BLOCK form_label %] |
5 |
[% SWITCH label %] |
6 |
[% SWITCH label %] |
Lines 155-160
Link Here
|
155 |
</div> |
156 |
</div> |
156 |
[% END %] |
157 |
[% END %] |
157 |
|
158 |
|
|
|
159 |
[% notforloans = AuthorisedValues.GetDescriptionsByKohaField({ kohafield = 'items.notforloan' }) %] |
160 |
[% FOREACH nfl IN notforloans %] |
161 |
[% nfl.value = nfl.authorised_value %] |
162 |
[% nfl.label = nfl.lib %] |
163 |
[% END %] |
164 |
|
165 |
[% locations = AuthorisedValues.GetDescriptionsByKohaField({ kohafield = 'items.location' }) %] |
166 |
[% FOREACH loc IN locations %] |
167 |
[% loc.value = loc.authorised_value %] |
168 |
[% loc.label = loc.lib %] |
169 |
[% END %] |
170 |
|
158 |
[%# Page starts here %] |
171 |
[%# Page starts here %] |
159 |
|
172 |
|
160 |
[% INCLUDE 'doc-head-open.inc' %] |
173 |
[% INCLUDE 'doc-head-open.inc' %] |
Lines 207-212
Link Here
|
207 |
function submitForm($form) { |
220 |
function submitForm($form) { |
208 |
var tr = '' |
221 |
var tr = '' |
209 |
+ ' <tr>' |
222 |
+ ' <tr>' |
|
|
223 |
+ ' <th></th>' |
210 |
+ ' <th>' + _("Title") + '</th>' |
224 |
+ ' <th>' + _("Title") + '</th>' |
211 |
+ ' <th>' + _("Publication date") + '</th>' |
225 |
+ ' <th>' + _("Publication date") + '</th>' |
212 |
+ ' <th>' + _("Publisher") + '</th>' |
226 |
+ ' <th>' + _("Publisher") + '</th>' |
Lines 239-276
Link Here
|
239 |
$('#item-search-block').show(); |
253 |
$('#item-search-block').show(); |
240 |
}); |
254 |
}); |
241 |
|
255 |
|
|
|
256 |
function exportItems(format) { |
257 |
var itemnumbers = []; |
258 |
$('#results').find('input[name="itemnumber"]:checked').each(function() { |
259 |
itemnumbers.push($(this).val()); |
260 |
}); |
261 |
if (itemnumbers.length) { |
262 |
var href = '/cgi-bin/koha/catalogue/item-export.pl?format=' + format; |
263 |
href += '&itemnumber=' + itemnumbers.join('&itemnumber='); |
264 |
location = href; |
265 |
} else { |
266 |
$('#format-' + format).prop('checked', true); |
267 |
$('#itemsearchform').submit(); |
268 |
$('#format-html').prop('checked', true); |
269 |
} |
270 |
} |
271 |
|
242 |
var csvExportLink = $('<a>') |
272 |
var csvExportLink = $('<a>') |
243 |
.attr('href', '#') |
273 |
.attr('href', '#') |
244 |
.html(_("Export results to CSV")) |
274 |
.html(_("CSV")) |
245 |
.addClass('btn btn-default btn-xs') |
|
|
246 |
.on('click', function(e) { |
275 |
.on('click', function(e) { |
247 |
e.preventDefault(); |
276 |
e.preventDefault(); |
248 |
$('#format-csv').prop('checked', true); |
277 |
exportItems('csv') |
249 |
$('#itemsearchform').submit(); |
|
|
250 |
$('#format-html').prop('checked', true); |
251 |
}); |
278 |
}); |
252 |
var barcodesExportLink = $('<a>') |
279 |
var barcodesExportLink = $('<a>') |
253 |
.attr('href', '#') |
280 |
.attr('href', '#') |
254 |
.html(_("Export results to barcodes file")) |
281 |
.html(_("Barcodes file")) |
255 |
.addClass('btn btn-default btn-xs') |
|
|
256 |
.on('click', function(e) { |
282 |
.on('click', function(e) { |
257 |
e.preventDefault(); |
283 |
e.preventDefault(); |
258 |
$('#format-barcodes').prop('checked', true); |
284 |
exportItems('barcodes'); |
259 |
$('#itemsearchform').submit(); |
|
|
260 |
$('#format-html').prop('checked', true); |
261 |
}); |
285 |
}); |
262 |
|
286 |
|
263 |
var editSearchAndExportLinks = $('<p>') |
287 |
var exportButton = $('<div>') |
264 |
.append(editSearchLink) |
288 |
.addClass('btn-group') |
265 |
.append(' | ') |
289 |
.append($('<button>') |
266 |
.append(csvExportLink) |
290 |
.addClass('btn btn-default btn-xs dropdown-toggle') |
|
|
291 |
.attr('id', 'export-button') |
292 |
.attr('data-toggle', 'dropdown') |
293 |
.attr('aria-haspopup', 'true') |
294 |
.attr('aria-expanded', 'false') |
295 |
.html(_("Export all results to") + ' <span class="caret"></span>')) |
296 |
.append($('<ul>') |
297 |
.addClass('dropdown-menu') |
298 |
.append($('<li>').append(csvExportLink)) |
299 |
.append($('<li>').append(barcodesExportLink))); |
300 |
|
301 |
var selectVisibleRows = $('<a>') |
302 |
.attr('href', '#') |
303 |
.append('<i class="fa fa-check"></i> ') |
304 |
.append(_("Select visible rows")) |
305 |
.on('click', function(e) { |
306 |
e.preventDefault(); |
307 |
$('#results input[type="checkbox"]').prop('checked', true).change(); |
308 |
}); |
309 |
var clearSelection = $('<a>') |
310 |
.attr('href', '#') |
311 |
.append('<i class="fa fa-remove"></i> ') |
312 |
.append(_("Clear selection")) |
313 |
.on('click', function(e) { |
314 |
e.preventDefault(); |
315 |
$('#results input[type="checkbox"]').prop('checked', false).change(); |
316 |
}); |
317 |
var exportLinks = $('<p>') |
318 |
.append(selectVisibleRows) |
267 |
.append(' ') |
319 |
.append(' ') |
268 |
.append(barcodesExportLink); |
320 |
.append(clearSelection) |
|
|
321 |
.append(' | ') |
322 |
.append(exportButton); |
269 |
|
323 |
|
270 |
var results_heading = $('<div>').addClass('results-heading') |
324 |
var results_heading = $('<div>').addClass('results-heading') |
271 |
.append("<h1>" + _("Item search results") + "</h1>") |
325 |
.append("<h1>" + _("Item search results") + "</h1>") |
272 |
.append($('<p>').append(advSearchLink)) |
326 |
.append($('<p>').append(advSearchLink)) |
273 |
.append(editSearchAndExportLinks); |
327 |
.append($('<p>').append(editSearchLink)) |
|
|
328 |
.append(exportLinks); |
274 |
$('#results-wrapper').empty() |
329 |
$('#results-wrapper').empty() |
275 |
.append(results_heading) |
330 |
.append(results_heading) |
276 |
.append(table); |
331 |
.append(table); |
Lines 309-315
Link Here
|
309 |
}); |
364 |
}); |
310 |
}, |
365 |
}, |
311 |
'sDom': '<"top pager"ilp>t<"bottom pager"ip>r', |
366 |
'sDom': '<"top pager"ilp>t<"bottom pager"ip>r', |
|
|
367 |
'aaSorting': [[1, 'asc']], |
312 |
'aoColumns': [ |
368 |
'aoColumns': [ |
|
|
369 |
{ 'sName': 'checkbox', 'bSortable': false }, |
313 |
{ 'sName': 'title' }, |
370 |
{ 'sName': 'title' }, |
314 |
{ 'sName': 'publicationyear' }, |
371 |
{ 'sName': 'publicationyear' }, |
315 |
{ 'sName': 'publishercode' }, |
372 |
{ 'sName': 'publishercode' }, |
Lines 322-333
Link Here
|
322 |
{ 'sName': 'stocknumber' }, |
379 |
{ 'sName': 'stocknumber' }, |
323 |
{ 'sName': 'notforloan' }, |
380 |
{ 'sName': 'notforloan' }, |
324 |
{ 'sName': 'issues' }, |
381 |
{ 'sName': 'issues' }, |
325 |
{ 'sName': 'checkbox', 'bSortable': false } |
382 |
{ 'sName': 'actions', 'bSortable': false } |
326 |
], |
383 |
], |
327 |
"sPaginationType": "full_numbers" |
384 |
"sPaginationType": "full_numbers" |
328 |
})).columnFilter({ |
385 |
})).columnFilter({ |
329 |
'sPlaceHolder': 'head:after', |
386 |
'sPlaceHolder': 'head:after', |
330 |
'aoColumns': [ |
387 |
'aoColumns': [ |
|
|
388 |
null, |
331 |
{ 'type': 'text' }, |
389 |
{ 'type': 'text' }, |
332 |
{ 'type': 'text' }, |
390 |
{ 'type': 'text' }, |
333 |
{ 'type': 'text' }, |
391 |
{ 'type': 'text' }, |
Lines 351-356
Link Here
|
351 |
null |
409 |
null |
352 |
] |
410 |
] |
353 |
}); |
411 |
}); |
|
|
412 |
|
413 |
$('#results').on('change', 'input[type="checkbox"]', function() { |
414 |
var countSelected = $(this).parents('table').find('input:checked').length; |
415 |
var caret = ' <span class="caret">'; |
416 |
if (countSelected > 0) { |
417 |
$('#export-button').html(_("Export selected results to") + caret); |
418 |
} else { |
419 |
$('#export-button').html(_("Export all results to") + caret); |
420 |
} |
421 |
}) |
354 |
} |
422 |
} |
355 |
|
423 |
|
356 |
$(document).ready(function () { |
424 |
$(document).ready(function () { |