Bugzilla – Attachment 777 Details for
Bug 2655
Items waiting on the hold shelf display as "Available" in OPAC
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Propose patch. Fixes opac results if data transformed thru xsl.
0003-Bug-2655-Partial-fix-for-Items-on-hold-shelf-showin.patch (text/plain), 3.80 KB, created by
Chris Cormack
on 2010-02-21 00:09:00 UTC
(
hide
)
Description:
Propose patch. Fixes opac results if data transformed thru xsl.
Filename:
MIME Type:
Creator:
Chris Cormack
Created:
2010-02-21 00:09:00 UTC
Size:
3.80 KB
patch
obsolete
>From b5fb659207120c9acbeb24384fc05fa5f43e8ea8 Mon Sep 17 00:00:00 2001 >From: Garry Collum <gcollum@gmail.com> >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 @@ > <xsl:value-of select="count(key('item-by-status', 'In transit'))"/> > <xsl:text>). </xsl:text> </span> > </xsl:if> >+ <xsl:if test="count(key('item-by-status', 'Waiting'))>0"> >+ <span class="unavailable"> >+ <xsl:text>On hold (</xsl:text> >+ <xsl:value-of select="count(key('item-by-status', 'Waiting'))"/> >+ <xsl:text>). </xsl:text> </span> >+ </xsl:if> > </span> > </xsl:template> > >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 @@ > <xsl:text>). </xsl:text> > </span> > </xsl:if> >+ <xsl:if test="count(key('item-by-status', 'Waiting'))>0"> >+ <span class="unavailable"> >+ <xsl:text>On hold (</xsl:text> >+ <xsl:value-of select="count(key('item-by-status', 'Waiting'))"/> >+ <xsl:text>). </xsl:text> >+ </span> >+ </xsl:if> > </span> > > </xsl:template> >-- >1.5.6.5 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 2655
:
775
|
776
| 777 |
778