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

(-)a/Koha/Biblio.pm (+13 lines)
Lines 966-971 sub get_marc_notes { Link Here
966
    return \@marcnotes;
966
    return \@marcnotes;
967
}
967
}
968
968
969
=head3 public_read_list
970
971
This method returns the list of publicly readable database fields for both API and UI output purposes
972
973
=cut
974
975
sub public_read_list {
976
    return [
977
        'biblionumber', 'frameworkcode', 'title', 'unititle',
978
        'seriestitle',  'copyrightdate', 'datecreated'
979
    ];
980
}
981
969
=head3 to_api
982
=head3 to_api
970
983
971
    my $json = $biblio->to_api;
984
    my $json = $biblio->to_api;
(-)a/api/v1/swagger/paths.json (+3 lines)
Lines 179-184 Link Here
179
  "/public/biblios/{biblio_id}/items": {
179
  "/public/biblios/{biblio_id}/items": {
180
    "$ref": "paths/biblios.json#/~1public~1biblios~1{biblio_id}~1items"
180
    "$ref": "paths/biblios.json#/~1public~1biblios~1{biblio_id}~1items"
181
  },
181
  },
182
  "/public/items/{item_id}/bundled_items": {
183
    "$ref": "paths/items.yaml#/~1public~1items~1{item_id}~1bundled_items"
184
  },
182
  "/public/libraries": {
185
  "/public/libraries": {
183
    "$ref": "paths/libraries.json#/~1public~1libraries"
186
    "$ref": "paths/libraries.json#/~1public~1libraries"
184
  },
187
  },
(-)a/api/v1/swagger/paths/items.yaml (+51 lines)
Lines 303-305 Link Here
303
    x-koha-authorization:
303
    x-koha-authorization:
304
      permissions:
304
      permissions:
305
        reserveforothers: place_holds
305
        reserveforothers: place_holds
306
/public/items/{item_id}/bundled_items:
307
  get:
308
    x-mojo-to: Items#bundled_items
309
    operationId: bundledItemsPublic
310
    tags:
311
      - items
312
    summary: List bundled items
313
    parameters:
314
      - $ref: ../parameters.json#/item_id_pp
315
      - name: external_id
316
        in: query
317
        description: Search on the item's barcode
318
        required: false
319
        type: string
320
      - $ref: ../parameters.json#/match
321
      - $ref: ../parameters.json#/order_by
322
      - $ref: ../parameters.json#/page
323
      - $ref: ../parameters.json#/per_page
324
      - $ref: ../parameters.json#/q_param
325
      - $ref: ../parameters.json#/q_body
326
      - $ref: ../parameters.json#/q_header
327
    consumes:
328
      - application/json
329
    produces:
330
      - application/json
331
    responses:
332
      "200":
333
        description: A list of item
334
        schema:
335
          type: array
336
          items:
337
            $ref: ../definitions.json#/item
338
      "401":
339
        description: Authentication required
340
        schema:
341
          $ref: ../definitions.json#/error
342
      "403":
343
        description: Access forbidden
344
        schema:
345
          $ref: ../definitions.json#/error
346
      "500":
347
        description: Internal server error
348
        schema:
349
          $ref: ../definitions.json#/error
350
      "503":
351
        description: Under maintenance
352
        schema:
353
          $ref: ../definitions.json#/error
354
    x-koha-embed:
355
      - biblio
356
      - checkout
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt (-2 / +89 lines)
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", {
(-)a/opac/opac-detail.pl (-1 / +11 lines)
Lines 750-755 if ( not $viewallitems and @items > $max_items_to_display ) { Link Here
750
        $itm->{cover_images} = $item->cover_images;
750
        $itm->{cover_images} = $item->cover_images;
751
    }
751
    }
752
752
753
    if ($item->is_bundle) {
754
        $itemfields{bundles} = 1;
755
        $itm->{is_bundle} = 1;
756
    }
757
758
    if ($item->in_bundle) {
759
        $itm->{bundle_host} = $item->bundle_host;
760
    }
761
753
    my $itembranch = $itm->{$separatebranch};
762
    my $itembranch = $itm->{$separatebranch};
754
    if ($currentbranch and C4::Context->preference('OpacSeparateHoldings')) {
763
    if ($currentbranch and C4::Context->preference('OpacSeparateHoldings')) {
755
        if ($itembranch and $itembranch eq $currentbranch) {
764
        if ($itembranch and $itembranch eq $currentbranch) {
Lines 800-805 my $norequests = ! $biblio->items->filter_by_for_hold->count; Link Here
800
    $template->param(
809
    $template->param(
801
                     MARCNOTES               => $marcnotesarray,
810
                     MARCNOTES               => $marcnotesarray,
802
                     norequests              => $norequests,
811
                     norequests              => $norequests,
812
                     RequestOnOpac           => C4::Context->preference("RequestOnOpac"),
813
                     itemdata_bundles        => $itemfields{bundles},
803
                     itemdata_ccode          => $itemfields{ccode},
814
                     itemdata_ccode          => $itemfields{ccode},
804
                     itemdata_materials      => $itemfields{materials},
815
                     itemdata_materials      => $itemfields{materials},
805
                     itemdata_enumchron      => $itemfields{enumchron},
816
                     itemdata_enumchron      => $itemfields{enumchron},
806
- 

Return to bug 28854