Lines 431-443
foreach my $biblioNum (@biblionumbers) {
Link Here
|
431 |
} |
431 |
} |
432 |
|
432 |
|
433 |
# checking reserve |
433 |
# checking reserve |
434 |
my ($reservedate,$reservedfor,$expectedAt) = GetReservesFromItemnumber($itemNum); |
434 |
my ($reservedate,$reservedfor,$expectedAt,$wait) = GetReservesFromItemnumber($itemNum,1); #with alldates parameter include future item level holds and waits |
435 |
my $ItemBorrowerReserveInfo = GetMemberDetails( $reservedfor, 0); |
435 |
my $ItemBorrowerReserveInfo = GetMemberDetails( $reservedfor, 0); |
436 |
|
436 |
|
437 |
# the item could be reserved for this borrower vi a host record, flag this |
437 |
# the item could be reserved for this borrower vi a host record, flag this |
438 |
if ($reservedfor eq $borrowernumber){ |
438 |
if ($reservedfor eq $borrowernumber){ |
439 |
$itemLoopIter->{already_reserved} = 1; |
439 |
$itemLoopIter->{already_reserved} = 1; |
440 |
} |
440 |
} |
441 |
|
441 |
|
442 |
if ( defined $reservedate ) { |
442 |
if ( defined $reservedate ) { |
443 |
$itemLoopIter->{backgroundcolor} = 'reserved'; |
443 |
$itemLoopIter->{backgroundcolor} = 'reserved'; |
Lines 446-451
foreach my $biblioNum (@biblionumbers) {
Link Here
|
446 |
$itemLoopIter->{ReservedForSurname} = $ItemBorrowerReserveInfo->{'surname'}; |
446 |
$itemLoopIter->{ReservedForSurname} = $ItemBorrowerReserveInfo->{'surname'}; |
447 |
$itemLoopIter->{ReservedForFirstname} = $ItemBorrowerReserveInfo->{'firstname'}; |
447 |
$itemLoopIter->{ReservedForFirstname} = $ItemBorrowerReserveInfo->{'firstname'}; |
448 |
$itemLoopIter->{ExpectedAtLibrary} = $expectedAt; |
448 |
$itemLoopIter->{ExpectedAtLibrary} = $expectedAt; |
|
|
449 |
#waiting status |
450 |
$itemLoopIter->{waitingdate} = format_date($wait) if $wait; |
449 |
} |
451 |
} |
450 |
|
452 |
|
451 |
$itemLoopIter->{notforloan} = $itemInfo->{notforloan}; |
453 |
$itemLoopIter->{notforloan} = $itemInfo->{notforloan}; |
Lines 505-518
foreach my $biblioNum (@biblionumbers) {
Link Here
|
505 |
$numCopiesAvailable++; |
507 |
$numCopiesAvailable++; |
506 |
} |
508 |
} |
507 |
|
509 |
|
508 |
# FIXME: move this to a pm |
510 |
$itemLoopIter->{imageurl} = getitemtypeimagelocation( 'opac', $itemTypes->{ $itemInfo->{itype} }{imageurl} ); |
509 |
my $dbh = C4::Context->dbh; |
|
|
510 |
my $sth2 = $dbh->prepare("SELECT * FROM reserves WHERE borrowernumber=? AND itemnumber=? AND found='W'"); |
511 |
$sth2->execute($itemLoopIter->{ReservedForBorrowernumber}, $itemNum); |
512 |
while (my $wait_hashref = $sth2->fetchrow_hashref) { |
513 |
$itemLoopIter->{waitingdate} = format_date($wait_hashref->{waitingdate}); |
514 |
} |
515 |
$itemLoopIter->{imageurl} = getitemtypeimagelocation( 'opac', $itemTypes->{ $itemInfo->{itype} }{imageurl} ); |
516 |
|
511 |
|
517 |
# Show serial enumeration when needed |
512 |
# Show serial enumeration when needed |
518 |
if ($itemLoopIter->{enumchron}) { |
513 |
if ($itemLoopIter->{enumchron}) { |