Lines 586-598
foreach my $biblionumber (@biblionumbers) {
Link Here
|
586 |
) |
586 |
) |
587 |
{ |
587 |
{ |
588 |
# Send the pickup locations count to the UI, the pickup locations will be pulled using the API |
588 |
# Send the pickup locations count to the UI, the pickup locations will be pulled using the API |
589 |
my $pickup_locations = $item_object->pickup_locations({ patron => $patron }); |
589 |
my @pickup_locations = $item_object->pickup_locations({ patron => $patron })->as_list; |
590 |
$item->{pickup_locations_count} = $pickup_locations->count; |
590 |
$item->{pickup_locations_count} = scalar @pickup_locations; |
591 |
if ( $item->{pickup_locations_count} > 0 ) { |
591 |
|
|
|
592 |
if ( @pickup_locations ) { |
592 |
$num_available++; |
593 |
$num_available++; |
593 |
$item->{available} = 1; |
594 |
$item->{available} = 1; |
594 |
# pass the holding branch for use as default |
595 |
|
595 |
my $default_pickup_location = $pickup_locations->search({ branchcode => $item->{holdingbranch} })->next; |
596 |
my $default_pickup_location; |
|
|
597 |
|
598 |
# Default to logged-in, if valid |
599 |
if ( C4::Context->userenv->{branch} ) { |
600 |
($default_pickup_location) = grep { $_->branchcode eq C4::Context->userenv->{branch} } @pickup_locations; |
601 |
} |
602 |
|
596 |
$item->{default_pickup_location} = $default_pickup_location; |
603 |
$item->{default_pickup_location} = $default_pickup_location; |
597 |
} |
604 |
} |
598 |
else { |
605 |
else { |
599 |
- |
|
|