Bug 7489 - Implement DisplayOPACiconsXSLT for NORMARC XSLT
authorMagnus Enger <magnus@enger.priv.no>
Fri, 3 Feb 2012 08:57:32 +0000 (09:57 +0100)
committerPaul Poulain <paul.poulain@biblibre.com>
Fri, 17 Feb 2012 08:55:16 +0000 (09:55 +0100)
This patch actually hides the whole line that contains the icon in the result
list, including "literary form" and "audience", but this is how the syspref
works for MARC21 too, so I'm sticking with that.

To test:
- Set marcflavour = NORMARC
- Set OPACXSLTResultsDisplay = on
- Set DisplayOPACiconsXSLT = show
- Check that icons and information about "Type", "Litterær form" and
  "MÃ¥lgruppe" are displayed in results, "Type" and the icon in detail
- Set DisplayOPACiconsXSLT = don't show
- Check that icons and information is not displayed in result or detail

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Test plan worked nicely. Patch works as advertised.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
koha-tmpl/opac-tmpl/prog/en/xslt/NORMARCslim2OPACDetail.xsl
koha-tmpl/opac-tmpl/prog/en/xslt/NORMARCslim2OPACResults.xsl

index 1a4e042..19cee91 100644 (file)
@@ -16,6 +16,8 @@
 
     <xsl:template match="marc:record">
 
+    <xsl:variable name="DisplayOPACiconsXSLT" select="marc:sysprefs/marc:syspref[@name='DisplayOPACiconsXSLT']"/>
+
         <xsl:variable name="leader" select="marc:leader"/>
         <xsl:variable name="leader6" select="substring($leader,7,1)"/>
         <xsl:variable name="leader7" select="substring($leader,8,1)"/>
         <span class="view"><a id="ISBDview" href="/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber={marc:datafield[@tag=999]/marc:subfield[@code='c']}">Kortvisning (ISBD)</a></span>
         </div> 
 
-
+    <xsl:if test="$DisplayOPACiconsXSLT!='0'">
         <xsl:if test="$materialTypeCode!=''">
         <span class="results_summary"><span class="label">Materialtype: </span>
         <xsl:element name="img"><xsl:attribute name="src">/opac-tmpl/prog/famfamfam/<xsl:value-of select="$materialTypeCode"/>.png</xsl:attribute><xsl:attribute name="alt"></xsl:attribute></xsl:element>
         <xsl:value-of select="$materialTypeLabel"/>
         </span>
         </xsl:if>
+    </xsl:if>
 
         <!--Series -->
         <xsl:if test="marc:datafield[@tag=440 or @tag=490]">
index 9d5323c..c6b700a 100644 (file)
@@ -18,6 +18,8 @@
     </xsl:template>
     <xsl:template match="marc:record">
 
+    <xsl:variable name="DisplayOPACiconsXSLT" select="marc:sysprefs/marc:syspref[@name='DisplayOPACiconsXSLT']"/>
+
         <xsl:variable name="leader" select="marc:leader"/>
         <xsl:variable name="leader6" select="substring($leader,7,1)"/>
         <xsl:variable name="leader7" select="substring($leader,8,1)"/>
        </span>
     </xsl:if>
 
+<xsl:if test="$DisplayOPACiconsXSLT!='0'">
     <span class="results_summary">
     <xsl:if test="$typeOf008!=''">
         <span class="label">Type: </span>
         </xsl:choose>
     </xsl:if>
        </span>
+</xsl:if>
 
        <!-- Utgivelse, distribusjon osv -->
     <xsl:if test="marc:datafield[@tag=260]">