From deea0d7d1b18b4d52f478f748fd9d7c1d84d0960 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 17 Feb 2021 10:01:00 +0100 Subject: [PATCH] Bug 18912: Display more info when using itemBarcodeFallbackSearch Using itemBarcodeFallbackSearch entering a barcode on checkout will do a keyword search and provide you with a list of items matching the search term for checkout. This allows checking out items, where there is no barcode in the item (you still need a dummy barcode in Koha). At the moment the table of items to choose from will only chow the title and the dummy barcode. In order to make it more useful and easier to identify the correct item, we should show more information here: - callnumber (952$o) - serial enumeration (952$h) - copy number (952$t) - inventory number (952$i) (description copier from comment 0) Test plan: - Turn on itemBarcodeFallbackSearch (If you have ES you need bug 27597) - Check an item out using "street" or a search that will return several items - Note that you have now more info about the items Signed-off-by: Owen Leonard --- circ/circulation.pl | 13 +++++-------- koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt | 12 ++++++++---- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/circ/circulation.pl b/circ/circulation.pl index ee3878ca13..6708427d0e 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -361,21 +361,18 @@ if (@$barcodes) { # if multiple hits, offer options to librarian if ( $total_hits > 0 ) { - my @options = (); + my @barcodes; foreach my $hit ( @{$results} ) { - my $chosen = + my $chosen = # Maybe easier to retrieve the itemnumber from $hit? TransformMarcToKoha( C4::Search::new_record_from_zebra('biblioserver',$hit) ); # offer all barcodes individually if ( $chosen->{barcode} ) { - foreach my $barcode ( sort split(/\s*\|\s*/, $chosen->{barcode}) ) { - my %chosen_single = %{$chosen}; - $chosen_single{barcode} = $barcode; - push( @options, \%chosen_single ); - } + push @barcodes, sort split(/\s*\|\s*/, $chosen->{barcode}); } } - $template_params->{options} = \@options; + my $items = Koha::Items->search({ barcode => {-in => \@barcodes}}); + $template_params->{options} = $items; } } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt index a4f7369bb2..c5907e34ae 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -446,11 +446,15 @@