|
Lines 27-32
use XML::Simple;
Link Here
|
| 27 |
use C4::Dates qw(format_date); |
27 |
use C4::Dates qw(format_date); |
| 28 |
use C4::XSLT; |
28 |
use C4::XSLT; |
| 29 |
use C4::Branch; |
29 |
use C4::Branch; |
|
|
30 |
use C4::Reserves; # CheckReserves |
| 30 |
use C4::Debug; |
31 |
use C4::Debug; |
| 31 |
use YAML; |
32 |
use YAML; |
| 32 |
use URI::Escape; |
33 |
use URI::Escape; |
|
Lines 1516-1521
sub searchResults {
Link Here
|
| 1516 |
my $itemdamaged_count = 0; |
1517 |
my $itemdamaged_count = 0; |
| 1517 |
my $item_in_transit_count = 0; |
1518 |
my $item_in_transit_count = 0; |
| 1518 |
my $can_place_holds = 0; |
1519 |
my $can_place_holds = 0; |
|
|
1520 |
my $item_onhold_count = 0; |
| 1519 |
my $items_count = scalar(@fields); |
1521 |
my $items_count = scalar(@fields); |
| 1520 |
my $maxitems = |
1522 |
my $maxitems = |
| 1521 |
( C4::Context->preference('maxItemsinSearchResults') ) |
1523 |
( C4::Context->preference('maxItemsinSearchResults') ) |
|
Lines 1573-1578
sub searchResults {
Link Here
|
| 1573 |
my $transfertwhen = ''; |
1575 |
my $transfertwhen = ''; |
| 1574 |
my ($transfertfrom, $transfertto); |
1576 |
my ($transfertfrom, $transfertto); |
| 1575 |
|
1577 |
|
|
|
1578 |
# is item on the reserve shelf? |
| 1579 |
my $reservestatus = 0; |
| 1580 |
my $reserveitem; |
| 1581 |
|
| 1576 |
unless ($item->{wthdrawn} |
1582 |
unless ($item->{wthdrawn} |
| 1577 |
|| $item->{itemlost} |
1583 |
|| $item->{itemlost} |
| 1578 |
|| $item->{damaged} |
1584 |
|| $item->{damaged} |
|
Lines 1592-1597
sub searchResults {
Link Here
|
| 1592 |
# should map transit status to record indexed in Zebra. |
1598 |
# should map transit status to record indexed in Zebra. |
| 1593 |
# |
1599 |
# |
| 1594 |
($transfertwhen, $transfertfrom, $transfertto) = C4::Circulation::GetTransfers($item->{itemnumber}); |
1600 |
($transfertwhen, $transfertfrom, $transfertto) = C4::Circulation::GetTransfers($item->{itemnumber}); |
|
|
1601 |
($reservestatus, $reserveitem) = C4::Reserves::CheckReserves($item->{itemnumber}); |
| 1595 |
} |
1602 |
} |
| 1596 |
|
1603 |
|
| 1597 |
# item is withdrawn, lost or damaged |
1604 |
# item is withdrawn, lost or damaged |
|
Lines 1599-1610
sub searchResults {
Link Here
|
| 1599 |
|| $item->{itemlost} |
1606 |
|| $item->{itemlost} |
| 1600 |
|| $item->{damaged} |
1607 |
|| $item->{damaged} |
| 1601 |
|| $item->{notforloan} |
1608 |
|| $item->{notforloan} |
|
|
1609 |
|| $reservestatus eq 'Waiting' |
| 1602 |
|| ($transfertwhen ne '')) |
1610 |
|| ($transfertwhen ne '')) |
| 1603 |
{ |
1611 |
{ |
| 1604 |
$wthdrawn_count++ if $item->{wthdrawn}; |
1612 |
$wthdrawn_count++ if $item->{wthdrawn}; |
| 1605 |
$itemlost_count++ if $item->{itemlost}; |
1613 |
$itemlost_count++ if $item->{itemlost}; |
| 1606 |
$itemdamaged_count++ if $item->{damaged}; |
1614 |
$itemdamaged_count++ if $item->{damaged}; |
| 1607 |
$item_in_transit_count++ if $transfertwhen ne ''; |
1615 |
$item_in_transit_count++ if $transfertwhen ne ''; |
|
|
1616 |
$item_onhold_count++ if $reservestatus eq 'Waiting'; |
| 1608 |
$item->{status} = $item->{wthdrawn} . "-" . $item->{itemlost} . "-" . $item->{damaged} . "-" . $item->{notforloan}; |
1617 |
$item->{status} = $item->{wthdrawn} . "-" . $item->{itemlost} . "-" . $item->{damaged} . "-" . $item->{notforloan}; |
| 1609 |
$other_count++; |
1618 |
$other_count++; |
| 1610 |
|
1619 |
|
|
Lines 1613-1618
sub searchResults {
Link Here
|
| 1613 |
$other_items->{$key}->{$_} = $item->{$_}; |
1622 |
$other_items->{$key}->{$_} = $item->{$_}; |
| 1614 |
} |
1623 |
} |
| 1615 |
$other_items->{$key}->{intransit} = ($transfertwhen ne '') ? 1 : 0; |
1624 |
$other_items->{$key}->{intransit} = ($transfertwhen ne '') ? 1 : 0; |
|
|
1625 |
$other_items->{$key}->{onhold} = ($reservestatus) ? 1 : 0; |
| 1616 |
$other_items->{$key}->{notforloan} = GetAuthorisedValueDesc('','',$item->{notforloan},'','',$notforloan_authorised_value) if $notforloan_authorised_value; |
1626 |
$other_items->{$key}->{notforloan} = GetAuthorisedValueDesc('','',$item->{notforloan},'','',$notforloan_authorised_value) if $notforloan_authorised_value; |
| 1617 |
$other_items->{$key}->{count}++ if $item->{$hbranch}; |
1627 |
$other_items->{$key}->{count}++ if $item->{$hbranch}; |
| 1618 |
$other_items->{$key}->{location} = $shelflocations->{ $item->{location} }; |
1628 |
$other_items->{$key}->{location} = $shelflocations->{ $item->{location} }; |
|
Lines 1677-1682
sub searchResults {
Link Here
|
| 1677 |
$oldbiblio->{itemlostcount} = $itemlost_count; |
1687 |
$oldbiblio->{itemlostcount} = $itemlost_count; |
| 1678 |
$oldbiblio->{damagedcount} = $itemdamaged_count; |
1688 |
$oldbiblio->{damagedcount} = $itemdamaged_count; |
| 1679 |
$oldbiblio->{intransitcount} = $item_in_transit_count; |
1689 |
$oldbiblio->{intransitcount} = $item_in_transit_count; |
|
|
1690 |
$oldbiblio->{onholdcount} = $item_onhold_count; |
| 1680 |
$oldbiblio->{orderedcount} = $ordered_count; |
1691 |
$oldbiblio->{orderedcount} = $ordered_count; |
| 1681 |
$oldbiblio->{isbn} =~ |
1692 |
$oldbiblio->{isbn} =~ |
| 1682 |
s/-//g; # deleting - in isbn to enable amazon content |
1693 |
s/-//g; # deleting - in isbn to enable amazon content |