|
Lines 40-45
use Date::Calc qw/Today Date_to_Days/;
Link Here
|
| 40 |
# use Data::Dumper; |
40 |
# use Data::Dumper; |
| 41 |
|
41 |
|
| 42 |
my $maxreserves = C4::Context->preference("maxreserves"); |
42 |
my $maxreserves = C4::Context->preference("maxreserves"); |
|
|
43 |
my $max_holds_per_record = C4::Context->preference('MaxHoldsPerRecord'); |
| 43 |
|
44 |
|
| 44 |
my $query = new CGI; |
45 |
my $query = new CGI; |
| 45 |
my ( $template, $borrowernumber, $cookie ) = get_template_and_user( |
46 |
my ( $template, $borrowernumber, $cookie ) = get_template_and_user( |
|
Lines 348-359
unless ( $noreserves ) {
Link Here
|
| 348 |
foreach my $res (@reserves) { |
349 |
foreach my $res (@reserves) { |
| 349 |
foreach my $biblionumber (@biblionumbers) { |
350 |
foreach my $biblionumber (@biblionumbers) { |
| 350 |
if ( $res->{'biblionumber'} == $biblionumber && $res->{'borrowernumber'} == $borrowernumber) { |
351 |
if ( $res->{'biblionumber'} == $biblionumber && $res->{'borrowernumber'} == $borrowernumber) { |
| 351 |
# $template->param( message => 1 ); |
352 |
$biblioDataHash{$biblionumber}->{holds_count}++; |
| 352 |
# $noreserves = 1; |
|
|
| 353 |
# $template->param( already_reserved => 1 ); |
| 354 |
$biblioDataHash{$biblionumber}->{already_reserved} = 1; |
| 355 |
} |
353 |
} |
| 356 |
} |
354 |
} |
|
|
355 |
|
| 357 |
} |
356 |
} |
| 358 |
|
357 |
|
| 359 |
unless ($noreserves) { |
358 |
unless ($noreserves) { |
|
Lines 397-402
foreach my $biblioNum (@biblionumbers) {
Link Here
|
| 397 |
$biblioLoopIter{reservecount} = $biblioData->{reservecount}; |
396 |
$biblioLoopIter{reservecount} = $biblioData->{reservecount}; |
| 398 |
$biblioLoopIter{already_reserved} = $biblioData->{already_reserved}; |
397 |
$biblioLoopIter{already_reserved} = $biblioData->{already_reserved}; |
| 399 |
$biblioLoopIter{mandatorynotes}=0; #FIXME: For future use |
398 |
$biblioLoopIter{mandatorynotes}=0; #FIXME: For future use |
|
|
399 |
$biblioLoopIter{holds_count} = $biblioData->{holds_count}; |
| 400 |
|
400 |
|
| 401 |
if (!$itemLevelTypes && $biblioData->{itemtype}) { |
401 |
if (!$itemLevelTypes && $biblioData->{itemtype}) { |
| 402 |
$biblioLoopIter{description} = $itemTypes->{$biblioData->{itemtype}}{description}; |
402 |
$biblioLoopIter{description} = $itemTypes->{$biblioData->{itemtype}}{description}; |
|
Lines 525-538
foreach my $biblioNum (@biblionumbers) {
Link Here
|
| 525 |
$policy_holdallowed = 0; |
525 |
$policy_holdallowed = 0; |
| 526 |
} |
526 |
} |
| 527 |
|
527 |
|
| 528 |
if (IsAvailableForItemLevelRequest($itemNum) and $policy_holdallowed and CanItemBeReserved($borrowernumber,$itemNum) eq 'OK' and ($itemLoopIter->{already_reserved} ne 1)) { |
528 |
if (IsAvailableForItemLevelRequest($itemNum) and $policy_holdallowed and CanItemBeReserved($borrowernumber,$itemNum) and ($itemLoopIter->{holds_count} < $max_holds_per_record )) { |
| 529 |
$itemLoopIter->{available} = 1; |
529 |
$itemLoopIter->{available} = 1; |
| 530 |
$numCopiesAvailable++; |
530 |
$numCopiesAvailable++; |
| 531 |
} |
531 |
} |
| 532 |
|
532 |
|
| 533 |
$itemLoopIter->{imageurl} = getitemtypeimagelocation( 'opac', $itemTypes->{ $itemInfo->{itype} }{imageurl} ); |
533 |
$itemLoopIter->{imageurl} = getitemtypeimagelocation( 'opac', $itemTypes->{ $itemInfo->{itype} }{imageurl} ); |
| 534 |
|
534 |
|
| 535 |
# Show serial enumeration when needed |
535 |
# Don't allow multiple item level holds on the same item if borrowers can place multiple holds on one bib |
|
|
536 |
$itemLoopIter->{available} = 0 if ( GetReservesFromBorrowernumber( $borrowernumber, undef, undef, $itemNum ) ); |
| 537 |
|
| 538 |
# Show serial enumeration when needed |
| 536 |
if ($itemLoopIter->{enumchron}) { |
539 |
if ($itemLoopIter->{enumchron}) { |
| 537 |
$itemdata_enumchron = 1; |
540 |
$itemdata_enumchron = 1; |
| 538 |
} |
541 |
} |
|
Lines 549-554
foreach my $biblioNum (@biblionumbers) {
Link Here
|
| 549 |
if ($biblioLoopIter{already_reserved}) { |
552 |
if ($biblioLoopIter{already_reserved}) { |
| 550 |
$biblioLoopIter{holdable} = undef; |
553 |
$biblioLoopIter{holdable} = undef; |
| 551 |
} |
554 |
} |
|
|
555 |
|
| 556 |
if ($biblioLoopIter{holds_count} >= $max_holds_per_record) { |
| 557 |
$biblioLoopIter{holdable} = undef; |
| 558 |
$anyholdable = undef; |
| 559 |
$biblioLoopIter{max_holds} = 1; |
| 560 |
} |
| 561 |
|
| 552 |
my $canReserve = CanBookBeReserved($borrowernumber,$biblioNum); |
562 |
my $canReserve = CanBookBeReserved($borrowernumber,$biblioNum); |
| 553 |
unless ($canReserve eq 'OK') { |
563 |
unless ($canReserve eq 'OK') { |
| 554 |
$biblioLoopIter{holdable} = undef; |
564 |
$biblioLoopIter{holdable} = undef; |