Lines 33-39
use C4::Overdues;
Link Here
|
33 |
use C4::Debug; |
33 |
use C4::Debug; |
34 |
# use Data::Dumper; |
34 |
# use Data::Dumper; |
35 |
|
35 |
|
36 |
my $MAXIMUM_NUMBER_OF_RESERVES = C4::Context->preference("maxreserves"); |
36 |
my $maxreserves = C4::Context->preference("maxreserves"); |
37 |
|
37 |
|
38 |
my $query = new CGI; |
38 |
my $query = new CGI; |
39 |
my ( $template, $borrowernumber, $cookie ) = get_template_and_user( |
39 |
my ( $template, $borrowernumber, $cookie ) = get_template_and_user( |
Lines 92-97
if (($#biblionumbers < 0) && (! $query->param('place_reserve'))) {
Link Here
|
92 |
&get_out($query, $cookie, $template->output); |
92 |
&get_out($query, $cookie, $template->output); |
93 |
} |
93 |
} |
94 |
|
94 |
|
|
|
95 |
|
95 |
# pass the pickup branch along.... |
96 |
# pass the pickup branch along.... |
96 |
my $branch = $query->param('branch') || $borr->{'branchcode'} || C4::Context->userenv->{branch} || '' ; |
97 |
my $branch = $query->param('branch') || $borr->{'branchcode'} || C4::Context->userenv->{branch} || '' ; |
97 |
($branches->{$branch}) or $branch = ""; # Confirm branch is real |
98 |
($branches->{$branch}) or $branch = ""; # Confirm branch is real |
Lines 268-299
if ( $borr->{'amountoutstanding'} && ($borr->{'amountoutstanding'} > $maxoutstan
Link Here
|
268 |
if ( $borr->{gonenoaddress} && ($borr->{gonenoaddress} eq 1) ) { |
269 |
if ( $borr->{gonenoaddress} && ($borr->{gonenoaddress} eq 1) ) { |
269 |
$noreserves = 1; |
270 |
$noreserves = 1; |
270 |
$template->param( |
271 |
$template->param( |
271 |
message => 1, |
272 |
message => 1, |
272 |
GNA => 1 |
273 |
GNA => 1 |
273 |
); |
274 |
); |
274 |
} |
275 |
} |
275 |
if ( $borr->{lost} && ($borr->{lost} eq 1) ) { |
276 |
if ( $borr->{lost} && ($borr->{lost} eq 1) ) { |
276 |
$noreserves = 1; |
277 |
$noreserves = 1; |
277 |
$template->param( |
278 |
$template->param( |
278 |
message => 1, |
279 |
message => 1, |
279 |
lost => 1 |
280 |
lost => 1 |
280 |
); |
281 |
); |
281 |
} |
282 |
} |
282 |
if ( CheckBorrowerDebarred($borrowernumber) ) { |
283 |
if ( CheckBorrowerDebarred($borrowernumber) ) { |
283 |
$noreserves = 1; |
284 |
$noreserves = 1; |
284 |
$template->param( |
285 |
$template->param( |
285 |
message => 1, |
286 |
message => 1, |
286 |
debarred => 1 |
287 |
debarred => 1 |
287 |
); |
288 |
); |
288 |
} |
289 |
} |
289 |
|
290 |
|
290 |
my @reserves = GetReservesFromBorrowernumber( $borrowernumber ); |
291 |
my @reserves = GetReservesFromBorrowernumber( $borrowernumber ); |
|
|
292 |
my $reserves_count = scalar(@reserves); |
291 |
$template->param( RESERVES => \@reserves ); |
293 |
$template->param( RESERVES => \@reserves ); |
292 |
if ( $MAXIMUM_NUMBER_OF_RESERVES && (scalar(@reserves) >= $MAXIMUM_NUMBER_OF_RESERVES) ) { |
294 |
if ( $maxreserves && ( $reserves_count >= $maxreserves ) ) { |
293 |
$template->param( message => 1 ); |
295 |
$template->param( message => 1 ); |
294 |
$noreserves = 1; |
296 |
$noreserves = 1; |
295 |
$template->param( too_many_reserves => scalar(@reserves)); |
297 |
$template->param( too_many_reserves => scalar(@reserves)); |
296 |
} |
298 |
} |
|
|
299 |
|
300 |
unless ( $noreserves ) { |
301 |
my $requested_reserves_count = scalar( @biblionumbers ); |
302 |
if ( $maxreserves && ( $reserves_count + $requested_reserves_count >= $maxreserves ) ) { |
303 |
$template->param( new_reserves_allowed => $maxreserves - $reserves_count ); |
304 |
} |
305 |
} |
306 |
|
297 |
foreach my $res (@reserves) { |
307 |
foreach my $res (@reserves) { |
298 |
foreach my $biblionumber (@biblionumbers) { |
308 |
foreach my $biblionumber (@biblionumbers) { |
299 |
if ( $res->{'biblionumber'} == $biblionumber && $res->{'borrowernumber'} == $borrowernumber) { |
309 |
if ( $res->{'biblionumber'} == $biblionumber && $res->{'borrowernumber'} == $borrowernumber) { |
300 |
- |
|
|