From 9fa69bff820b6e109864c3b6e88a98187f40ded2 Mon Sep 17 00:00:00 2001 From: Garry Collum Date: Sat, 20 Feb 2010 19:16:23 -0500 Subject: [PATCH] Bug 2655: Partial fix for Items on hold shelf showing as available. Fixes the opac results (opac-search.pl), if using xsl to transform data. I have no way to test UNIMARC results, if someone could test it for me. Signed-off-by: Galen Charlton --- C4/XSLT.pm | 10 ++++++++-- .../opac-tmpl/prog/en/xslt/MARC21slim2OPACResults.xsl | 6 ++++++ .../opac-tmpl/prog/en/xslt/UNIMARCslim2OPACResults.xsl | 7 +++++++ 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/C4/XSLT.pm b/C4/XSLT.pm index a5cf211f5e..8dd7840d05 100644 --- a/C4/XSLT.pm +++ b/C4/XSLT.pm @@ -26,6 +26,7 @@ use C4::Items; use C4::Koha; use C4::Biblio; use C4::Circulation; +use C4::Reserves; use Encode; use XML::LibXML; use XML::LibXSLT; @@ -173,8 +174,10 @@ sub buildKohaItemsNamespace { my ( $transfertwhen, $transfertfrom, $transfertto ) = C4::Circulation::GetTransfers($item->{itemnumber}); - if ( $itemtypes->{ $item->{itype} }->{notforloan} || $item->{notforloan} || $item->{onloan} || $item->{wthdrawn} || $item->{itemlost} || $item->{damaged} || - (defined $transfertwhen && $transfertwhen ne '') || $item->{itemnotforloan} ) { + my ( $reservestatus, $reserveitem ) = C4::Reserves::CheckReserves($item->{itemnumber}); + + if ( $itemtypes->{ $item->{itype} }->{notforloan} || $item->{notforloan} || $item->{onloan} || $item->{wthdrawn} || $item->{itemlost} || $item->{damaged} || + (defined $transfertwhen && $transfertwhen ne '') || $item->{itemnotforloan} || (defined $reservestatus && $reservestatus eq "Waiting") ){ if ( $item->{notforloan} < 0) { $status = "On order"; } @@ -196,6 +199,9 @@ sub buildKohaItemsNamespace { if (defined $transfertwhen && $transfertwhen ne '') { $status = 'In transit'; } + if (defined $reservestatus && $reservestatus eq "Waiting") { + $status = 'Waiting'; + } } else { $status = "available"; } diff --git a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACResults.xsl b/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACResults.xsl index 0ee5a73d8e..f146aba0fd 100644 --- a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACResults.xsl +++ b/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACResults.xsl @@ -1010,6 +1010,12 @@ ). + + + On hold ( + + ). + diff --git a/koha-tmpl/opac-tmpl/prog/en/xslt/UNIMARCslim2OPACResults.xsl b/koha-tmpl/opac-tmpl/prog/en/xslt/UNIMARCslim2OPACResults.xsl index 612295eb60..6917ca2758 100644 --- a/koha-tmpl/opac-tmpl/prog/en/xslt/UNIMARCslim2OPACResults.xsl +++ b/koha-tmpl/opac-tmpl/prog/en/xslt/UNIMARCslim2OPACResults.xsl @@ -189,6 +189,13 @@ ). + + + On hold ( + + ). + + -- 2.39.5