From b5fb659207120c9acbeb24384fc05fa5f43e8ea8 Mon Sep 17 00:00:00 2001 From: Garry Collum Date: Sat, 20 Feb 2010 19:08:59 -0500 Subject: [PATCH] Bug 2655: Partial fix for Items on hold shelf showing as available. Content-Type: text/plain; charset="utf-8" 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. --- C4/XSLT.pm | 10 ++++++++-- .../prog/en/xslt/MARC21slim2OPACResults.xsl | 6 ++++++ .../prog/en/xslt/UNIMARCslim2OPACResults.xsl | 7 +++++++ 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/C4/XSLT.pm b/C4/XSLT.pm index a5cf211..8dd7840 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 0ee5a73..f146aba 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 612295e..6917ca2 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 ( + + ). + + -- 1.5.6.5