Bug 6886: (follow-up) replace needless <xsl:choose> with <xsl:if>
authorKyle M Hall <kyle@bywatersolutions.com>
Wed, 4 Dec 2013 17:24:38 +0000 (12:24 -0500)
committerGalen Charlton <gmc@esilibrary.com>
Mon, 6 Jan 2014 16:29:46 +0000 (16:29 +0000)
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests and QA script.
Switching SingleBranchMode:

Tested with MARC21 and UNIMARC:
- "Don't allow" - branch is not shown in result list
- "Allow" - branch is shown for available items in result list

Changes are consistent over all 3 MARC flavours.

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 f3550d6..689641c 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:choose>
-                                   <xsl:when test="$singleBranchMode=0">
-                                       <xsl:value-of select="items:homebranch"/>
-                                   </xsl:when>
-                               </xsl:choose>
+                       <xsl:if test="$singleBranchMode=0">
+                           <xsl:value-of select="items:homebranch"/>
+                       </xsl:if>
                    <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:choose>
-                                <xsl:when test="$singleBranchMode=0">
-                                    <xsl:value-of select="items:homebranch"/>
-                                </xsl:when>
-                            </xsl:choose>
+                            <xsl:if test="$singleBranchMode=0">
+                                <xsl:value-of select="items:homebranch"/>
+                            </xsl:if>
                             <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)))"/>
index 6c274bc..5f4b533 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:choose>
-                           <xsl:when test="$singleBranchMode=0">
+                           <xsl:if test="$singleBranchMode=0">
                                <xsl:value-of select="items:homebranch"/>
-                           </xsl:when>
-                       </xsl:choose>
-
+                           </xsl:if>
                                                   <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)))"/>
index 21193e5..9dde821 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:choose>
-              <xsl:when test="$singleBranchMode=0">
-                  <xsl:value-of select="items:homebranch"/>
-              </xsl:when>
-            </xsl:choose>
+            <xsl:if test="$singleBranchMode=0">
+                <xsl:value-of select="items:homebranch"/>
+            </xsl:if>
             <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)))"/>