xmlns:marc="http://www.loc.gov/MARC21/slim"
xmlns:items="http://www.koha-community.org/items"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- exclude-result-prefixes="marc items">
- <xsl:import href="MARC21slimUtils.xsl"/>
+ xmlns:str="http://exslt.org/strings"
+ exclude-result-prefixes="marc items str">
+ <xsl:import href="NORMARCslimUtils.xsl"/>
<xsl:output method = "html" indent="yes" omit-xml-declaration = "yes" encoding="UTF-8"/>
<xsl:key name="item-by-status" match="items:item" use="items:status"/>
<xsl:key name="item-by-status-and-branch" match="items:item" use="concat(items:status, ' ', items:homebranch)"/>
</xsl:template>
<xsl:template match="marc:record">
+ <xsl:variable name="UseControlNumber" select="marc:sysprefs/marc:syspref[@name='UseControlNumber']"/>
<xsl:variable name="hidelostitems" select="marc:sysprefs/marc:syspref[@name='hidelostitems']"/>
<xsl:variable name="URLLinkText" select="marc:sysprefs/marc:syspref[@name='URLLinkText']"/>
<xsl:variable name="Show856uAsImage" select="marc:sysprefs/marc:syspref[@name='Display856uAsImage']"/>
<xsl:variable name="AlternateHoldingsField" select="substring(marc:sysprefs/marc:syspref[@name='AlternateHoldingsField'], 1, 3)"/>
<xsl:variable name="AlternateHoldingsSubfields" select="substring(marc:sysprefs/marc:syspref[@name='AlternateHoldingsField'], 4)"/>
<xsl:variable name="AlternateHoldingsSeparator" select="marc:sysprefs/marc:syspref[@name='AlternateHoldingsSeparator']"/>
+ <xsl:variable name="OpacSuppression" select="marc:sysprefs/marc:syspref[@name='OpacSuppression']"/>
+ <xsl:variable name="IntranetBiblioDefaultView" select="marc:sysprefs/marc:syspref[@name='IntranetBiblioDefaultView']"/>
<xsl:variable name="UseAuthoritiesForTracings" select="marc:sysprefs/marc:syspref[@name='UseAuthoritiesForTracings']"/>
<xsl:variable name="leader" select="marc:leader"/>
<xsl:variable name="leader6" select="substring($leader,7,1)"/>
</xsl:variable>
- <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/detail.pl?biblionumber=<xsl:value-of select="$biblionumber"/></xsl:attribute><xsl:attribute name="class">title</xsl:attribute>
+ <!-- Indicate if record is suppressed in OPAC -->
+ <xsl:if test="$OpacSuppression = 1">
+ <xsl:if test="marc:datafield[@tag=942][marc:subfield[@code='n'] = '1']">
+ <span class="results_summary suppressed_opac">Suppressed in OPAC</span>
+ </xsl:if>
+ </xsl:if>
+
+ <a>
+ <xsl:attribute name="href">
+ <xsl:call-template name="buildBiblioDefaultViewURL">
+ <xsl:with-param name="IntranetBiblioDefaultView">
+ <xsl:value-of select="$IntranetBiblioDefaultView"/>
+ </xsl:with-param>
+ </xsl:call-template>
+ <xsl:value-of select="str:encode-uri($biblionumber, true())"/>
+ </xsl:attribute>
+ <xsl:attribute name="class">title</xsl:attribute>
<xsl:if test="marc:datafield[@tag=245]">
<xsl:for-each select="marc:datafield[@tag=245]">
<xsl:call-template name="subfieldSelect">
<xsl:with-param name="codes">a</xsl:with-param>
</xsl:call-template>
- <xsl:if test="marc:subfield[@code='b']">
+ <xsl:if test="marc:subfield[@code='h']">
<xsl:text> </xsl:text>
<xsl:call-template name="subfieldSelect">
- <xsl:with-param name="codes">b</xsl:with-param>
+ <xsl:with-param name="codes">h</xsl:with-param>
</xsl:call-template>
</xsl:if>
- <xsl:if test="marc:subfield[@code='h']">
+ <xsl:if test="marc:subfield[@code='b']">
<xsl:text> </xsl:text>
<xsl:call-template name="subfieldSelect">
- <xsl:with-param name="codes">h</xsl:with-param>
+ <xsl:with-param name="codes">b</xsl:with-param>
</xsl:call-template>
</xsl:if>
<xsl:text> </xsl:text>
<a>
<xsl:choose>
<xsl:when test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'">
- <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
+ <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=an:<xsl:value-of select="str:encode-uri(marc:subfield[@code=9], true())"/></xsl:attribute>
</xsl:when>
<xsl:otherwise>
- <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=au:"<xsl:value-of select="marc:subfield[@code='a']"/>"</xsl:attribute>
+ <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=au:"<xsl:value-of select="str:encode-uri(marc:subfield[@code='a'], true())"/>"</xsl:attribute>
</xsl:otherwise>
</xsl:choose>
<xsl:call-template name="nameABCDQ"/></a>
<a>
<xsl:choose>
<xsl:when test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'">
- <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
+ <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=an:<xsl:value-of select="str:encode-uri(marc:subfield[@code=9], true())"/></xsl:attribute>
</xsl:when>
<xsl:otherwise>
- <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=au:"<xsl:value-of select="marc:subfield[@code='a']"/>"</xsl:attribute>
+ <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=au:"<xsl:value-of select="str:encode-uri(marc:subfield[@code='a'], true())"/>"</xsl:attribute>
</xsl:otherwise>
</xsl:choose>
<xsl:call-template name="nameABCDN"/></a>
<a>
<xsl:choose>
<xsl:when test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'">
- <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
+ <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=an:<xsl:value-of select="str:encode-uri(marc:subfield[@code=9], true())"/></xsl:attribute>
</xsl:when>
<xsl:otherwise>
- <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=au:"<xsl:value-of select="marc:subfield[@code='a']"/>"</xsl:attribute>
+ <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=au:"<xsl:value-of select="str:encode-uri(marc:subfield[@code='a'], true())"/>"</xsl:attribute>
</xsl:otherwise>
</xsl:choose>
<xsl:call-template name="nameACDEQ"/></a>
</span>
</xsl:if>
+ <!-- Analytics -->
+ <xsl:if test="$leader7='s' or $leader7='c'">
+ <span class="results_summary analytics"><span class="label">Analytics: </span>
+ <a>
+ <xsl:choose>
+ <xsl:when test="$UseControlNumber = '1' and marc:controlfield[@tag=001]">
+ <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=rcn:<xsl:value-of select="str:encode-uri(marc:controlfield[@tag=001], true())"/>+and+(bib-level:a+or+bib-level:b)</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=Host-item:<xsl:value-of select="str:encode-uri(translate(marc:datafield[@tag=245]/marc:subfield[@code='a'], '/', ''), true())"/></xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:text>Show analytics</xsl:text>
+ </a>
+ </span>
+ </xsl:if>
+
+ <!-- 773 - Links from child to parent -->
+ <xsl:if test="marc:datafield[@tag=773]">
+ <xsl:for-each select="marc:datafield[@tag=773]">
+ <xsl:if test="@ind1=0">
+ <span class="results_summary in"><span class="label">
+ <xsl:choose>
+ <xsl:when test="@ind2=' '">
+ In:
+ </xsl:when>
+ <xsl:when test="@ind2=8">
+ <xsl:if test="marc:subfield[@code='i']">
+ <xsl:value-of select="marc:subfield[@code='i']"/>
+ </xsl:if>
+ </xsl:when>
+ </xsl:choose>
+ </span>
+ <xsl:variable name="f773">
+ <xsl:call-template name="chopPunctuation"><xsl:with-param name="chopString"><xsl:call-template name="subfieldSelect">
+ <xsl:with-param name="codes">a_t</xsl:with-param>
+ </xsl:call-template></xsl:with-param></xsl:call-template>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
+ <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=Control-number:<xsl:call-template name="extractControlNumber"><xsl:with-param name="subfieldW" select="marc:subfield[@code='w']"/></xsl:call-template></xsl:attribute>
+ <xsl:value-of select="translate($f773, '()', '')"/>
+ </a>
+ <xsl:if test="marc:subfield[@code='g']"><xsl:text> </xsl:text><xsl:value-of select="marc:subfield[@code='g']"/></xsl:if>
+ </xsl:when>
+ <xsl:when test="marc:subfield[@code='0']">
+ <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/detail.pl?biblionumber=<xsl:value-of select="str:encode-uri(marc:subfield[@code='0'], true())"/></xsl:attribute>
+ <xsl:value-of select="$f773"/>
+ </a>
+ </xsl:when>
+ <xsl:otherwise>
+ <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=ti,phr:<xsl:value-of select="str:encode-uri(translate($f773, '()', ''), true())"/></xsl:attribute>
+ <xsl:value-of select="$f773"/>
+ </a>
+ <xsl:if test="marc:subfield[@code='g']"><xsl:text> </xsl:text><xsl:value-of select="str:encode-uri(marc:subfield[@code='g'], true())"/></xsl:if>
+ </xsl:otherwise>
+ </xsl:choose>
+ </span>
+ <xsl:if test="marc:subfield[@code='n']">
+ <span class="results_summary"><xsl:value-of select="marc:subfield[@code='n']"/></span>
+ </xsl:if>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:if>
+
<span class="results_summary">
<xsl:if test="$typeOf008!=''">
<span class="label">Materialtype: </span>