Lines 1122-1128
Link Here
|
1122 |
<caption class="sr-only">Holdings</caption> |
1122 |
<caption class="sr-only">Holdings</caption> |
1123 |
<thead> |
1123 |
<thead> |
1124 |
<tr> |
1124 |
<tr> |
1125 |
|
1125 |
[% IF ( itemdata_bundles ) %] |
|
|
1126 |
<th id="item_bundle" data-colname="item_bundle"></th> |
1127 |
[% END %] |
1126 |
[% IF Koha.Preference('OPACLocalCoverImages') && ( tab == 'holdings' && itemloop_has_images || tab == 'otherholdings' && otheritemloop_has_images ) %] |
1128 |
[% IF Koha.Preference('OPACLocalCoverImages') && ( tab == 'holdings' && itemloop_has_images || tab == 'otherholdings' && otheritemloop_has_images ) %] |
1127 |
<th id="item_cover" data-colname="item_cover">Cover image</th> |
1129 |
<th id="item_cover" data-colname="item_cover">Cover image</th> |
1128 |
[% END %] |
1130 |
[% END %] |
Lines 1172-1178
Link Here
|
1172 |
</thead> |
1174 |
</thead> |
1173 |
<tbody> |
1175 |
<tbody> |
1174 |
[% FOREACH ITEM_RESULT IN items %] |
1176 |
[% FOREACH ITEM_RESULT IN items %] |
1175 |
<tr vocab="http://schema.org/" typeof="Offer"> |
1177 |
<tr vocab="http://schema.org/" typeof="Offer" data-itemnumber="[% ITEM_RESULT.itemnumber | html %]"> |
|
|
1178 |
|
1179 |
[% IF ( itemdata_bundles ) %] |
1180 |
[% IF ITEM_RESULT.is_bundle %] |
1181 |
<td class="details-control"> |
1182 |
<button><i class="fa fa-folder-open"></i></button> |
1183 |
</td> |
1184 |
[% ELSE %] |
1185 |
<td></td> |
1186 |
[% END %] |
1187 |
[% END %] |
1176 |
|
1188 |
|
1177 |
[% IF Koha.Preference('OPACLocalCoverImages') && ( tab == 'holdings' && itemloop_has_images || tab == 'otherholdings' && otheritemloop_has_images ) %] |
1189 |
[% IF Koha.Preference('OPACLocalCoverImages') && ( tab == 'holdings' && itemloop_has_images || tab == 'otherholdings' && otheritemloop_has_images ) %] |
1178 |
<td class="cover"> |
1190 |
<td class="cover"> |
Lines 1645-1650
Link Here
|
1645 |
"autoWidth": false |
1657 |
"autoWidth": false |
1646 |
}, columns_settings); |
1658 |
}, columns_settings); |
1647 |
|
1659 |
|
|
|
1660 |
function createChild ( row, itemnumber ) { |
1661 |
// This is the table we'll convert into a DataTable |
1662 |
var bundles_table = $('<table class="display" width="100%"/>'); |
1663 |
|
1664 |
// Display it the child row |
1665 |
row.child( bundles_table ).show(); |
1666 |
|
1667 |
// Initialise as a DataTable |
1668 |
var bundle_table_url = "/api/v1/public/items/" + itemnumber + "/bundled_items?"; |
1669 |
var bundle_table = bundles_table.api({ |
1670 |
"ajax": { |
1671 |
"url": bundle_table_url |
1672 |
}, |
1673 |
"header_filter": false, |
1674 |
"embed": [ |
1675 |
"biblio" |
1676 |
], |
1677 |
"order": [[ 0, "asc" ]], |
1678 |
"columns": [ |
1679 |
{ |
1680 |
"data": "item_type", |
1681 |
"title": "Item Type", |
1682 |
"searchable": false, |
1683 |
"orderable": true, |
1684 |
}, |
1685 |
{ |
1686 |
"data": "biblio.title", |
1687 |
"title": "Title", |
1688 |
"searchable": true, |
1689 |
"orderable": true, |
1690 |
}, |
1691 |
{ |
1692 |
"data": "damaged_status", |
1693 |
"title": "Status", |
1694 |
"searchable": false, |
1695 |
"orderable": true, |
1696 |
}, |
1697 |
{ |
1698 |
"data": "external_id", |
1699 |
"title": "Barcode", |
1700 |
"searchable": true, |
1701 |
"orderable": true, |
1702 |
}, |
1703 |
{ |
1704 |
"data": "callnumber", |
1705 |
"title": "Callnumber", |
1706 |
"searchable": true, |
1707 |
"orderable": true, |
1708 |
}, |
1709 |
] |
1710 |
}, [], 1); |
1711 |
|
1712 |
return; |
1713 |
} |
1714 |
|
1715 |
// Add event listener for opening and closing details |
1716 |
$('#holdingst tbody').on('click', 'td.details-control', function () { |
1717 |
var tr = $(this).closest('tr'); |
1718 |
var dTable = $(this).closest('table').DataTable({ 'retrieve': true }); |
1719 |
|
1720 |
var itemnumber = tr.data('itemnumber'); |
1721 |
var row = dTable.row( tr ); |
1722 |
|
1723 |
if ( row.child.isShown() ) { |
1724 |
// This row is already open - close it |
1725 |
row.child.hide(); |
1726 |
tr.removeClass('shown'); |
1727 |
} |
1728 |
else { |
1729 |
// Open this row |
1730 |
createChild(row, itemnumber); |
1731 |
tr.addClass('shown'); |
1732 |
} |
1733 |
} ); |
1734 |
|
1648 |
var serial_column_settings = [% TablesSettings.GetColumns( 'opac', 'biblio-detail', 'subscriptionst', 'json' ) | $raw %]; |
1735 |
var serial_column_settings = [% TablesSettings.GetColumns( 'opac', 'biblio-detail', 'subscriptionst', 'json' ) | $raw %]; |
1649 |
|
1736 |
|
1650 |
KohaTable("#subscriptionst", { |
1737 |
KohaTable("#subscriptionst", { |