From 09934c016094f1856a85596779fdf2d71c505f9e Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 24 May 2023 15:02:30 +0200 Subject: [PATCH] Bug 33568: Restore host records MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- api/v1/swagger/definitions/item.yaml | 4 ++++ api/v1/swagger/paths/biblios.yaml | 1 + catalogue/detail.pl | 4 ---- .../prog/en/modules/catalogue/detail.tt | 13 +++++++------ 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/api/v1/swagger/definitions/item.yaml b/api/v1/swagger/definitions/item.yaml index cb7894a899..a5d6066fd6 100644 --- a/api/v1/swagger/definitions/item.yaml +++ b/api/v1/swagger/definitions/item.yaml @@ -242,6 +242,10 @@ properties: type: - object - "null" + biblio: + type: + - object + - "null" checkout: type: - object diff --git a/api/v1/swagger/paths/biblios.yaml b/api/v1/swagger/paths/biblios.yaml index a0f83fd9c2..65dbcd6f88 100644 --- a/api/v1/swagger/paths/biblios.yaml +++ b/api/v1/swagger/paths/biblios.yaml @@ -423,6 +423,7 @@ type: string enum: - +strings + - biblio.title - checkout - checkout.patron - transfer diff --git a/catalogue/detail.pl b/catalogue/detail.pl index 774dab7c10..f3ae21949f 100755 --- a/catalogue/detail.pl +++ b/catalogue/detail.pl @@ -198,9 +198,6 @@ my $items_params = { my $all_items = $biblio->items($items_params); my $items_to_display = $all_items->search({ $include_lost_items ? () : ( itemlost => 0 ) }); -# flag indicating existence of at least one item linked via a host record -my $hostrecords = $biblio->host_items->count; - my $dat = &GetBiblioData($biblionumber); #is biblio a collection and are bundles enabled @@ -354,7 +351,6 @@ $template->param( $template->param( MARCNOTES => !$invalid_marc_record ? $biblio->get_marc_notes() : undef, z3950_search_params => C4::Search::z3950_search_args($dat), - hostrecords => $hostrecords, C4::Search::enabled_staff_search_views, ); 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 287493fef8..c845bf4876 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -368,7 +368,7 @@ Materials specified Public notes Non-public notes - [% IF ( hostrecords ) %]Host records[% END %] + Host records [% IF ( analyze ) %]Used in[% END %] [% IF Koha.Preference('UseCourseReserves') %]Course reserves[% END %] [% IF ( SpineLabelShowPrintOnBibDetails ) %]Spine label[% END %] @@ -2194,6 +2194,9 @@ embed.push('course_item.course_reserves.course'); [% END %] + // For host records + embed.push('biblio.title'); + let items_table_settings = { holdings: [% TablesSettings.GetTableSettings('catalogue', 'detail','holdings_table','json') | $raw %], otherholdings: [% TablesSettings.GetTableSettings('catalogue', 'detail','otherholdings_table','json') | $raw %], @@ -2589,17 +2592,15 @@ return escape_str(row.internal_notes); } }, - [% IF ( hostrecords ) %] { - data: "biblio.biblio_id", - searchable: false, // FIXME + data: "biblio.title", + searchable: false, orderable: true, render: function (data, type, row, meta) { if ( row.biblio_id == [% biblio.biblionumber | html %] ) return ""; - return '%s'.format(row.biblio_id, row.biblio.title); } }, - [% END %] [% IF ( analyze ) %] { data: "", -- 2.39.5