From e9259f3a3944fdc0c0d55e1d0f78132cba486d61 Mon Sep 17 00:00:00 2001 From: Julian Maurice Date: Tue, 26 Nov 2019 16:26:38 +0100 Subject: [PATCH] Bug 24192: Show host record items in basket/shelves If EasyAnalyticalRecords is enabled, and if record has no items, display host record items in baskets and lists (staff interface only) Test plan: 0. Login to staff interface 1. Set EasyAnalyticalRecords to "Display" 2. Create a biblio record without items 3. On the biblio record detail page, click in the menu Edit > Link to host item, and enter a valid barcode 4. Add the biblio record to your cart 5. Open your cart and verify that the linked item is displayed 6. Add the biblio record to a list 7. Open the list and verify that the linked item is displayed Signed-off-by: Laura Escamilla --- basket/basket.pl | 3 +++ virtualshelves/shelves.pl | 3 +++ 2 files changed, 6 insertions(+) diff --git a/basket/basket.pl b/basket/basket.pl index 54fabe44d4..370f9bcbde 100755 --- a/basket/basket.pl +++ b/basket/basket.pl @@ -90,6 +90,9 @@ foreach my $biblionumber ( @bibs ) { $num++; $dat->{biblionumber} = $biblionumber; $dat->{ITEM_RESULTS} = $biblio->items->search_ordered; + if ($dat->{ITEM_RESULTS}->count == 0) { + $dat->{ITEM_RESULTS} = $biblio->host_items->search_ordered; + } $dat->{MARCNOTES} = $marcnotesarray; $dat->{MARCSUBJCTS} = $marcsubjctsarray; $dat->{MARCAUTHORS} = $marcauthorsarray; diff --git a/virtualshelves/shelves.pl b/virtualshelves/shelves.pl index fa92cfcd6e..ed3b360af4 100755 --- a/virtualshelves/shelves.pl +++ b/virtualshelves/shelves.pl @@ -323,6 +323,9 @@ if ( $op eq 'view' ) { # Getting items infos for location display my $items = $biblio->items; + if ($items->count == 0) { + $items = $biblio->host_items; + } $this_item->{'ITEM_RESULTS'} = $items; $this_item->{biblionumber} = $biblionumber; push @items, $this_item; -- 2.30.2