From 63cc298016e512197f94072d9ce76d7e8e725099 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 Signed-off-by: David Nind Signed-off-by: Victor Grousset/tuxayo Signed-off-by: Kyle M Hall Signed-off-by: Kyle M Hall Signed-off-by: Jonathan Druart --- circ/circulation.pl | 13 +++++-------- .../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 44f87b6281..f6dd318f97 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 78d562371e..a8c9f8a04d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -480,11 +480,15 @@