From 6b8645389df6d22a7244007f8786bb95839c99e2 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Thu, 28 Apr 2016 18:54:59 +0000 Subject: [PATCH] Bug 15533 [QA Followup] - All itemtypes for all items showing in OPAC multi-hold --- .../opac-tmpl/bootstrap/en/modules/opac-reserve.tt | 26 ++++++++++++---------- opac/opac-reserve.pl | 5 +---- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt index 3b8ba6c..eb1cd3c 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt @@ -249,18 +249,20 @@ [% INCLUDE 'date-format.inc' %] - [% UNLESS ( multi_hold ) %] - [% IF Koha.Preference('AllowHoldItemTypeSelection') %] -
  • - - -
  • - [% END %] + [% IF Koha.Preference('AllowHoldItemTypeSelection') %] + [% itemtypes = [] %] + [% FOREACH item IN bibitemloo.itemLoop %] + [% itemtypes.push( item.itype ) %] + [%- END %] +
  • + + +
  • [% END %] [% IF ( OpacHoldNotes ) %] diff --git a/opac/opac-reserve.pl b/opac/opac-reserve.pl index 687a663..3f77672 100755 --- a/opac/opac-reserve.pl +++ b/opac/opac-reserve.pl @@ -383,7 +383,6 @@ unless ($noreserves) { # my $notforloan_label_of = get_notforloan_label_of(); -my @available_itemtypes; my $biblioLoop = []; my $numBibsAvailable = 0; my $itemdata_enumchron = 0; @@ -444,6 +443,7 @@ foreach my $biblioNum (@biblionumbers) { $itemLoopIter->{copynumber} = $itemInfo->{copynumber}; if ($itemLevelTypes) { $itemLoopIter->{translated_description} = $itemInfo->{translated_description}; + $itemLoopIter->{itype} = $itemInfo->{itype}; $itemLoopIter->{imageurl} = $itemInfo->{imageurl}; } @@ -537,7 +537,6 @@ foreach my $biblioNum (@biblionumbers) { $itemLoopIter->{available} = 1; $numCopiesOPACAvailable++; $biblioLoopIter{force_hold} = 1 if $hold_allowed eq 'F'; - push( @available_itemtypes, $itemInfo->{itype} ); } $numCopiesAvailable++; } @@ -575,8 +574,6 @@ foreach my $biblioNum (@biblionumbers) { $anyholdable = 1 if $biblioLoopIter{holdable}; } -@available_itemtypes = uniq( @available_itemtypes ); -$template->param( available_itemtypes => \@available_itemtypes ); if ( $numBibsAvailable == 0 || $anyholdable == 0) { $template->param( none_available => 1 ); -- 2.1.4