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