From 85dc6be8ad9d3f7f25e6e5b7aec57b99f3e1e879 Mon Sep 17 00:00:00 2001 From: Jake Deery Date: Tue, 3 Mar 2026 14:56:01 +0000 Subject: [PATCH] Bug 14962: (QA follow-up) Show Display now shows record title This patch removes the biblionumber from the show display page, and instead shows the record title - still with a hyperlink to the biblio details page. Sponsored-by: ByWater Solutions --- .../prog/js/fetch/biblio-api-client.js | 10 +++- .../components/Display/DisplaysResource.vue | 52 +++++++++++++------ 2 files changed, 44 insertions(+), 18 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/js/fetch/biblio-api-client.js b/koha-tmpl/intranet-tmpl/prog/js/fetch/biblio-api-client.js index 6a0ba72553d..ce84e588b79 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/fetch/biblio-api-client.js +++ b/koha-tmpl/intranet-tmpl/prog/js/fetch/biblio-api-client.js @@ -12,11 +12,17 @@ export class BiblioAPIClient { endpoint: "biblios", query, params, - headers, + headers: { + Accept: "application/json", + ...headers, + }, }), get: id => this.httpClient.get({ - endpoint: "items/" + id, + endpoint: "biblios/" + id, + headers: { + Accept: "application/json", + }, }), }; } diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Display/DisplaysResource.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Display/DisplaysResource.vue index 03d984d2d32..b40183d8b56 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Display/DisplaysResource.vue +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Display/DisplaysResource.vue @@ -251,8 +251,8 @@ export default { hidden: display => !!display.display_items?.length, columns: [ { - name: $__("Record number"), - value: "biblionumber", + name: $__("Record title"), + value: "title", link: { href: "/cgi-bin/koha/catalogue/detail.pl", params: { @@ -260,16 +260,6 @@ export default { }, }, }, - { - name: $__("Internal item number"), - value: "itemnumber", - link: { - href: "/cgi-bin/koha/catalogue/moredetail.pl", - params: { - itemnumber: "itemnumber", - }, - }, - }, { name: $__("Item barcode"), value: "barcode", @@ -360,6 +350,22 @@ export default { }, }; + const getBiblioFromId = async id => { + const bibliosApiClient = APIClient.biblio.biblios; + let item = undefined; + + await bibliosApiClient + .get(id) + .then(data => { + item = data; + }) + .catch(error => { + console.error(error); + }); + + return item; + }; + const getItemFromId = async id => { const itemsApiClient = APIClient.item.items; let item = undefined; @@ -506,12 +512,26 @@ export default { const afterResourceFetch = (componentData, resource, caller) => { if (caller === "show" || caller === "form") { resource.display_items.forEach((display_item, idx) => { + componentData.resource.value.display_items[idx].title = + _("Loading"); + componentData.resource.value.display_items[idx].barcode = + _("Loading"); + + getBiblioFromId(display_item.biblionumber) + .then(biblio => { + componentData.resource.value.display_items[ + idx + ].title = biblio.title; + }) + .catch(error => { + console.error(error); + }); + getItemFromId(display_item.itemnumber) .then(item => { - componentData.resource.value.display_items[idx] = { - barcode: item.external_id, - ...display_item, - }; + componentData.resource.value.display_items[ + idx + ].barcode = item.external_id; }) .catch(error => { console.error(error); -- 2.50.1 (Apple Git-155)