Lines 1068-1074
Link Here
|
1068 |
<caption class="sr-only">Holdings</caption> |
1068 |
<caption class="sr-only">Holdings</caption> |
1069 |
<thead> |
1069 |
<thead> |
1070 |
<tr> |
1070 |
<tr> |
1071 |
|
1071 |
[% IF ( itemdata_bundles ) %] |
|
|
1072 |
<th id="item_bundle" data-colname="item_bundle"></th> |
1073 |
[% END %] |
1072 |
[% IF Koha.Preference('OPACLocalCoverImages') && ( tab == 'holdings' && itemloop_has_images || tab == 'otherholdings' && otheritemloop_has_images ) %] |
1074 |
[% IF Koha.Preference('OPACLocalCoverImages') && ( tab == 'holdings' && itemloop_has_images || tab == 'otherholdings' && otheritemloop_has_images ) %] |
1073 |
<th id="item_cover" data-colname="item_cover">Cover image</th> |
1075 |
<th id="item_cover" data-colname="item_cover">Cover image</th> |
1074 |
[% END %] |
1076 |
[% END %] |
Lines 1118-1124
Link Here
|
1118 |
</thead> |
1120 |
</thead> |
1119 |
<tbody> |
1121 |
<tbody> |
1120 |
[% FOREACH ITEM_RESULT IN items %] |
1122 |
[% FOREACH ITEM_RESULT IN items %] |
1121 |
<tr vocab="http://schema.org/" typeof="Offer"> |
1123 |
<tr vocab="http://schema.org/" typeof="Offer" data-itemnumber="[% ITEM_RESULT.itemnumber | html %]"> |
|
|
1124 |
|
1125 |
[% IF ( itemdata_bundles ) %] |
1126 |
[% IF ITEM_RESULT.is_bundle %] |
1127 |
<td class="details-control"> |
1128 |
<button><i class="fa fa-folder-open"></i></button> |
1129 |
</td> |
1130 |
[% ELSE %] |
1131 |
<td></td> |
1132 |
[% END %] |
1133 |
[% END %] |
1122 |
|
1134 |
|
1123 |
[% IF Koha.Preference('OPACLocalCoverImages') && ( tab == 'holdings' && itemloop_has_images || tab == 'otherholdings' && otheritemloop_has_images ) %] |
1135 |
[% IF Koha.Preference('OPACLocalCoverImages') && ( tab == 'holdings' && itemloop_has_images || tab == 'otherholdings' && otheritemloop_has_images ) %] |
1124 |
<td class="cover"> |
1136 |
<td class="cover"> |
Lines 1421-1426
Link Here
|
1421 |
"autoWidth": false |
1433 |
"autoWidth": false |
1422 |
}, columns_settings); |
1434 |
}, columns_settings); |
1423 |
|
1435 |
|
|
|
1436 |
function createChild ( row, itemnumber ) { |
1437 |
// This is the table we'll convert into a DataTable |
1438 |
var bundles_table = $('<table class="display" width="100%"/>'); |
1439 |
|
1440 |
// Display it the child row |
1441 |
row.child( bundles_table ).show(); |
1442 |
|
1443 |
// Initialise as a DataTable |
1444 |
var bundle_table_url = "/api/v1/items/" + itemnumber + "/bundled_items?"; |
1445 |
var bundle_table = bundles_table.api({ |
1446 |
"ajax": { |
1447 |
"url": bundle_table_url |
1448 |
}, |
1449 |
"header_filter": false, |
1450 |
"embed": [ |
1451 |
"biblio", |
1452 |
"checkout" |
1453 |
], |
1454 |
"order": [[ 0, "asc" ]], |
1455 |
"columns": [ |
1456 |
{ |
1457 |
"data": "item_type", |
1458 |
"title": "Item Type", |
1459 |
"searchable": false, |
1460 |
"orderable": true, |
1461 |
}, |
1462 |
{ |
1463 |
"data": "biblio.title", |
1464 |
"title": "Title", |
1465 |
"searchable": true, |
1466 |
"orderable": true, |
1467 |
}, |
1468 |
{ |
1469 |
"data": "damaged_status", |
1470 |
"title": "Status", |
1471 |
"searchable": false, |
1472 |
"orderable": true, |
1473 |
}, |
1474 |
{ |
1475 |
"data": "external_id", |
1476 |
"title": "Barcode", |
1477 |
"searchable": true, |
1478 |
"orderable": true, |
1479 |
}, |
1480 |
{ |
1481 |
"data": "callnumber", |
1482 |
"title": "Callnumber", |
1483 |
"searchable": true, |
1484 |
"orderable": true, |
1485 |
}, |
1486 |
] |
1487 |
}, [], 1); |
1488 |
|
1489 |
return; |
1490 |
} |
1491 |
|
1492 |
// Add event listener for opening and closing details |
1493 |
$('#holdingst tbody').on('click', 'td.details-control', function () { |
1494 |
var tr = $(this).closest('tr'); |
1495 |
var dTable = $(this).closest('table').DataTable({ 'retrieve': true }); |
1496 |
|
1497 |
var itemnumber = tr.data('itemnumber'); |
1498 |
var row = dTable.row( tr ); |
1499 |
|
1500 |
if ( row.child.isShown() ) { |
1501 |
// This row is already open - close it |
1502 |
row.child.hide(); |
1503 |
tr.removeClass('shown'); |
1504 |
} |
1505 |
else { |
1506 |
// Open this row |
1507 |
createChild(row, itemnumber); |
1508 |
tr.addClass('shown'); |
1509 |
} |
1510 |
} ); |
1511 |
|
1424 |
var serial_column_settings = [% TablesSettings.GetColumns( 'opac', 'biblio-detail', 'subscriptionst', 'json' ) | $raw %]; |
1512 |
var serial_column_settings = [% TablesSettings.GetColumns( 'opac', 'biblio-detail', 'subscriptionst', 'json' ) | $raw %]; |
1425 |
|
1513 |
|
1426 |
KohaTable("#subscriptionst", { |
1514 |
KohaTable("#subscriptionst", { |