From 6be604c4a6f603670ed8901d23d1199d2b976aab Mon Sep 17 00:00:00 2001 From: Kyle Hall Date: Fri, 21 Oct 2022 12:02:08 -0400 Subject: [PATCH] Bug 24860: (QA follow-up) Show group holds on Holds to pull Signed-off-by: Katrin Fischer Signed-off-by: Tomas Cohen Arazi --- circ/pendingreserves.pl | 10 ++++++++-- .../prog/en/modules/circ/pendingreserves.tt | 12 +++++++++++- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/circ/pendingreserves.pl b/circ/pendingreserves.pl index 86a18b14f0..5019e0c50c 100755 --- a/circ/pendingreserves.pl +++ b/circ/pendingreserves.pl @@ -229,7 +229,7 @@ my $all_holds = { map { $_->biblionumber => $_ } @{ Koha::Holds->search( { reserve_id => [ values %$holds_biblios_map ]}, { - prefetch => [ 'borrowernumber', 'itembib', 'biblio' ], + prefetch => [ 'borrowernumber', 'itembib', 'biblio', 'item_group' ], } )->as_list } @@ -265,6 +265,8 @@ foreach my $bibnum ( @biblionumbers ){ } $hold_info->{itemtypes} = \@res_itemtypes; + my $res_info = $all_holds->{$bibnum}; + # get available values for each biblio my $fields = { locations => 'location', @@ -282,6 +284,10 @@ foreach my $bibnum ( @biblionumbers ){ [ uniq map { defined $_->$field ? $_->$field : () } @$items ]; } + if ( $res_info->item_group ) { + $hold_info->{barcodes} = [ uniq map { defined $_->barcode && $_->item_group->id == $res_info->item_group_id ? $_->barcode : () } @$items ]; + } + # items available $hold_info->{items_count} = $items_count; @@ -292,11 +298,11 @@ foreach my $bibnum ( @biblionumbers ){ $hold_info->{pull_count} = $pull_count; # get other relevant information - my $res_info = $all_holds->{$bibnum}; $hold_info->{patron} = $res_info->patron; $hold_info->{item} = $res_info->item; $hold_info->{biblio} = $res_info->biblio; $hold_info->{hold} = $res_info; + $hold_info->{item_group} = $res_info->item_group; push @holds_info, $hold_info; } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingreserves.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingreserves.tt index 1b7aecabd7..2220cf9043 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingreserves.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingreserves.tt @@ -129,7 +129,17 @@ [% IF ( hold_info.barcodes.size ) %] [% SET barcode = hold_info.barcodes.first %] - [% IF ( hold_info.item ) %]Only [% barcode | html %][% ELSE %][% barcode | html %] or any available.[% END %] + [% IF ( hold_info.item ) %] + Only [% barcode | html %] + [% ELSE %] + [% barcode | html %] or + [% IF hold_info.item_group %] + any available from item group [% hold_info.item_group.description | html %]. + [% ELSE %] + any available. + [% END %] + + [% END %] [% END %] -- 2.39.5