@@ -, +, @@ --- Koha/Biblio.pm | 13 +++ Koha/Item.pm | 15 +++ api/v1/swagger/paths.json | 3 + api/v1/swagger/paths/items.json | 88 ++++++++++++++++++ .../bootstrap/en/modules/opac-detail.tt | 91 ++++++++++++++++++- opac/opac-detail.pl | 10 ++ 6 files changed, 218 insertions(+), 2 deletions(-) --- a/Koha/Biblio.pm +++ a/Koha/Biblio.pm @@ -842,6 +842,19 @@ sub get_marc_notes { return \@marcnotes; } +=head3 public_read_list + +This method returns the list of publicly readable database fields for both API and UI output purposes + +=cut + +sub public_read_list { + return [ + 'biblionumber', 'frameworkcode', 'title', 'unititle', + 'seriestitle', 'copyrightdate', 'datecreated' + ]; +} + =head3 to_api my $json = $biblio->to_api; --- a/Koha/Item.pm +++ a/Koha/Item.pm @@ -1184,6 +1184,21 @@ sub _set_found_trigger { return $self; } + +=head3 public_read_list + +This method returns the list of publicly readable database fields for both API and UI output purposes + +=cut + +sub public_read_list { + return [ + 'itemnumber', 'biblionumber', 'itype', + 'barcode', 'itemcallnumber', 'damaged', + 'withdrawn', 'notforloan', 'itemlost' + ]; +} + =head3 to_api_mapping This method returns the mapping for representing a Koha::Item object --- a/api/v1/swagger/paths.json +++ a/api/v1/swagger/paths.json @@ -173,6 +173,9 @@ "/public/biblios/{biblio_id}": { "$ref": "paths/biblios.json#/~1public~1biblios~1{biblio_id}" }, + "/public/items/{item_id}/bundled_items": { + "$ref": "paths/items.json#/~1public~1items~1{item_id}~1bundled_items" + }, "/public/libraries": { "$ref": "paths/libraries.json#/~1public~1libraries" }, --- a/api/v1/swagger/paths/items.json +++ a/api/v1/swagger/paths/items.json @@ -465,5 +465,93 @@ } } } + }, + "/public/items/{item_id}/bundled_items": { + "get": { + "x-mojo-to": "Items#bundled_items", + "operationId": "bundledItemsPublic", + "tags": [ + "items" + ], + "summary": "List bundled items", + "parameters": [ + { + "$ref": "../parameters.json#/item_id_pp" + }, + { + "name": "external_id", + "in": "query", + "description": "Search on the item's barcode", + "required": false, + "type": "string" + }, + { + "$ref": "../parameters.json#/match" + }, + { + "$ref": "../parameters.json#/order_by" + }, + { + "$ref": "../parameters.json#/page" + }, + { + "$ref": "../parameters.json#/per_page" + }, + { + "$ref": "../parameters.json#/q_param" + }, + { + "$ref": "../parameters.json#/q_body" + }, + { + "$ref": "../parameters.json#/q_header" + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "A list of item", + "schema": { + "type": "array", + "items": { + "$ref": "../definitions.json#/item" + } + } + }, + "401": { + "description": "Authentication required", + "schema": { + "$ref": "../definitions.json#/error" + } + }, + "403": { + "description": "Access forbidden", + "schema": { + "$ref": "../definitions.json#/error" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "../definitions.json#/error" + } + }, + "503": { + "description": "Under maintenance", + "schema": { + "$ref": "../definitions.json#/error" + } + } + }, + "x-koha-embed": [ + "biblio", + "checkout" + ] + } } } --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt +++ a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt @@ -1068,7 +1068,9 @@