From 3e05aff32826532b1c4b0182c472c39007d61a08 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=utf8 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 Signed-off-by: Katrin Fischer --- 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 94d9ddc59e..59f70c97d0 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 588f84d821..c8f796b4c1 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 '