Lines 371-376
sub pickup_locations {
Link Here
|
371 |
|
371 |
|
372 |
my $memory_cache = Koha::Cache::Memory::Lite->get_instance(); |
372 |
my $memory_cache = Koha::Cache::Memory::Lite->get_instance(); |
373 |
my @pickup_locations; |
373 |
my @pickup_locations; |
|
|
374 |
my $location_items; |
374 |
foreach my $item ( $self->items->as_list ) { |
375 |
foreach my $item ( $self->items->as_list ) { |
375 |
my $cache_key = sprintf "Pickup_locations:%s:%s:%s:%s:%s", |
376 |
my $cache_key = sprintf "Pickup_locations:%s:%s:%s:%s:%s", |
376 |
$item->itype,$item->homebranch,$item->holdingbranch,$item->ccode || "",$patron->branchcode||"" ; |
377 |
$item->itype,$item->homebranch,$item->holdingbranch,$item->ccode || "",$patron->branchcode||"" ; |
Lines 379-389
sub pickup_locations {
Link Here
|
379 |
@{ $item_pickup_locations } = $item->pickup_locations( { patron => $patron } )->_resultset->get_column('branchcode')->all; |
380 |
@{ $item_pickup_locations } = $item->pickup_locations( { patron => $patron } )->_resultset->get_column('branchcode')->all; |
380 |
$memory_cache->set_in_cache( $cache_key, $item_pickup_locations ); |
381 |
$memory_cache->set_in_cache( $cache_key, $item_pickup_locations ); |
381 |
} |
382 |
} |
382 |
push @pickup_locations, @{ $item_pickup_locations } |
383 |
push @pickup_locations, @{ $item_pickup_locations }; |
|
|
384 |
for my $location (@pickup_locations) { |
385 |
push @{$location_items->{$location}}, $item->itemnumber; |
386 |
} |
383 |
} |
387 |
} |
384 |
|
388 |
|
385 |
return Koha::Libraries->search( |
389 |
my $resultSet = Koha::Libraries->search( |
386 |
{ branchcode => { '-in' => \@pickup_locations } }, { order_by => ['branchname'] } ); |
390 |
{ branchcode => { '-in' => \@pickup_locations } }, { order_by => ['branchname'] } ); |
|
|
391 |
|
392 |
$resultSet->{_pickup_location_items} = $location_items; |
393 |
|
394 |
return $resultSet; |
387 |
} |
395 |
} |
388 |
|
396 |
|
389 |
=head3 hidden_in_opac |
397 |
=head3 hidden_in_opac |