From ed4ad48c567e6daaaa766fdf307227cc0d099dc8 Mon Sep 17 00:00:00 2001 From: Josef Moravec Date: Tue, 17 Nov 2020 10:45:00 +0000 Subject: [PATCH] Bug 24488: (QA follow-up): Fix small bugs, add checkk for waiting holds Signed-off-by: Josef Moravec Signed-off-by: Michal Denar Signed-off-by: Marcel de Rooy Signed-off-by: Jonathan Druart --- circ/pendingreserves.pl | 16 +++++----------- .../prog/en/modules/circ/pendingreserves.tt | 6 +----- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/circ/pendingreserves.pl b/circ/pendingreserves.pl index 8c58ee18fb..15f7ac28e0 100755 --- a/circ/pendingreserves.pl +++ b/circ/pendingreserves.pl @@ -195,23 +195,17 @@ my @biblionumbers = uniq $distinct_holds->get_column('biblionumber'); my $reserves; foreach my $bibnum ( @biblionumbers ){ - my @items = Koha::Items->search({ biblionumber => $bibnum }); - foreach my $i ( @items ){ - if ( $i->checkout ){ - next; - } - } - my @branchtransfers = map { $_->itemnumber } Koha::Item::Transfers->search({ datearrived => undef }, { columns => [ 'itemnumber' ], collapse => 1 }); - my @issues = map { $_->itemnumber } Koha::Checkouts->search({}, { columns => [ 'itemnumber' ], collapse => 1 }); + my @checkouts = map { $_->itemnumber } Koha::Checkouts->search({}, { columns => [ 'itemnumber' ], collapse => 1 }); + my @waiting_holds = map { $_->itemnumber } Koha::Holds->search({'found' => 'W'}, { columns => [ 'itemnumber' ], collapse => 1 }); - @items = Koha::Items->search( + my @items = Koha::Items->search( { biblionumber => $bibnum, itemlost => 0, withdrawn => 0, notforloan => 0, - itemnumber => { -not_in => [ @branchtransfers, @issues ] }, + itemnumber => { -not_in => [ @branchtransfers, @checkouts, @waiting_holds ] }, } ); @@ -233,7 +227,7 @@ foreach my $bibnum ( @biblionumbers ){ $reserves->{$bibnum}->{locations} = [ uniq map { defined $_->location ? $_->location : () } @items ]; # get available callnumbers for each biblio - $reserves->{$bibnum}->{locations} = [ uniq map { defined $_->itemcallnumber ? $_->itemcallnumber : () } @items ]; + $reserves->{$bibnum}->{callnumbers} = [ uniq map { defined $_->itemcallnumber ? $_->itemcallnumber : () } @items ]; # get available enumchrons for each biblio $reserves->{$bibnum}->{enumchrons} = [ uniq map { defined $_->enumchron ? $_->enumchron : () } @items ]; 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 2046f45f2b..db0574044b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingreserves.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingreserves.tt @@ -141,11 +141,7 @@
    [% FOREACH type IN reserve.value.itemtypes %] - [% IF Koha.Preference('item-level_itypes') %] -
  • [% ItemTypes.GetDescription( type ) | html %]
  • - [% ELSE %] -
  • [% ItemTypes.GetDescription( type ) | html %]
  • - [% END %] +
  • [% ItemTypes.GetDescription( type ) | html %]
  • [% END %]
-- 2.39.5