+ my $status = CanBookBeReserved( $borrowernumber, $biblioNum )->{status};
+ $biblioLoopIter{holdable} &&= $status eq 'OK';
+ $biblioLoopIter{already_patron_possession} = $status eq 'alreadypossession';
+
+ if ( $biblioLoopIter{holdable} and C4::Context->preference('AllowHoldItemTypeSelection') ) {
+ # build the allowed item types loop
+ my $rs = $biblio->items->search(
+ undef,
+ { select => [ { distinct => 'itype' } ],
+ as => 'item_type'
+ }
+ );
+
+ my @item_types =
+ grep { CanBookBeReserved( $borrowernumber, $biblioNum, $branch, { itemtype => $_ } )->{status} eq 'OK' }
+ $rs->get_column('item_type');
+
+ $biblioLoopIter{allowed_item_types} = \@item_types;
+ }
+
+ if ( $status eq 'recall' ) {
+ $biblioLoopIter{recall} = 1;
+ }