Lines 462-481
sub pickup_locations {
Link Here
|
462 |
$ps_set = $hold->biblio->pickup_locations( { patron => $hold->patron } ); |
462 |
$ps_set = $hold->biblio->pickup_locations( { patron => $hold->patron } ); |
463 |
} |
463 |
} |
464 |
|
464 |
|
465 |
my $pickup_locations; |
|
|
466 |
my @response = (); |
465 |
my @response = (); |
467 |
|
466 |
|
468 |
if ( C4::Context->preference('AllowHoldPolicyOverride') ) { |
467 |
if ( C4::Context->preference('AllowHoldPolicyOverride') ) { |
469 |
|
468 |
|
470 |
$pickup_locations = $ps_set->as_list; |
|
|
471 |
my $libraries_rs = Koha::Libraries->search( { pickup_location => 1 } ); |
469 |
my $libraries_rs = Koha::Libraries->search( { pickup_location => 1 } ); |
472 |
my $libraries = $c->objects->search($libraries_rs); |
470 |
my $libraries = $c->objects->search($libraries_rs); |
473 |
|
471 |
|
474 |
@response = map { |
472 |
@response = map { |
475 |
my $library = $_; |
473 |
my $library = $_; |
476 |
$library->{needs_override} = ( |
474 |
$library->{needs_override} = ( |
477 |
any { $_->{library_id} eq $library->{library_id} } |
475 |
any { $_->branchcode eq $library->{library_id} } |
478 |
@{$pickup_locations} |
476 |
$ps_set->as_list |
479 |
) |
477 |
) |
480 |
? Mojo::JSON->false |
478 |
? Mojo::JSON->false |
481 |
: Mojo::JSON->true; |
479 |
: Mojo::JSON->true; |
Lines 488-494
sub pickup_locations {
Link Here
|
488 |
); |
486 |
); |
489 |
} |
487 |
} |
490 |
|
488 |
|
491 |
$pickup_locations = $c->objects->search( $ps_set ); |
489 |
my $pickup_locations = $c->objects->search( $ps_set ); |
492 |
@response = map { $_->{needs_override} = Mojo::JSON->false; $_; } @{$pickup_locations}; |
490 |
@response = map { $_->{needs_override} = Mojo::JSON->false; $_; } @{$pickup_locations}; |
493 |
|
491 |
|
494 |
return $c->render( |
492 |
return $c->render( |
495 |
- |
|
|