Bug 15533 [QA Followup] - All itemtypes for all items showing in OPAC multi-hold
authorKyle M Hall <kyle@bywatersolutions.com>
Thu, 28 Apr 2016 18:54:59 +0000 (18:54 +0000)
committerKyle M Hall <kyle@bywatersolutions.com>
Fri, 29 Apr 2016 10:26:05 +0000 (10:26 +0000)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt
opac/opac-reserve.pl

index 3b8ba6c..eb1cd3c 100644 (file)
                                                             <span class="date-format to" data-biblionumber="[% bibitemloo.biblionumber %]">[% INCLUDE 'date-format.inc' %]</span>
                                                         </li>
 
-                                                        [% UNLESS ( multi_hold ) %]
-                                                            [% IF Koha.Preference('AllowHoldItemTypeSelection') %]
-                                                                <li>
-                                                                    <label for="itemtype">Request specific item type:</label>
-                                                                    <select name="itemtype" size="1" id="itemtype">
-                                                                        <option value="">Any item type</option>
-                                                                        [%- FOREACH itemtype IN available_itemtypes %]
-                                                                            <option value="[% itemtype %]">[% ItemTypes.GetDescription( itemtype ) %]</option>
-                                                                        [%- END %]
-                                                                    </select>
-                                                                </li>
-                                                            [% END %]
+                                                        [% IF Koha.Preference('AllowHoldItemTypeSelection') %]
+                                                            [% itemtypes = [] %]
+                                                            [% FOREACH item IN bibitemloo.itemLoop %]
+                                                                [% itemtypes.push( item.itype ) %]
+                                                            [%- END %]
+                                                            <li>
+                                                                <label for="itemtype">Request specific item type:</label>
+                                                                <select name="itemtype" size="1" id="itemtype">
+                                                                    <option value="">Any item type</option>
+                                                                    [% FOREACH i IN itemtypes.unique.sort %]
+                                                                        <option value="[% i %]">[% ItemTypes.GetDescription( i ) %]</option>
+                                                                    [%- END %]
+                                                                </select>
+                                                            </li>
                                                         [% END %]
 
                                                         [% IF ( OpacHoldNotes ) %]
index 687a663..3f77672 100755 (executable)
@@ -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 );