From 4b6b31066d12fc30a40e943232660e89b3efcd05 Mon Sep 17 00:00:00 2001
From: Kyle M Hall <kyle@bywatersolutions.com>
Date: Mon, 8 Apr 2013 09:07:43 -0400
Subject: [PATCH] Bug 9995 - For reference items no longer listed in XSLT
 result lists
Content-Type: text/plain; charset=utf-8

Re-added the xsl that shouldn't have been removed.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Tested with different settings for OpacItemLocation
and not for loan set in the item and for the item type.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
---
 .../prog/en/xslt/MARC21slim2OPACResults.xsl        |   19 ++++++++++++++++++-
 1 files changed, 18 insertions(+), 1 deletions(-)

diff --git a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACResults.xsl b/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACResults.xsl
index 4335e50..cdeb672 100644
--- a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACResults.xsl
+++ b/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACResults.xsl
@@ -1071,11 +1071,28 @@
                                </xsl:for-each>
                </xsl:otherwise>
                </xsl:choose>
-           </span>
 
+           </span>
                    </xsl:when>
 				   </xsl:choose>
 
+            <xsl:choose>
+                <xsl:when test="count(key('item-by-status', 'reference'))>0">
+                    <span class="available">
+                        <b><xsl:text>Copies available for reference: </xsl:text></b>
+                        <xsl:variable name="reference_items" select="key('item-by-status', 'reference')"/>
+                        <xsl:for-each select="$reference_items[generate-id() = generate-id(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch))[1])]">
+                                <xsl:value-of select="items:homebranch"/>
+                                <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber"> [<xsl:value-of select="items:itemcallnumber"/>]</xsl:if>
+                                <xsl:text> (</xsl:text>
+                                <xsl:value-of select="count(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch)))"/>
+                                <xsl:text> )</xsl:text>
+                                <xsl:choose><xsl:when test="position()=last()"><xsl:text>. </xsl:text></xsl:when><xsl:otherwise><xsl:text>, </xsl:text></xsl:otherwise></xsl:choose>
+                        </xsl:for-each>
+                    </span>
+                </xsl:when>
+            </xsl:choose>
+
                    <xsl:choose> <xsl:when test="count(key('item-by-status', 'available'))>0">
                        <xsl:choose><xsl:when test="count(key('item-by-status', 'reference'))>0">
                             <br/>
-- 
1.7.7.6