Lines 315-320
Link Here
|
315 |
<table class="items_table" id="[% tab | html %]_table"> |
315 |
<table class="items_table" id="[% tab | html %]_table"> |
316 |
<thead> |
316 |
<thead> |
317 |
<tr> |
317 |
<tr> |
|
|
318 |
[% IF ( itemdata_bundles ) %]<th id="[% tab | html %]_bundles" data-colname="[% tab | html %]_bundles" class="NoSort"></th>[% END %] |
318 |
[% IF (StaffDetailItemSelection) %]<th id="[% tab | html %]_checkbox" data-colname="[% tab | html %]_checkbox" class="NoSort"></th>[% END %] |
319 |
[% IF (StaffDetailItemSelection) %]<th id="[% tab | html %]_checkbox" data-colname="[% tab | html %]_checkbox" class="NoSort"></th>[% END %] |
319 |
[% IF Koha.Preference('LocalCoverImages') && ( tab == 'holdings' && itemloop_has_images || tab == 'otherholdings' && otheritemloop_has_images ) %] |
320 |
[% IF Koha.Preference('LocalCoverImages') && ( tab == 'holdings' && itemloop_has_images || tab == 'otherholdings' && otheritemloop_has_images ) %] |
320 |
<th id="[% tab | html %]_cover_image" data-colname="[% tab | html %]_cover_image">Cover image</th> |
321 |
<th id="[% tab | html %]_cover_image" data-colname="[% tab | html %]_cover_image">Cover image</th> |
Lines 347-353
Link Here
|
347 |
</thead> |
348 |
</thead> |
348 |
<tbody> |
349 |
<tbody> |
349 |
[% FOREACH item IN items %] |
350 |
[% FOREACH item IN items %] |
350 |
<tr> |
351 |
<tr id="item_[% item.itemnumber | html %]" data-itemnumber="[% item.itemnumber | html %]"> |
|
|
352 |
[% IF ( itemdata_bundles ) %] |
353 |
[% IF ( item.is_bundle ) %] |
354 |
<td class="details-control"> |
355 |
<button><i class="fa fa-folder-open"></i></button> |
356 |
</td> |
357 |
[% ELSE %] |
358 |
<td></td> |
359 |
[% END %] |
360 |
[% END %] |
351 |
[% IF (StaffDetailItemSelection) %] |
361 |
[% IF (StaffDetailItemSelection) %] |
352 |
<td style="text-align:center;vertical-align:middle"> |
362 |
<td style="text-align:center;vertical-align:middle"> |
353 |
<input type="checkbox" value="[% item.itemnumber | html %]" name="itemnumber" /> |
363 |
<input type="checkbox" value="[% item.itemnumber | html %]" name="itemnumber" /> |
Lines 455-460
Note that permanent location is a code, and location may be an authval.
Link Here
|
455 |
[% ELSE %] |
465 |
[% ELSE %] |
456 |
<span class="lost">Unavailable (lost or missing)</span> |
466 |
<span class="lost">Unavailable (lost or missing)</span> |
457 |
[% END %] |
467 |
[% END %] |
|
|
468 |
[% IF ( item.itemlost == Koha.Preference('BundleLostValue') AND item.loss_checkout ) %] |
469 |
<span>[% item.loss_checkout.borrowernumber | html %]</span> |
470 |
[% END %] |
458 |
[% END %] |
471 |
[% END %] |
459 |
|
472 |
|
460 |
[% IF ( item.withdrawn ) %] |
473 |
[% IF ( item.withdrawn ) %] |
Lines 509-514
Note that permanent location is a code, and location may be an authval.
Link Here
|
509 |
<span class="restricted">([% item.restrictedvalue | html %])</span> |
522 |
<span class="restricted">([% item.restrictedvalue | html %])</span> |
510 |
[% END %] |
523 |
[% END %] |
511 |
|
524 |
|
|
|
525 |
[% IF ( item.bundle_host ) %] |
526 |
<span class="bundled">In bundle: [% INCLUDE 'biblio-title.inc' biblio = item.bundle_host.biblio link = 1 %]</span> |
527 |
[% END %] |
528 |
|
512 |
</td> |
529 |
</td> |
513 |
<td class="datelastseen" data-order="[% item.datelastseen | html %]">[% item.datelastseen | $KohaDates %]</td> |
530 |
<td class="datelastseen" data-order="[% item.datelastseen | html %]">[% item.datelastseen | $KohaDates %]</td> |
514 |
<td class="dateaccessioned" data-order="[% item.dateaccessioned | html %]">[% item.dateaccessioned | $KohaDates %]</td> |
531 |
<td class="dateaccessioned" data-order="[% item.dateaccessioned | html %]">[% item.dateaccessioned | $KohaDates %]</td> |
Lines 593-598
Note that permanent location is a code, and location may be an authval.
Link Here
|
593 |
<a class="btn btn-default btn-xs" href="/cgi-bin/koha/cataloguing/additem.pl?op=edititem&biblionumber=[% item.biblionumber | html %]&itemnumber=[% item.itemnumber | html %]#edititem"><i class="fa fa-pencil"></i> Edit</a> |
610 |
<a class="btn btn-default btn-xs" href="/cgi-bin/koha/cataloguing/additem.pl?op=edititem&biblionumber=[% item.biblionumber | html %]&itemnumber=[% item.itemnumber | html %]#edititem"><i class="fa fa-pencil"></i> Edit</a> |
594 |
[% END %] |
611 |
[% END %] |
595 |
[% END %] |
612 |
[% END %] |
|
|
613 |
[% IF collection %] |
614 |
<button type="button" data-toggle="modal" data-target="#bundleItemsModal" data-item="[% item.itemnumber | html %]" class="btn btn-default btn-xs"><i class="fa fa-folder"></i> Bundle</button> |
615 |
[% END %] |
596 |
</td> |
616 |
</td> |
597 |
[% END %] |
617 |
[% END %] |
598 |
</tr> |
618 |
</tr> |
Lines 1020-1025
Note that permanent location is a code, and location may be an authval.
Link Here
|
1020 |
|
1040 |
|
1021 |
[% END %] |
1041 |
[% END %] |
1022 |
|
1042 |
|
|
|
1043 |
<div class="modal" id="bundleItemsModal" tabindex="-1" role="dialog" aria-labelledby="bundleItemsLabel"> |
1044 |
<form id="bundleItemsForm" action=""> |
1045 |
<div class="modal-dialog" role="document"> |
1046 |
<div class="modal-content"> |
1047 |
<div class="modal-header"> |
1048 |
<button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button> |
1049 |
<h3 id="bundleItemsLabel">Add to bundle</h3> |
1050 |
</div> |
1051 |
<div class="modal-body"> |
1052 |
<div id="result"></div> |
1053 |
<fieldset class="rows"> |
1054 |
<ol> |
1055 |
<li> |
1056 |
<label class="required" for="external_id">Item barcode: </label> |
1057 |
<input type="text" id="external_id" name="external_id" required="required"> |
1058 |
<span class="required">Required</span> |
1059 |
</li> |
1060 |
</ol> |
1061 |
</fieldset> |
1062 |
</div> |
1063 |
<div class="modal-footer"> |
1064 |
<button type="submit" class="btn btn-default">Submit</button> |
1065 |
<button class="btn btn-default" data-dismiss="modal" aria-hidden="true">Close</button> |
1066 |
</div> |
1067 |
</div> |
1068 |
</div> |
1069 |
</form> |
1070 |
</div> |
1071 |
|
1023 |
[% MACRO jsinclude BLOCK %] |
1072 |
[% MACRO jsinclude BLOCK %] |
1024 |
[% INCLUDE 'catalog-strings.inc' %] |
1073 |
[% INCLUDE 'catalog-strings.inc' %] |
1025 |
[% Asset.js("js/catalog.js") | $raw %] |
1074 |
[% Asset.js("js/catalog.js") | $raw %] |
Lines 1315-1320
Note that permanent location is a code, and location may be an authval.
Link Here
|
1315 |
[% INCLUDE 'datatables.inc' %] |
1364 |
[% INCLUDE 'datatables.inc' %] |
1316 |
[% Asset.js("lib/jquery/plugins/jquery.dataTables.columnFilter.js") | $raw %] |
1365 |
[% Asset.js("lib/jquery/plugins/jquery.dataTables.columnFilter.js") | $raw %] |
1317 |
[% INCLUDE 'columns_settings.inc' %] |
1366 |
[% INCLUDE 'columns_settings.inc' %] |
|
|
1367 |
[% INCLUDE 'js-date-format.inc' %] |
1318 |
[% Asset.js("js/browser.js") | $raw %] |
1368 |
[% Asset.js("js/browser.js") | $raw %] |
1319 |
[% Asset.js("js/table_filters.js") | $raw %] |
1369 |
[% Asset.js("js/table_filters.js") | $raw %] |
1320 |
<script> |
1370 |
<script> |
Lines 1323-1328
Note that permanent location is a code, and location may be an authval.
Link Here
|
1323 |
browser.show(); |
1373 |
browser.show(); |
1324 |
|
1374 |
|
1325 |
$(document).ready(function() { |
1375 |
$(document).ready(function() { |
|
|
1376 |
|
1377 |
function createChild ( row, itemnumber ) { |
1378 |
// This is the table we'll convert into a DataTable |
1379 |
var bundles_table = $('<table class="display" width="100%"/>'); |
1380 |
|
1381 |
// Display it the child row |
1382 |
row.child( bundles_table ).show(); |
1383 |
|
1384 |
// Initialise as a DataTable |
1385 |
var bundle_table_url = "/api/v1/items/" + itemnumber + "/bundled_items?"; |
1386 |
var bundle_table = bundles_table.api({ |
1387 |
"ajax": { |
1388 |
"url": bundle_table_url |
1389 |
}, |
1390 |
"header_filter": false, |
1391 |
"embed": [ |
1392 |
"biblio", |
1393 |
"checkout" |
1394 |
], |
1395 |
"order": [[ 1, "asc" ]], |
1396 |
"columns": [ |
1397 |
{ |
1398 |
"data": "biblio.title:biblio.medium", |
1399 |
"title": "Title", |
1400 |
"searchable": true, |
1401 |
"orderable": true, |
1402 |
"render": function(data, type, row, meta) { |
1403 |
var title = ""; |
1404 |
if ( row.biblio.title ) { |
1405 |
title = title.concat('<span class="biblio-title">',row.biblio.title,'</span>'); |
1406 |
} |
1407 |
if ( row.biblio.medium ) { |
1408 |
title = title.concat('<span class="biblio-medium">',row.biblio.medium,'</span>'); |
1409 |
} |
1410 |
return title; |
1411 |
} |
1412 |
}, |
1413 |
{ |
1414 |
"data": "biblio.author", |
1415 |
"title": "Author", |
1416 |
"searchable": true, |
1417 |
"orderable": true, |
1418 |
}, |
1419 |
{ |
1420 |
"data": "ccode", |
1421 |
"title": "Collection code", |
1422 |
"searchable": true, |
1423 |
"orderable": true, |
1424 |
}, |
1425 |
{ |
1426 |
"data": "item_type", |
1427 |
"title": "Item Type", |
1428 |
"searchable": false, |
1429 |
"orderable": true, |
1430 |
}, |
1431 |
{ |
1432 |
"data": "callnumber", |
1433 |
"title": "Callnumber", |
1434 |
"searchable": true, |
1435 |
"orderable": true, |
1436 |
}, |
1437 |
{ |
1438 |
"data": "external_id", |
1439 |
"title": "Barcode", |
1440 |
"searchable": true, |
1441 |
"orderable": true, |
1442 |
}, |
1443 |
{ |
1444 |
"data": "lost_status:last_seen_date", |
1445 |
"title": "Status", |
1446 |
"searchable": false, |
1447 |
"orderable": true, |
1448 |
"render": function(data, type, row, meta) { |
1449 |
if ( row.lost_status ) { |
1450 |
return "Lost: " + row.lost_status; |
1451 |
} |
1452 |
return "Available"; |
1453 |
} |
1454 |
}, |
1455 |
{ |
1456 |
"data": function( row, type, val, meta ) { |
1457 |
var result = '<a class="btn btn-default btn-xs" role="button" href="#removeFromBundleConfirmModal"><i class="fa fa-trash" aria-hidden="true"></i> '+_("Remove")+'</a>\n'; |
1458 |
return result; |
1459 |
}, |
1460 |
"title": "Actions", |
1461 |
"searchable": false, |
1462 |
"orderable": false |
1463 |
} |
1464 |
] |
1465 |
}, [], 1); |
1466 |
|
1467 |
return; |
1468 |
} |
1469 |
|
1326 |
var ids = ['holdings_table', 'otherholdings_table']; |
1470 |
var ids = ['holdings_table', 'otherholdings_table']; |
1327 |
var columns_settings = [ [% TablesSettings.GetColumns('catalogue', 'detail','holdings_table','json') | $raw %], [% TablesSettings.GetColumns('catalogue', 'detail','otherholdings_table','json') | $raw %] ]; |
1471 |
var columns_settings = [ [% TablesSettings.GetColumns('catalogue', 'detail','holdings_table','json') | $raw %], [% TablesSettings.GetColumns('catalogue', 'detail','otherholdings_table','json') | $raw %] ]; |
1328 |
var has_images = ["[% itemloop_has_images | html %]", "[% otheritemloop_has_images | html %]"]; |
1472 |
var has_images = ["[% itemloop_has_images | html %]", "[% otheritemloop_has_images | html %]"]; |
Lines 1339-1344
Note that permanent location is a code, and location may be an authval.
Link Here
|
1339 |
"sDom": 'C<"top pager"ilpfB><"#filter_c">tr<"bottom pager"ip>', |
1483 |
"sDom": 'C<"top pager"ilpfB><"#filter_c">tr<"bottom pager"ip>', |
1340 |
}; |
1484 |
}; |
1341 |
var table = KohaTable(id, dt_parameters, columns_settings[i], 'with_filters'); |
1485 |
var table = KohaTable(id, dt_parameters, columns_settings[i], 'with_filters'); |
|
|
1486 |
|
1487 |
// Add event listener for opening and closing details |
1488 |
$('#' + id + ' tbody').on('click', 'td.details-control', function () { |
1489 |
var tr = $(this).closest('tr'); |
1490 |
var dTable = $(this).closest('table').DataTable({ 'retrieve': true }); |
1491 |
|
1492 |
var itemnumber = tr.data('itemnumber'); |
1493 |
var row = dTable.row( tr ); |
1494 |
|
1495 |
if ( row.child.isShown() ) { |
1496 |
// This row is already open - close it |
1497 |
row.child.hide(); |
1498 |
tr.removeClass('shown'); |
1499 |
} |
1500 |
else { |
1501 |
// Open this row |
1502 |
createChild(row, itemnumber); |
1503 |
tr.addClass('shown'); |
1504 |
} |
1505 |
} ); |
1342 |
} |
1506 |
} |
1343 |
|
1507 |
|
1344 |
[% IF Koha.Preference('AcquisitionDetails') %] |
1508 |
[% IF Koha.Preference('AcquisitionDetails') %] |
Lines 1360-1365
Note that permanent location is a code, and location may be an authval.
Link Here
|
1360 |
"sPaginationType": "full" |
1524 |
"sPaginationType": "full" |
1361 |
})); |
1525 |
})); |
1362 |
[% END %] |
1526 |
[% END %] |
|
|
1527 |
|
1528 |
$("#bundleItemsModal").on("shown.bs.modal", function(e){ |
1529 |
var button = $(e.relatedTarget); |
1530 |
var item_id = button.data('item'); |
1531 |
$("#result").replaceWith('<div id="result"></div>'); |
1532 |
$("#bundleItemsForm").attr('action', '/api/v1/items/' + item_id + '/bundled_items/item'); |
1533 |
$("#external_id").focus(); |
1534 |
}); |
1535 |
|
1536 |
$("#bundleItemsForm").submit(function(event) { |
1537 |
|
1538 |
/* stop form from submitting normally */ |
1539 |
event.preventDefault(); |
1540 |
|
1541 |
/* get the action attribute from the <form action=""> element */ |
1542 |
var $form = $(this), |
1543 |
url = $form.attr('action'); |
1544 |
|
1545 |
/* Send the data using post with external_id */ |
1546 |
var posting = $.post(url, JSON.stringify({ |
1547 |
external_id: $('#external_id').val() |
1548 |
}), null, "json"); |
1549 |
|
1550 |
/* Report the results */ |
1551 |
posting.done(function(data) { |
1552 |
var barcode = $('#external_id').val(); |
1553 |
$('#result').replaceWith('<div id="result" class="alert alert-success">Success: Added '+barcode+'</div>'); |
1554 |
$('#external_id').val('').focus(); |
1555 |
}); |
1556 |
posting.fail(function(data) { |
1557 |
var barcode = $('#external_id').val(); |
1558 |
if ( data.status === 409 ) { |
1559 |
var response = data.responseJSON; |
1560 |
if ( response.key === "PRIMARY" ) { |
1561 |
$('#result').replaceWith('<div id="result" class="alert alert-warning">Warning: Item '+barcode+' already attached</div>'); |
1562 |
} else { |
1563 |
$('#result').replaceWith('<div id="result" class="alert alert-danger">Failure: Item '+barcode+' belongs to another bundle</div>'); |
1564 |
} |
1565 |
} else { |
1566 |
$('#result').replaceWith('<div id="result" class="alert alert-danger">Failure</div>'); |
1567 |
} |
1568 |
$('#external_id').val('').focus(); |
1569 |
}); |
1570 |
}); |
1363 |
}); |
1571 |
}); |
1364 |
|
1572 |
|
1365 |
$(document).ready(function() { |
1573 |
$(document).ready(function() { |