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 |
[% notforloan_avcategory = AuthorisedValues.GetCategoryByKohaField('items.notforloan') %] |
160 |
[% IF notforloan_avcategory %] |
161 |
[% notforloans = AuthorisedValues.Get(notforloan_avcategory) %] |
162 |
[% FOREACH nfl IN notforloans %] |
163 |
[% nfl.value = nfl.authorised_value %] |
164 |
[% nfl.label = nfl.lib %] |
165 |
[% END %] |
166 |
[% END %] |
167 |
|
168 |
[% location_avcategory = AuthorisedValues.GetCategoryByKohaField('items.location') %] |
169 |
[% IF location_avcategory %] |
170 |
[% locations = AuthorisedValues.Get(location_avcategory) %] |
171 |
[% FOREACH loc IN locations %] |
172 |
[% loc.value = loc.authorised_value %] |
173 |
[% loc.label = loc.lib %] |
174 |
[% END %] |
175 |
[% END %] |
176 |
|
158 |
[%# Page starts here %] |
177 |
[%# Page starts here %] |
159 |
|
178 |
|
160 |
[% INCLUDE 'doc-head-open.inc' %] |
179 |
[% INCLUDE 'doc-head-open.inc' %] |
Lines 207-212
Link Here
|
207 |
function submitForm($form) { |
226 |
function submitForm($form) { |
208 |
var tr = '' |
227 |
var tr = '' |
209 |
+ ' <tr>' |
228 |
+ ' <tr>' |
|
|
229 |
+ ' <th></th>' |
210 |
+ ' <th>' + _("Title") + '</th>' |
230 |
+ ' <th>' + _("Title") + '</th>' |
211 |
+ ' <th>' + _("Publication date") + '</th>' |
231 |
+ ' <th>' + _("Publication date") + '</th>' |
212 |
+ ' <th>' + _("Publisher") + '</th>' |
232 |
+ ' <th>' + _("Publisher") + '</th>' |
Lines 239-276
Link Here
|
239 |
$('#item-search-block').show(); |
259 |
$('#item-search-block').show(); |
240 |
}); |
260 |
}); |
241 |
|
261 |
|
|
|
262 |
function exportItems(format) { |
263 |
var itemnumbers = []; |
264 |
$('#results').find('input[name="itemnumber"]:checked').each(function() { |
265 |
itemnumbers.push($(this).val()); |
266 |
}); |
267 |
if (itemnumbers.length) { |
268 |
var href = '/cgi-bin/koha/catalogue/item-export.pl?format=' + format; |
269 |
href += '&itemnumber=' + itemnumbers.join('&itemnumber='); |
270 |
location = href; |
271 |
} else { |
272 |
$('#format-' + format).prop('checked', true); |
273 |
$('#itemsearchform').submit(); |
274 |
$('#format-html').prop('checked', true); |
275 |
} |
276 |
} |
277 |
|
242 |
var csvExportLink = $('<a>') |
278 |
var csvExportLink = $('<a>') |
243 |
.attr('href', '#') |
279 |
.attr('href', '#') |
244 |
.html(_("Export results to CSV")) |
280 |
.html(_("CSV")) |
245 |
.addClass('btn btn-default btn-xs') |
|
|
246 |
.on('click', function(e) { |
281 |
.on('click', function(e) { |
247 |
e.preventDefault(); |
282 |
e.preventDefault(); |
248 |
$('#format-csv').prop('checked', true); |
283 |
exportItems('csv') |
249 |
$('#itemsearchform').submit(); |
|
|
250 |
$('#format-html').prop('checked', true); |
251 |
}); |
284 |
}); |
252 |
var barcodesExportLink = $('<a>') |
285 |
var barcodesExportLink = $('<a>') |
253 |
.attr('href', '#') |
286 |
.attr('href', '#') |
254 |
.html(_("Export results to barcodes file")) |
287 |
.html(_("Barcodes file")) |
255 |
.addClass('btn btn-default btn-xs') |
|
|
256 |
.on('click', function(e) { |
288 |
.on('click', function(e) { |
257 |
e.preventDefault(); |
289 |
e.preventDefault(); |
258 |
$('#format-barcodes').prop('checked', true); |
290 |
exportItems('barcodes'); |
259 |
$('#itemsearchform').submit(); |
|
|
260 |
$('#format-html').prop('checked', true); |
261 |
}); |
291 |
}); |
262 |
|
292 |
|
263 |
var editSearchAndExportLinks = $('<p>') |
293 |
var exportButton = $('<div>') |
264 |
.append(editSearchLink) |
294 |
.addClass('btn-group') |
265 |
.append(' | ') |
295 |
.append($('<button>') |
266 |
.append(csvExportLink) |
296 |
.addClass('btn btn-default btn-xs dropdown-toggle') |
|
|
297 |
.attr('id', 'export-button') |
298 |
.attr('data-toggle', 'dropdown') |
299 |
.attr('aria-haspopup', 'true') |
300 |
.attr('aria-expanded', 'false') |
301 |
.html(_("Export all results to") + ' <span class="caret"></span>')) |
302 |
.append($('<ul>') |
303 |
.addClass('dropdown-menu') |
304 |
.append($('<li>').append(csvExportLink)) |
305 |
.append($('<li>').append(barcodesExportLink))); |
306 |
|
307 |
var selectVisibleRows = $('<a>') |
308 |
.attr('href', '#') |
309 |
.append('<i class="fa fa-check"></i> ') |
310 |
.append(_("Select visible rows")) |
311 |
.on('click', function(e) { |
312 |
e.preventDefault(); |
313 |
$('#results input[type="checkbox"]').prop('checked', true).change(); |
314 |
}); |
315 |
var clearSelection = $('<a>') |
316 |
.attr('href', '#') |
317 |
.append('<i class="fa fa-remove"></i> ') |
318 |
.append(_("Clear selection")) |
319 |
.on('click', function(e) { |
320 |
e.preventDefault(); |
321 |
$('#results input[type="checkbox"]').prop('checked', false).change(); |
322 |
}); |
323 |
var exportLinks = $('<p>') |
324 |
.append(selectVisibleRows) |
267 |
.append(' ') |
325 |
.append(' ') |
268 |
.append(barcodesExportLink); |
326 |
.append(clearSelection) |
|
|
327 |
.append(' | ') |
328 |
.append(exportButton); |
269 |
|
329 |
|
270 |
var results_heading = $('<div>').addClass('results-heading') |
330 |
var results_heading = $('<div>').addClass('results-heading') |
271 |
.append("<h1>" + _("Item search results") + "</h1>") |
331 |
.append("<h1>" + _("Item search results") + "</h1>") |
272 |
.append($('<p>').append(advSearchLink)) |
332 |
.append($('<p>').append(advSearchLink)) |
273 |
.append(editSearchAndExportLinks); |
333 |
.append($('<p>').append(editSearchLink)) |
|
|
334 |
.append(exportLinks); |
274 |
$('#results-wrapper').empty() |
335 |
$('#results-wrapper').empty() |
275 |
.append(results_heading) |
336 |
.append(results_heading) |
276 |
.append(table); |
337 |
.append(table); |
Lines 309-315
Link Here
|
309 |
}); |
370 |
}); |
310 |
}, |
371 |
}, |
311 |
'sDom': '<"top pager"ilp>t<"bottom pager"ip>r', |
372 |
'sDom': '<"top pager"ilp>t<"bottom pager"ip>r', |
|
|
373 |
'aaSorting': [[1, 'asc']], |
312 |
'aoColumns': [ |
374 |
'aoColumns': [ |
|
|
375 |
{ 'sName': 'checkbox', 'bSortable': false }, |
313 |
{ 'sName': 'title' }, |
376 |
{ 'sName': 'title' }, |
314 |
{ 'sName': 'publicationyear' }, |
377 |
{ 'sName': 'publicationyear' }, |
315 |
{ 'sName': 'publishercode' }, |
378 |
{ 'sName': 'publishercode' }, |
Lines 322-333
Link Here
|
322 |
{ 'sName': 'stocknumber' }, |
385 |
{ 'sName': 'stocknumber' }, |
323 |
{ 'sName': 'notforloan' }, |
386 |
{ 'sName': 'notforloan' }, |
324 |
{ 'sName': 'issues' }, |
387 |
{ 'sName': 'issues' }, |
325 |
{ 'sName': 'checkbox', 'bSortable': false } |
388 |
{ 'sName': 'actions', 'bSortable': false } |
326 |
], |
389 |
], |
327 |
"sPaginationType": "full_numbers" |
390 |
"sPaginationType": "full_numbers" |
328 |
})).columnFilter({ |
391 |
})).columnFilter({ |
329 |
'sPlaceHolder': 'head:after', |
392 |
'sPlaceHolder': 'head:after', |
330 |
'aoColumns': [ |
393 |
'aoColumns': [ |
|
|
394 |
null, |
331 |
{ 'type': 'text' }, |
395 |
{ 'type': 'text' }, |
332 |
{ 'type': 'text' }, |
396 |
{ 'type': 'text' }, |
333 |
{ 'type': 'text' }, |
397 |
{ 'type': 'text' }, |
Lines 351-356
Link Here
|
351 |
null |
415 |
null |
352 |
] |
416 |
] |
353 |
}); |
417 |
}); |
|
|
418 |
|
419 |
$('#results').on('change', 'input[type="checkbox"]', function() { |
420 |
var countSelected = $(this).parents('table').find('input:checked').length; |
421 |
var caret = ' <span class="caret">'; |
422 |
if (countSelected > 0) { |
423 |
$('#export-button').html(_("Export selected results to") + caret); |
424 |
} else { |
425 |
$('#export-button').html(_("Export all results to") + caret); |
426 |
} |
427 |
}) |
354 |
} |
428 |
} |
355 |
|
429 |
|
356 |
$(document).ready(function () { |
430 |
$(document).ready(function () { |
357 |
- |
|
|