Lines 19-24
use Modern::Perl;
Link Here
|
19 |
|
19 |
|
20 |
use Mojo::Base 'Mojolicious::Controller'; |
20 |
use Mojo::Base 'Mojolicious::Controller'; |
21 |
|
21 |
|
|
|
22 |
use Mojo::JSON qw(decode_json); |
23 |
|
22 |
use C4::Biblio; |
24 |
use C4::Biblio; |
23 |
use C4::Reserves; |
25 |
use C4::Reserves; |
24 |
|
26 |
|
Lines 169-175
sub add {
Link Here
|
169 |
$can_place_hold->{status} = 'tooManyReserves'; |
171 |
$can_place_hold->{status} = 'tooManyReserves'; |
170 |
} |
172 |
} |
171 |
|
173 |
|
172 |
my $can_override = C4::Context->preference('AllowHoldPolicyOverride'); |
174 |
my $override_header = $c->req->headers->header('x-koha-override'); |
|
|
175 |
$override_header = decode_json($override_header) |
176 |
if $override_header; |
177 |
|
178 |
my $can_override = $override_header->{AllowHoldPolicyOverride} |
179 |
and C4::Context->preference('AllowHoldPolicyOverride'); |
173 |
|
180 |
|
174 |
unless ($can_override || $can_place_hold->{status} eq 'OK' ) { |
181 |
unless ($can_override || $can_place_hold->{status} eq 'OK' ) { |
175 |
return $c->render( |
182 |
return $c->render( |