View | Details | Raw Unified | Return to bug 38096
Collapse All | Expand All

(-)a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl (-44 / +7 lines)
Lines 1042-1091 Link Here
1042
            <span class="results_summary online_resources">
1042
            <span class="results_summary online_resources">
1043
                <span class="label">Online resources: </span>
1043
                <span class="label">Online resources: </span>
1044
                <ul class="resource_list">
1044
                <ul class="resource_list">
1045
                    <xsl:for-each select="marc:datafield[@tag=856 and marc:subfield[@code='u']]">
1045
                    <xsl:call-template name="renderMARCOnlineResourceField">
1046
                        <xsl:variable name="SubqText"><xsl:value-of select="marc:subfield[@code='q']"/></xsl:variable>
1046
                        <xsl:with-param name="MARCOnlineResourceField">856</xsl:with-param>
1047
                        <li>
1047
                        <xsl:with-param name="Show856uAsImage" select="$Show856uAsImage"></xsl:with-param>
1048
                            <a property="url">
1048
                        <xsl:with-param name="OPACTrackClicks" select="$OPACTrackClicks"></xsl:with-param>
1049
                                <xsl:choose>
1049
                        <xsl:with-param name="OPACURLOpenInNewWindow" select="$OPACURLOpenInNewWindow"></xsl:with-param>
1050
                                    <xsl:when test="$OPACTrackClicks='track'">
1050
                        <xsl:with-param name="screen" select="detail"></xsl:with-param>
1051
                                        <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>
1051
                    </xsl:call-template>
1052
                                    </xsl:when>
1053
                                    <xsl:when test="$OPACTrackClicks='anonymous'">
1054
                                        <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>
1055
                                    </xsl:when>
1056
                                    <xsl:otherwise>
1057
                                        <xsl:attribute name="href">
1058
                                            <xsl:call-template name="AddMissingProtocol">
1059
                                                <xsl:with-param name="resourceLocation" select="marc:subfield[@code='u']"/>
1060
                                                <xsl:with-param name="indicator1" select="@ind1"/>
1061
                                                <xsl:with-param name="accessMethod" select="marc:subfield[@code='2']"/>
1062
                                            </xsl:call-template>
1063
                                            <xsl:value-of select="marc:subfield[@code='u']"/>
1064
                                        </xsl:attribute>
1065
                                    </xsl:otherwise>
1066
                                </xsl:choose>
1067
                                <xsl:if test="$OPACURLOpenInNewWindow='1'">
1068
                                    <xsl:attribute name="target">_blank</xsl:attribute>
1069
                                </xsl:if>
1070
                                <xsl:choose>
1071
                                    <xsl:when test="($Show856uAsImage='Details' or $Show856uAsImage='Both') and (substring($SubqText,1,6)='image/' or $SubqText='img' or $SubqText='bmp' or $SubqText='cod' or $SubqText='gif' or $SubqText='ief' or $SubqText='jpe' or $SubqText='jpeg' or $SubqText='jpg' or $SubqText='jfif' or $SubqText='png' or $SubqText='svg' or $SubqText='tif' or $SubqText='tiff' or $SubqText='ras' or $SubqText='cmx' or $SubqText='ico' or $SubqText='pnm' or $SubqText='pbm' or $SubqText='pgm' or $SubqText='ppm' or $SubqText='rgb' or $SubqText='xbm' or $SubqText='xpm' or $SubqText='xwd')">
1072
                                        <xsl:element name="img"><xsl:attribute name="src"><xsl:value-of select="marc:subfield[@code='u']"/></xsl:attribute><xsl:attribute name="alt"><xsl:value-of select="marc:subfield[@code='y']"/></xsl:attribute><xsl:attribute name="style">height:100px</xsl:attribute></xsl:element><xsl:text></xsl:text>
1073
                                    </xsl:when>
1074
                                    <xsl:when test="marc:subfield[@code='y' or @code='3' or @code='z']">
1075
                                        <xsl:call-template name="subfieldSelect">
1076
                                            <xsl:with-param name="codes">y3z</xsl:with-param>
1077
                                        </xsl:call-template>
1078
                                    </xsl:when>
1079
                                    <xsl:when test="$URLLinkText!=''">
1080
                                        <xsl:value-of select="$URLLinkText"/>
1081
                                    </xsl:when>
1082
                                    <xsl:otherwise>
1083
                                        <xsl:text>Click here to access online</xsl:text>
1084
                                    </xsl:otherwise>
1085
                                </xsl:choose>
1086
                            </a>
1087
                        </li>
1088
                    </xsl:for-each>
1089
                </ul>
1052
                </ul>
1090
            </span>
1053
            </span>
1091
        </xsl:if>
1054
        </xsl:if>
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl (-46 / +10 lines)
Lines 1215-1268 Link Here
1215
        </span>
1215
        </span>
1216
    </xsl:if>
1216
    </xsl:if>
1217
1217
1218
            <xsl:if test="marc:datafield[@tag=856]">
1218
        <xsl:if test="marc:datafield[@tag=856]">
1219
                <xsl:if test="marc:datafield[@tag=856]/marc:subfield[@code='u']">
1219
            <xsl:if test="marc:datafield[@tag=856]/marc:subfield[@code='u']">
1220
                    <div class="results_summary online_resources">
1220
                <div class="results_summary online_resources">
1221
                    <span class="label">Online resources: </span>
1221
                    <span class="label">Online resources: </span>
1222
                    <ul class="resource_list">
1222
                    <ul class="resource_list">
1223
                        <xsl:for-each select="marc:datafield[@tag=856 and marc:subfield[@code='u']]">
1223
                        <xsl:call-template name="renderMARCOnlineResourceField">
1224
                            <xsl:variable name="SubqText"><xsl:value-of select="marc:subfield[@code='q']" /></xsl:variable>
1224
                            <xsl:with-param name="MARCOnlineResourceField">856</xsl:with-param>
1225
                            <li>
1225
                            <xsl:with-param name="Show856uAsImage" select="$Show856uAsImage"></xsl:with-param>
1226
                                <a property="url">
1226
                            <xsl:with-param name="OPACTrackClicks" select="$OPACTrackClicks"></xsl:with-param>
1227
                                    <xsl:choose>
1227
                            <xsl:with-param name="OPACURLOpenInNewWindow" select="$OPACURLOpenInNewWindow"></xsl:with-param>
1228
                                        <xsl:when test="$OPACTrackClicks='track'">
1228
                            <xsl:with-param name="screen" select="results"></xsl:with-param>
1229
                                            <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>
1229
                        </xsl:call-template>
1230
                                        </xsl:when>
1231
                                        <xsl:when test="$OPACTrackClicks='anonymous'">
1232
                                            <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>
1233
                                        </xsl:when>
1234
                                        <xsl:otherwise>
1235
                                            <xsl:attribute name="href">
1236
                                                <xsl:call-template name="AddMissingProtocol">
1237
                                                    <xsl:with-param name="resourceLocation" select="marc:subfield[@code='u']" />
1238
                                                    <xsl:with-param name="indicator1" select="@ind1" />
1239
                                                    <xsl:with-param name="accessMethod" select="marc:subfield[@code='2']" />
1240
                                                </xsl:call-template>
1241
                                                <xsl:value-of select="marc:subfield[@code='u']" />
1242
                                            </xsl:attribute>
1243
                                        </xsl:otherwise>
1244
                                    </xsl:choose>
1245
                                    <xsl:if test="$OPACURLOpenInNewWindow='1'">
1246
                                        <xsl:attribute name="target">_blank</xsl:attribute>
1247
                                    </xsl:if>
1248
                                    <xsl:choose>
1249
                                        <xsl:when test="($Show856uAsImage='Results' or $Show856uAsImage='Both') and (substring($SubqText,1,6)='image/' or $SubqText='img' or $SubqText='bmp' or $SubqText='cod' or $SubqText='gif' or $SubqText='ief' or $SubqText='jpe' or $SubqText='jpeg' or $SubqText='jpg' or $SubqText='jfif' or $SubqText='png' or $SubqText='svg' or $SubqText='tif' or $SubqText='tiff' or $SubqText='ras' or $SubqText='cmx' or $SubqText='ico' or $SubqText='pnm' or $SubqText='pbm' or $SubqText='pgm' or $SubqText='ppm' or $SubqText='rgb' or $SubqText='xbm' or $SubqText='xpm' or $SubqText='xwd')">
1250
                                            <xsl:element name="img"><xsl:attribute name="src"><xsl:value-of select="marc:subfield[@code='u']" /></xsl:attribute><xsl:attribute name="alt"><xsl:value-of select="marc:subfield[@code='y']" /></xsl:attribute><xsl:attribute name="style">height:100px;</xsl:attribute></xsl:element><xsl:text></xsl:text>
1251
                                        </xsl:when>
1252
                                        <xsl:when test="marc:subfield[@code='y' or @code='3' or @code='z']">
1253
                                            <xsl:call-template name="subfieldSelect">
1254
                                                <xsl:with-param name="codes">y3z</xsl:with-param>
1255
                                            </xsl:call-template>
1256
                                        </xsl:when>
1257
                                        <xsl:when test="$URLLinkText!=''">
1258
                                            <xsl:value-of select="$URLLinkText" />
1259
                                        </xsl:when>
1260
                                        <xsl:otherwise>
1261
                                            <xsl:text>Click here to access online</xsl:text>
1262
                                        </xsl:otherwise>
1263
                                    </xsl:choose>
1264
                                </a></li>
1265
                        </xsl:for-each>
1266
                    </ul>
1230
                    </ul>
1267
                </div>
1231
                </div>
1268
            </xsl:if>
1232
            </xsl:if>
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slimUtils.xsl (-1 / +54 lines)
Lines 655-660 Link Here
655
        </xsl:if>
655
        </xsl:if>
656
    </xsl:template>
656
    </xsl:template>
657
657
658
    <xsl:template name="renderMARCOnlineResourceField">
659
        <xsl:param name="MARCOnlineResourceField" />
660
        <xsl:param name="Show856uAsImage" />
661
        <xsl:param name="OPACTrackClicks" />
662
        <xsl:param name="OPACURLOpenInNewWindow" />
663
        <xsl:param name="screen" />
664
665
        <xsl:for-each select="marc:datafield[@tag=$MARCOnlineResourceField and marc:subfield[@code='u']]">
666
            <xsl:variable name="SubqText"><xsl:value-of select="marc:subfield[@code='q']" /></xsl:variable>
667
            <li>
668
                <a property="url">
669
                    <xsl:choose>
670
                        <xsl:when test="$OPACTrackClicks='track'">
671
                            <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>
672
                        </xsl:when>
673
                        <xsl:when test="$OPACTrackClicks='anonymous'">
674
                            <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>
675
                        </xsl:when>
676
                        <xsl:otherwise>
677
                            <xsl:attribute name="href">
678
                                <xsl:call-template name="AddMissingProtocol">
679
                                    <xsl:with-param name="resourceLocation" select="marc:subfield[@code='u']" />
680
                                    <xsl:with-param name="indicator1" select="@ind1" />
681
                                    <xsl:with-param name="accessMethod" select="marc:subfield[@code='2']" />
682
                                </xsl:call-template>
683
                                <xsl:value-of select="marc:subfield[@code='u']" />
684
                            </xsl:attribute>
685
                        </xsl:otherwise>
686
                    </xsl:choose>
687
                    <xsl:if test="$OPACURLOpenInNewWindow='1'">
688
                        <xsl:attribute name="target">_blank</xsl:attribute>
689
                    </xsl:if>
690
                    <xsl:choose>
691
                        <xsl:when test="(($screen='detail' and $Show856uAsImage='Details' or $Show856uAsImage='Both') or 
692
                        ($screen='results' and $Show856uAsImage='Results' or $Show856uAsImage='Both')) and (substring($SubqText,1,6)='image/' or $SubqText='img' or $SubqText='bmp' or $SubqText='cod' or $SubqText='gif' or $SubqText='ief' or $SubqText='jpe' or $SubqText='jpeg' or $SubqText='jpg' or $SubqText='jfif' or $SubqText='png' or $SubqText='svg' or $SubqText='tif' or $SubqText='tiff' or $SubqText='ras' or $SubqText='cmx' or $SubqText='ico' or $SubqText='pnm' or $SubqText='pbm' or $SubqText='pgm' or $SubqText='ppm' or $SubqText='rgb' or $SubqText='xbm' or $SubqText='xpm' or $SubqText='xwd')">
693
                            <xsl:element name="img"><xsl:attribute name="src"><xsl:value-of select="marc:subfield[@code='u']" /></xsl:attribute><xsl:attribute name="alt"><xsl:value-of select="marc:subfield[@code='y']" /></xsl:attribute><xsl:attribute name="style">height:100px;</xsl:attribute></xsl:element><xsl:text></xsl:text>
694
                        </xsl:when>
695
                        <xsl:when test="marc:subfield[@code='y' or @code='3' or @code='z']">
696
                            <xsl:call-template name="subfieldSelect">
697
                                <xsl:with-param name="codes">y3z</xsl:with-param>
698
                            </xsl:call-template>
699
                        </xsl:when>
700
                        <xsl:when test="$URLLinkText!=''">
701
                            <xsl:value-of select="$URLLinkText" />
702
                        </xsl:when>
703
                        <xsl:otherwise>
704
                            <xsl:text>Click here to access online</xsl:text>
705
                        </xsl:otherwise>
706
                    </xsl:choose>
707
                </a>
708
            </li>
709
        </xsl:for-each>
710
    </xsl:template>
711
    
658
    <xsl:template name="AddMissingProtocol">
712
    <xsl:template name="AddMissingProtocol">
659
        <xsl:param name="resourceLocation"/>
713
        <xsl:param name="resourceLocation"/>
660
        <xsl:param name="indicator1"/>
714
        <xsl:param name="indicator1"/>
661
- 

Return to bug 38096