View | Details | Raw Unified | Return to bug 24454
Collapse All | Expand All

(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt (-2 / +90 lines)
Lines 1066-1072 Link Here
1066
        <caption class="sr-only">Holdings</caption>
1066
        <caption class="sr-only">Holdings</caption>
1067
        <thead>
1067
        <thead>
1068
            <tr>
1068
            <tr>
1069
1069
                [% IF ( itemdata_bundles ) %]
1070
                    <th id="item_bundle" data-colname="item_bundle"></th>
1071
                [% END %]
1070
                [% IF Koha.Preference('OPACLocalCoverImages') && ( tab == 'holdings' && itemloop_has_images || tab == 'otherholdings' && otheritemloop_has_images ) %]
1072
                [% IF Koha.Preference('OPACLocalCoverImages') && ( tab == 'holdings' && itemloop_has_images || tab == 'otherholdings' && otheritemloop_has_images ) %]
1071
                    <th id="item_cover" data-colname="item_cover">Cover image</th>
1073
                    <th id="item_cover" data-colname="item_cover">Cover image</th>
1072
                [% END %]
1074
                [% END %]
Lines 1116-1122 Link Here
1116
        </thead>
1118
        </thead>
1117
        <tbody>
1119
        <tbody>
1118
            [% FOREACH ITEM_RESULT IN items %]
1120
            [% FOREACH ITEM_RESULT IN items %]
1119
                <tr vocab="http://schema.org/" typeof="Offer">
1121
                <tr vocab="http://schema.org/" typeof="Offer" data-itemnumber="[% ITEM_RESULT.itemnumber | html %]">
1122
1123
                [% IF ( itemdata_bundles ) %]
1124
                    [% IF ITEM_RESULT.is_bundle %]
1125
                    <td class="details-control">
1126
                        <button><i class="fa fa-folder-open"></i></button>
1127
                    </td>
1128
                    [% ELSE %]
1129
                    <td></td>
1130
                    [% END %]
1131
                [% END %]
1120
1132
1121
                [% IF Koha.Preference('OPACLocalCoverImages') && ( tab == 'holdings' && itemloop_has_images || tab == 'otherholdings' && otheritemloop_has_images ) %]
1133
                [% IF Koha.Preference('OPACLocalCoverImages') && ( tab == 'holdings' && itemloop_has_images || tab == 'otherholdings' && otheritemloop_has_images ) %]
1122
                    <td class="cover">
1134
                    <td class="cover">
Lines 1419-1424 Link Here
1419
                "autoWidth": false
1431
                "autoWidth": false
1420
            }, columns_settings);
1432
            }, columns_settings);
1421
1433
1434
            function createChild ( row, itemnumber ) {
1435
                // This is the table we'll convert into a DataTable
1436
                var bundles_table = $('<table class="display" width="100%"/>');
1437
1438
                // Display it the child row
1439
                row.child( bundles_table ).show();
1440
1441
                // Initialise as a DataTable
1442
                var bundle_table_url = "/api/v1/items/" + itemnumber + "/bundled_items?";
1443
                var bundle_table = bundles_table.api({
1444
                    "ajax": {
1445
                        "url": bundle_table_url
1446
                    },
1447
                    "header_filter": false,
1448
                    "embed": [
1449
                        "biblio",
1450
                        "checkout"
1451
                    ],
1452
                    "order": [[ 0, "asc" ]],
1453
                    "columns": [
1454
                        {
1455
                            "data": "item_type",
1456
                            "title": "Item Type",
1457
                            "searchable": false,
1458
                            "orderable": true,
1459
                        },
1460
                        {
1461
                            "data": "biblio.title",
1462
                            "title": "Title",
1463
                            "searchable": true,
1464
                            "orderable": true,
1465
                        },
1466
                        {
1467
                            "data": "damaged_status",
1468
                            "title": "Status",
1469
                            "searchable": false,
1470
                            "orderable": true,
1471
                        },
1472
                        {
1473
                            "data": "external_id",
1474
                            "title": "Barcode",
1475
                            "searchable": true,
1476
                            "orderable": true,
1477
                        },
1478
                        {
1479
                            "data": "callnumber",
1480
                            "title": "Callnumber",
1481
                            "searchable": true,
1482
                            "orderable": true,
1483
                        },
1484
                    ]
1485
                }, [], 1);
1486
1487
                return;
1488
            }
1489
1490
            // Add event listener for opening and closing details
1491
            $('#holdingst tbody').on('click', 'td.details-control', function () {
1492
                var tr = $(this).closest('tr');
1493
                var dTable = $(this).closest('table').DataTable({ 'retrieve': true });
1494
1495
                var itemnumber = tr.data('itemnumber');
1496
                var row = dTable.row( tr );
1497
1498
                if ( row.child.isShown() ) {
1499
                    // This row is already open - close it
1500
                    row.child.hide();
1501
                    tr.removeClass('shown');
1502
                }
1503
                else {
1504
                    // Open this row
1505
                    createChild(row, itemnumber);
1506
                    tr.addClass('shown');
1507
                }
1508
            } );
1509
1422
            var serial_column_settings = [% TablesSettings.GetColumns( 'opac', 'biblio-detail', 'subscriptionst', 'json' ) | $raw %];
1510
            var serial_column_settings = [% TablesSettings.GetColumns( 'opac', 'biblio-detail', 'subscriptionst', 'json' ) | $raw %];
1423
1511
1424
            KohaTable("#subscriptionst", {
1512
            KohaTable("#subscriptionst", {
(-)a/opac/opac-detail.pl (-1 / +10 lines)
Lines 752-757 if ( not $viewallitems and @items > $max_items_to_display ) { Link Here
752
        $itm->{cover_images} = $item->cover_images;
752
        $itm->{cover_images} = $item->cover_images;
753
    }
753
    }
754
754
755
    if ($item->is_bundle) {
756
        $itemfields{bundles} = 1;
757
        $itm->{is_bundle} = 1;
758
    }
759
760
    if ($item->in_bundle) {
761
        $itm->{bundle_host} = $item->bundle_host;
762
    }
763
755
    my $itembranch = $itm->{$separatebranch};
764
    my $itembranch = $itm->{$separatebranch};
756
    if ($currentbranch and C4::Context->preference('OpacSeparateHoldings')) {
765
    if ($currentbranch and C4::Context->preference('OpacSeparateHoldings')) {
757
        if ($itembranch and $itembranch eq $currentbranch) {
766
        if ($itembranch and $itembranch eq $currentbranch) {
Lines 802-807 if( C4::Context->preference('ArticleRequests') ) { Link Here
802
                     MARCNOTES               => $marcnotesarray,
811
                     MARCNOTES               => $marcnotesarray,
803
                     norequests              => $norequests,
812
                     norequests              => $norequests,
804
                     RequestOnOpac           => C4::Context->preference("RequestOnOpac"),
813
                     RequestOnOpac           => C4::Context->preference("RequestOnOpac"),
814
                     itemdata_bundles        => $itemfields{bundles},
805
                     itemdata_ccode          => $itemfields{ccode},
815
                     itemdata_ccode          => $itemfields{ccode},
806
                     itemdata_materials      => $itemfields{materials},
816
                     itemdata_materials      => $itemfields{materials},
807
                     itemdata_enumchron      => $itemfields{enumchron},
817
                     itemdata_enumchron      => $itemfields{enumchron},
808
- 

Return to bug 24454