Lines 71-77
my $pickup = $input->param('pickup');
Link Here
|
71 |
my $itemtypes = { |
71 |
my $itemtypes = { |
72 |
map { |
72 |
map { |
73 |
$_->itemtype => |
73 |
$_->itemtype => |
74 |
{ %{ $_->unblessed }, image_location => $_->image_location } |
74 |
{ %{ $_->unblessed }, image_location => $_->image_location, notforloan => $_->notforloan } |
75 |
} Koha::ItemTypes->search_with_localization->as_list |
75 |
} Koha::ItemTypes->search_with_localization->as_list |
76 |
}; |
76 |
}; |
77 |
|
77 |
|
Lines 294-299
if ( ( $findborrower && $borrowernumber_hold || $findclub && $club_hold )
Link Here
|
294 |
my $itemdata_ccode = 0; |
294 |
my $itemdata_ccode = 0; |
295 |
my @biblioloop = (); |
295 |
my @biblioloop = (); |
296 |
my $no_reserves_allowed = 0; |
296 |
my $no_reserves_allowed = 0; |
|
|
297 |
my $num_bibs_available = 0; |
297 |
foreach my $biblionumber (@biblionumbers) { |
298 |
foreach my $biblionumber (@biblionumbers) { |
298 |
next unless $biblionumber =~ m|^\d+$|; |
299 |
next unless $biblionumber =~ m|^\d+$|; |
299 |
|
300 |
|
Lines 382-388
if ( ( $findborrower && $borrowernumber_hold || $findclub && $club_hold )
Link Here
|
382 |
|
383 |
|
383 |
if ( $club_hold or $borrowernumber_hold ) { |
384 |
if ( $club_hold or $borrowernumber_hold ) { |
384 |
my @available_itemtypes; |
385 |
my @available_itemtypes; |
385 |
my $num_available = 0; |
386 |
my $num_items_available = 0; |
386 |
my $num_override = 0; |
387 |
my $num_override = 0; |
387 |
my $hiddencount = 0; |
388 |
my $hiddencount = 0; |
388 |
my $num_alreadyheld = 0; |
389 |
my $num_alreadyheld = 0; |
Lines 462-467
if ( ( $findborrower && $borrowernumber_hold || $findclub && $club_hold )
Link Here
|
462 |
} |
463 |
} |
463 |
|
464 |
|
464 |
# If there is no loan, return and transfer, we show a checkbox. |
465 |
# If there is no loan, return and transfer, we show a checkbox. |
|
|
466 |
$item->{notforloanitype} = $item->{itemtype}->{notforloan}; |
465 |
$item->{notforloan} ||= 0; |
467 |
$item->{notforloan} ||= 0; |
466 |
|
468 |
|
467 |
# if independent branches is on we need to check if the person can reserve |
469 |
# if independent branches is on we need to check if the person can reserve |
Lines 486-491
if ( ( $findborrower && $borrowernumber_hold || $findclub && $club_hold )
Link Here
|
486 |
|
488 |
|
487 |
my $can_item_be_reserved = CanItemBeReserved( $patron, $item_object )->{status}; |
489 |
my $can_item_be_reserved = CanItemBeReserved( $patron, $item_object )->{status}; |
488 |
$item->{not_holdable} = $can_item_be_reserved unless ( $can_item_be_reserved eq 'OK' ); |
490 |
$item->{not_holdable} = $can_item_be_reserved unless ( $can_item_be_reserved eq 'OK' ); |
|
|
491 |
$item->{not_holdable} ||= 'notforloan' if ( $item->{notforloanitype} || $item->{notforloan} > 0 ); |
492 |
|
489 |
|
493 |
|
490 |
$item->{item_level_holds} = Koha::CirculationRules->get_opacitemholds_policy( { item => $item_object, patron => $patron } ); |
494 |
$item->{item_level_holds} = Koha::CirculationRules->get_opacitemholds_policy( { item => $item_object, patron => $patron } ); |
491 |
|
495 |
|
Lines 502-508
if ( ( $findborrower && $borrowernumber_hold || $findclub && $club_hold )
Link Here
|
502 |
my $pickup_locations = $item_object->pickup_locations({ patron => $patron }); |
506 |
my $pickup_locations = $item_object->pickup_locations({ patron => $patron }); |
503 |
$item->{pickup_locations_count} = $pickup_locations->count; |
507 |
$item->{pickup_locations_count} = $pickup_locations->count; |
504 |
if ( $item->{pickup_locations_count} > 0 ) { |
508 |
if ( $item->{pickup_locations_count} > 0 ) { |
505 |
$num_available++; |
509 |
$num_items_available++; |
506 |
$item->{available} = 1; |
510 |
$item->{available} = 1; |
507 |
# pass the holding branch for use as default |
511 |
# pass the holding branch for use as default |
508 |
my $default_pickup_location = $pickup_locations->search({ branchcode => $item->{holdingbranch} })->next; |
512 |
my $default_pickup_location = $pickup_locations->search({ branchcode => $item->{holdingbranch} })->next; |
Lines 524-530
if ( ( $findborrower && $borrowernumber_hold || $findclub && $club_hold )
Link Here
|
524 |
$item->{pickup_locations_count} = scalar @pickup_locations; |
528 |
$item->{pickup_locations_count} = scalar @pickup_locations; |
525 |
|
529 |
|
526 |
if ( @pickup_locations ) { |
530 |
if ( @pickup_locations ) { |
527 |
$num_available++; |
531 |
$num_items_available++; |
528 |
$item->{available} = 1; |
532 |
$item->{available} = 1; |
529 |
|
533 |
|
530 |
my $default_pickup_location; |
534 |
my $default_pickup_location; |
Lines 543-551
if ( ( $findborrower && $borrowernumber_hold || $findclub && $club_hold )
Link Here
|
543 |
} else { $num_alreadyheld++ } |
547 |
} else { $num_alreadyheld++ } |
544 |
|
548 |
|
545 |
push( @available_itemtypes, $item->{itype} ); |
549 |
push( @available_itemtypes, $item->{itype} ); |
|
|
550 |
} else { |
551 |
# If none of the conditions hold true, then neither override nor available is set and the item cannot be checked |
552 |
$item->{available} = 0; |
546 |
} |
553 |
} |
547 |
|
554 |
|
548 |
# If none of the conditions hold true, then neither override nor available is set and the item cannot be checked |
|
|
549 |
|
555 |
|
550 |
# Show serial enumeration when needed |
556 |
# Show serial enumeration when needed |
551 |
if ($item->{enumchron}) { |
557 |
if ($item->{enumchron}) { |
Lines 567-573
if ( ( $findborrower && $borrowernumber_hold || $findclub && $club_hold )
Link Here
|
567 |
if ( $num_override > 0 && ($num_override + $num_alreadyheld) == scalar( @{ $biblioloopiter{itemloop} } ) ) { |
573 |
if ( $num_override > 0 && ($num_override + $num_alreadyheld) == scalar( @{ $biblioloopiter{itemloop} } ) ) { |
568 |
# That is, if all items require an override |
574 |
# That is, if all items require an override |
569 |
$template->param( override_required => 1 ); |
575 |
$template->param( override_required => 1 ); |
570 |
} elsif ( $num_available == 0 ) { |
576 |
} elsif ( $num_items_available == 0 ) { |
571 |
$template->param( none_available => 1 ); |
577 |
$template->param( none_available => 1 ); |
572 |
$biblioloopiter{warn} = 1; |
578 |
$biblioloopiter{warn} = 1; |
573 |
$biblioloopiter{none_avail} = 1; |
579 |
$biblioloopiter{none_avail} = 1; |
Lines 675-683
if ( ( $findborrower && $borrowernumber_hold || $findclub && $club_hold )
Link Here
|
675 |
$biblioloopiter{pickup_locations_codes} = [ map { $_->branchcode } @pickup_locations ]; |
681 |
$biblioloopiter{pickup_locations_codes} = [ map { $_->branchcode } @pickup_locations ]; |
676 |
} |
682 |
} |
677 |
|
683 |
|
|
|
684 |
$num_bibs_available++ unless $biblioloopiter{none_avail}; |
678 |
push @biblioloop, \%biblioloopiter; |
685 |
push @biblioloop, \%biblioloopiter; |
679 |
} |
686 |
} |
680 |
|
687 |
|
|
|
688 |
$template->param( no_bibs_available => 1 ) unless $num_bibs_available > 0; |
689 |
|
681 |
$template->param( biblioloop => \@biblioloop ); |
690 |
$template->param( biblioloop => \@biblioloop ); |
682 |
$template->param( no_reserves_allowed => $no_reserves_allowed ); |
691 |
$template->param( no_reserves_allowed => $no_reserves_allowed ); |
683 |
$template->param( exceeded_maxreserves => $exceeded_maxreserves ); |
692 |
$template->param( exceeded_maxreserves => $exceeded_maxreserves ); |
684 |
- |
|
|