-# FIXME launch another time GetMember perhaps until (Joubu: Why?)
-my $patron = Koha::Patrons->find( $borrowernumber_hold );
-
-if ( $patron && $multi_hold ) {
- my @multi_pickup_locations =
- Koha::Biblios->search( { biblionumber => \@biblionumbers } )
- ->pickup_locations( { patron => $patron } );
- $template->param( multi_pickup_locations => \@multi_pickup_locations );
-}
-
-my $logged_in_patron = Koha::Patrons->find( $borrowernumber );
-
-my $wants_check;
-if ($patron) {
- $wants_check = $patron->wants_check_for_previous_checkout;
-}
-my $itemdata_enumchron = 0;
-my $itemdata_ccode = 0;
-my @biblioloop = ();
-my $no_reserves_allowed = 0;
-foreach my $biblionumber (@biblionumbers) {
- next unless $biblionumber =~ m|^\d+$|;
-
- my %biblioloopiter = ();
-
- my $biblio = Koha::Biblios->find( $biblionumber );
- unless ($biblio) {
- $biblioloopiter{noitems} = 1;
- $template->param('nobiblio' => 1);
- last;
- }
-
- my $force_hold_level;
- if ( $patron ) {
- { # CanBookBeReserved
- my $canReserve = CanBookBeReserved( $patron->borrowernumber, $biblionumber );
- if ( $canReserve->{status} eq 'OK' ) {
-
- #All is OK and we can continue
- }
- elsif ( $canReserve->{status} eq 'noReservesAllowed' || $canReserve->{status} eq 'notReservable' ) {
- $no_reserves_allowed = 1;
- }
- elsif ( $canReserve->{status} eq 'tooManyReserves' ) {
- $exceeded_maxreserves = 1;
- $template->param( maxreserves => $canReserve->{limit} );
- }
- elsif ( $canReserve->{status} eq 'tooManyHoldsForThisRecord' ) {
- $exceeded_holds_per_record = 1;
- $biblioloopiter{ $canReserve->{status} } = 1;
- }
- elsif ( $canReserve->{status} eq 'ageRestricted' ) {
- $template->param( $canReserve->{status} => 1 );
- $biblioloopiter{ $canReserve->{status} } = 1;
- }
- elsif ( $canReserve->{status} eq 'alreadypossession' ) {
- $template->param( $canReserve->{status} => 1);
- $biblioloopiter{ $canReserve->{status} } = 1;
- }
- else {
- $biblioloopiter{ $canReserve->{status} } = 1;
- }
- }
-
- # For multiple holds per record, if a patron has previously placed a hold,
- # the patron can only place more holds of the same type. That is, if the
- # patron placed a record level hold, all the holds the patron places must
- # be record level. If the patron placed an item level hold, all holds
- # the patron places must be item level
- my $holds = Koha::Holds->search(
- {
- borrowernumber => $patron->borrowernumber,
- biblionumber => $biblionumber,
- found => undef,
- }
- );
- $force_hold_level = $holds->forced_hold_level();
- $biblioloopiter{force_hold_level} = $force_hold_level;
- $template->param( force_hold_level => $force_hold_level );
-
- # For a librarian to be able to place multiple record holds for a patron for a record,
- # we must find out what the maximum number of holds they can place for the patron is
- my $max_holds_for_record = GetMaxPatronHoldsForRecord( $patron->borrowernumber, $biblionumber );
- my $remaining_holds_for_record = $max_holds_for_record - $holds->count();
- $biblioloopiter{remaining_holds_for_record} = $max_holds_for_record;
- $template->param( max_holds_for_record => $max_holds_for_record );
- $template->param( remaining_holds_for_record => $remaining_holds_for_record );
- }
-
-
- my $count = Koha::Holds->search( { biblionumber => $biblionumber } )->count();
- my $totalcount = $count;
-
- # adding a fixed value for priority options
- my $fixedRank = $count+1;
-
- my %itemnumbers_of_biblioitem;