|
Lines 37-43
use C4::Debug;
Link Here
|
| 37 |
use Koha::DateUtils; |
37 |
use Koha::DateUtils; |
| 38 |
# use Data::Dumper; |
38 |
# use Data::Dumper; |
| 39 |
|
39 |
|
| 40 |
my $MAXIMUM_NUMBER_OF_RESERVES = C4::Context->preference("maxreserves"); |
40 |
my $maxreserves = C4::Context->preference("maxreserves"); |
| 41 |
|
41 |
|
| 42 |
my $query = new CGI; |
42 |
my $query = new CGI; |
| 43 |
my ( $template, $borrowernumber, $cookie ) = get_template_and_user( |
43 |
my ( $template, $borrowernumber, $cookie ) = get_template_and_user( |
|
Lines 102-107
if (($#biblionumbers < 0) && (! $query->param('place_reserve'))) {
Link Here
|
| 102 |
&get_out($query, $cookie, $template->output); |
102 |
&get_out($query, $cookie, $template->output); |
| 103 |
} |
103 |
} |
| 104 |
|
104 |
|
|
|
105 |
|
| 105 |
# pass the pickup branch along.... |
106 |
# pass the pickup branch along.... |
| 106 |
my $branch = $query->param('branch') || $borr->{'branchcode'} || C4::Context->userenv->{branch} || '' ; |
107 |
my $branch = $query->param('branch') || $borr->{'branchcode'} || C4::Context->userenv->{branch} || '' ; |
| 107 |
($branches->{$branch}) or $branch = ""; # Confirm branch is real |
108 |
($branches->{$branch}) or $branch = ""; # Confirm branch is real |
|
Lines 296-327
if ( $borr->{'amountoutstanding'} && ($borr->{'amountoutstanding'} > $maxoutstan
Link Here
|
| 296 |
if ( $borr->{gonenoaddress} && ($borr->{gonenoaddress} == 1) ) { |
297 |
if ( $borr->{gonenoaddress} && ($borr->{gonenoaddress} == 1) ) { |
| 297 |
$noreserves = 1; |
298 |
$noreserves = 1; |
| 298 |
$template->param( |
299 |
$template->param( |
| 299 |
message => 1, |
300 |
message => 1, |
| 300 |
GNA => 1 |
301 |
GNA => 1 |
| 301 |
); |
302 |
); |
| 302 |
} |
303 |
} |
| 303 |
if ( $borr->{lost} && ($borr->{lost} == 1) ) { |
304 |
if ( $borr->{lost} && ($borr->{lost} == 1) ) { |
| 304 |
$noreserves = 1; |
305 |
$noreserves = 1; |
| 305 |
$template->param( |
306 |
$template->param( |
| 306 |
message => 1, |
307 |
message => 1, |
| 307 |
lost => 1 |
308 |
lost => 1 |
| 308 |
); |
309 |
); |
| 309 |
} |
310 |
} |
| 310 |
if ( CheckBorrowerDebarred($borrowernumber) ) { |
311 |
if ( CheckBorrowerDebarred($borrowernumber) ) { |
| 311 |
$noreserves = 1; |
312 |
$noreserves = 1; |
| 312 |
$template->param( |
313 |
$template->param( |
| 313 |
message => 1, |
314 |
message => 1, |
| 314 |
debarred => 1 |
315 |
debarred => 1 |
| 315 |
); |
316 |
); |
| 316 |
} |
317 |
} |
| 317 |
|
318 |
|
| 318 |
my @reserves = GetReservesFromBorrowernumber( $borrowernumber ); |
319 |
my @reserves = GetReservesFromBorrowernumber( $borrowernumber ); |
|
|
320 |
my $reserves_count = scalar(@reserves); |
| 319 |
$template->param( RESERVES => \@reserves ); |
321 |
$template->param( RESERVES => \@reserves ); |
| 320 |
if ( $MAXIMUM_NUMBER_OF_RESERVES && (scalar(@reserves) >= $MAXIMUM_NUMBER_OF_RESERVES) ) { |
322 |
if ( $maxreserves && ( $reserves_count >= $maxreserves ) ) { |
| 321 |
$template->param( message => 1 ); |
323 |
$template->param( message => 1 ); |
| 322 |
$noreserves = 1; |
324 |
$noreserves = 1; |
| 323 |
$template->param( too_many_reserves => scalar(@reserves)); |
325 |
$template->param( too_many_reserves => scalar(@reserves)); |
| 324 |
} |
326 |
} |
|
|
327 |
|
| 328 |
unless ( $noreserves ) { |
| 329 |
my $requested_reserves_count = scalar( @biblionumbers ); |
| 330 |
if ( $maxreserves && ( $reserves_count + $requested_reserves_count >= $maxreserves ) ) { |
| 331 |
$template->param( new_reserves_allowed => $maxreserves - $reserves_count ); |
| 332 |
} |
| 333 |
} |
| 334 |
|
| 325 |
foreach my $res (@reserves) { |
335 |
foreach my $res (@reserves) { |
| 326 |
foreach my $biblionumber (@biblionumbers) { |
336 |
foreach my $biblionumber (@biblionumbers) { |
| 327 |
if ( $res->{'biblionumber'} == $biblionumber && $res->{'borrowernumber'} == $borrowernumber) { |
337 |
if ( $res->{'biblionumber'} == $biblionumber && $res->{'borrowernumber'} == $borrowernumber) { |