Bug 6886: ensure that singleBranchMode does not display library name for reference...
authorKyle M Hall <kyle@bywatersolutions.com>
Fri, 4 Jan 2013 18:40:33 +0000 (13:40 -0500)
committerGalen Charlton <gmc@esilibrary.com>
Mon, 6 Jan 2014 16:28:48 +0000 (16:28 +0000)
Test plan: Enable singleBranchMode and  OPACXSLTResultsDisplay. Perform
a search in the OPAC which returns results containing not-for-loan
items. Before the patch these items will show their library in search
results loan items. After the patch there will be not be a library
listed, matching other items in results.

Signed-off-by jmbroust <jean-manuel.broust@univ-lyon2.fr>

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Comments on second patch.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACResults.xsl
koha-tmpl/opac-tmpl/prog/en/xslt/NORMARCslim2OPACResults.xsl
koha-tmpl/opac-tmpl/prog/en/xslt/UNIMARCslim2OPACResults.xsl

index addc7de..f3550d6 100644 (file)
                </xsl:when>
                <xsl:otherwise>
                    <xsl:for-each select="$available_items[generate-id() = generate-id(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch))[1])]">
-                               <xsl:value-of select="items:homebranch"/>
+                               <xsl:choose>
+                                   <xsl:when test="$singleBranchMode=0">
+                                       <xsl:value-of select="items:homebranch"/>
+                                   </xsl:when>
+                               </xsl:choose>
                    <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber and $OPACItemLocation='callnum'"> [<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)))"/>
                         <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:choose>
+                                <xsl:when test="$singleBranchMode=0">
+                                    <xsl:value-of select="items:homebranch"/>
+                                </xsl:when>
+                            </xsl:choose>
+                            <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>
index 58ce6d9..6c274bc 100644 (file)
                        <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:choose>
+                           <xsl:when test="$singleBranchMode=0">
+                               <xsl:value-of select="items:homebranch"/>
+                           </xsl:when>
+                       </xsl:choose>
 
                                                   <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber"> [<xsl:value-of select="items:itemcallnumber"/>]</xsl:if>
                            <xsl:text> (</xsl:text>
index ebf94b9..21193e5 100644 (file)
           <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:choose>
+              <xsl:when test="$singleBranchMode=0">
+                  <xsl:value-of select="items:homebranch"/>
+              </xsl:when>
+            </xsl:choose>
             <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)))"/>