From edb1ff56a999056f619b079963e5f2a5f1f2ed41 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 18 Apr 2023 15:26:56 +0200 Subject: [PATCH] Bug 33568: Host title MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See FIXMEs! Signed-off-by: Owen Leonard Signed-off-by: Laurence Rault Signed-off-by: Emily Lamancusa Signed-off-by: Tomás Cohen Arazi --- Koha/REST/V1/Biblios.pm | 5 ++++- koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt | 5 +++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Koha/REST/V1/Biblios.pm b/Koha/REST/V1/Biblios.pm index 94d9ddc59ef..59f70c97d08 100644 --- a/Koha/REST/V1/Biblios.pm +++ b/Koha/REST/V1/Biblios.pm @@ -300,10 +300,13 @@ sub get_items { return try { - my $items_rs = $biblio->items; + # FIXME Do we always need host_items => 1 or depending on a flag? + # FIXME Should we prefetch => ['issue','branchtransfer']? + my $items_rs = $biblio->items( { host_items => 1 } )->search( {}, { join => 'biblioitem' } ) ); $items_rs = $items_rs->filter_by_bookable if $bookable_only; # FIXME We need to order_by serial.publisheddate if we have _order_by=+me.serial_issue_number my $items = $c->objects->search($items_rs); + return $c->render( status => 200, openapi => $items diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt index 588f84d8214..c8f796b4c14 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -2889,11 +2889,12 @@ }, [% IF ( hostrecords ) %] { - data: "", + data: "biblio.biblio_id", searchable: false, // FIXME orderable: true, render: function (data, type, row, meta) { - return ""; // FIXME Display host title with link + if ( row.biblio_id == [% biblio.biblionumber %] ) return ""; + return '