Bug 21887: (For OPAC) 856 link problem in XSLT result lists and detail page
authorNazlı Çetin <nazli@devinim.com.tr>
Tue, 27 Nov 2018 15:24:38 +0000 (15:24 +0000)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Tue, 4 Jun 2019 09:19:25 +0000 (10:19 +0100)
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl
koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl

index 13d7174..1b523e0 100644 (file)
             <xsl:attribute name="href">/cgi-bin/koha/tracklinks.pl?uri=<xsl:value-of select="str:encode-uri(marc:subfield[@code='u'], true())"/>&amp;biblionumber=<xsl:value-of select="$biblionumber"/></xsl:attribute>
              </xsl:when>
              <xsl:otherwise>
-                <xsl:attribute name="href"><xsl:value-of select="marc:subfield[@code='u']"/></xsl:attribute>
+              <xsl:attribute name="href">
+                  <xsl:if test="not(contains(marc:subfield[@code='u'],'://'))">
+                      <xsl:choose>
+                          <xsl:when test="@ind1=7">
+                              <xsl:value-of select="marc:subfield[@code='2']"/><xsl:text>://</xsl:text>
+                          </xsl:when>
+                          <xsl:when test="@ind1=1">
+                              <xsl:text>ftp://</xsl:text>
+                          </xsl:when>
+                          <xsl:otherwise>
+                              <xsl:text>http://</xsl:text>
+                          </xsl:otherwise>
+                      </xsl:choose>
+                  </xsl:if>
+                  <xsl:value-of select="marc:subfield[@code='u']"/>
+              </xsl:attribute>
              </xsl:otherwise>
            </xsl:choose>
             <xsl:if test="$OPACURLOpenInNewWindow='1'">
index 71e53c8..6aaa329 100644 (file)
                       <xsl:attribute name="href">/cgi-bin/koha/tracklinks.pl?uri=<xsl:value-of select="str:encode-uri(marc:subfield[@code='u'], true())"/>&amp;biblionumber=<xsl:value-of select="$biblionumber"/></xsl:attribute>
                                </xsl:when>
                                <xsl:otherwise>
-                                 <xsl:attribute name="href"><xsl:value-of select="marc:subfield[@code='u']"/></xsl:attribute>
+                    <xsl:attribute name="href">
+                        <xsl:if test="not(contains(marc:subfield[@code='u'],'://'))">
+                            <xsl:choose>
+                                <xsl:when test="@ind1=7">
+                                    <xsl:value-of select="marc:subfield[@code='2']"/><xsl:text>://</xsl:text>
+                                </xsl:when>
+                                <xsl:when test="@ind1=1">
+                                    <xsl:text>ftp://</xsl:text>
+                                </xsl:when>
+                                <xsl:otherwise>
+                                    <xsl:text>http://</xsl:text>
+                                </xsl:otherwise>
+                            </xsl:choose>
+                        </xsl:if>
+                        <xsl:value-of select="marc:subfield[@code='u']"/>
+                    </xsl:attribute>
                                </xsl:otherwise>
                              </xsl:choose>
                                     <xsl:choose>