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

(-)a/C4/XSLT.pm (-1 / +2 lines)
Lines 128-134 sub XSLTParse4Display { Link Here
128
    my $itemsxml  = buildKohaItemsNamespace($biblionumber);
128
    my $itemsxml  = buildKohaItemsNamespace($biblionumber);
129
    my $xmlrecord = $record->as_xml(C4::Context->preference('marcflavour'));
129
    my $xmlrecord = $record->as_xml(C4::Context->preference('marcflavour'));
130
    my $sysxml = "<sysprefs>\n";
130
    my $sysxml = "<sysprefs>\n";
131
    foreach my $syspref ( qw/OPACURLOpenInNewWindow DisplayOPACiconsXSLT URLLinkText viewISBD OPACBaseURL/ ) {
131
    foreach my $syspref ( qw/OPACURLOpenInNewWindow DisplayOPACiconsXSLT 
132
URLLinkText viewISBD OPACBaseURL Display856uAsImage/ ) {
132
        $sysxml .= "<syspref name=\"$syspref\">" .
133
        $sysxml .= "<syspref name=\"$syspref\">" .
133
                   C4::Context->preference( $syspref ) .
134
                   C4::Context->preference( $syspref ) .
134
                   "</syspref>\n";
135
                   "</syspref>\n";
(-)a/installer/data/mysql/en/mandatory/sysprefs.sql (+1 lines)
Lines 283-285 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES Link Here
283
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesLocation','1','Use the item location when finding items for the shelf browser.','1','YesNo');
283
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesLocation','1','Use the item location when finding items for the shelf browser.','1','YesNo');
284
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesHomeBranch','1','Use the item home branch when finding items for the shelf browser.','1','YesNo');
284
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesHomeBranch','1','Use the item home branch when finding items for the shelf browser.','1','YesNo');
285
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo');
285
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo');
286
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('Display856uAsImage','OFF','Display the URI in the 856u field as an image, the corresponding OPACXSLT option must be on','OFF|Details|Results|Both','Choice');
(-)a/installer/data/mysql/updatedatabase.pl (+6 lines)
Lines 3953-3958 if (C4::Context->preference("Version") < TransformToNum($DBversion)) { Link Here
3953
    SetVersion ($DBversion);
3953
    SetVersion ($DBversion);
3954
}
3954
}
3955
3955
3956
$DBversion = "XXX";
3957
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
3958
    $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('Display856uAsImage','OFF','Display the URI in the 856u field as an image, the corresponding OPACXSLT option must be on','OFF|Details|Results|Both','Choice')");
3959
    print "Upgrade to $DBversion done (Add 'Display856uAsImage' syspref)\n";
3960
    SetVersion ($DBversion);
3961
}
3956
=head1 FUNCTIONS
3962
=head1 FUNCTIONS
3957
3963
3958
=head2 DropAllForeignKeys($table)
3964
=head2 DropAllForeignKeys($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref (+11 lines)
Lines 158-163 OPAC: Link Here
158
            - pref: OPACNoResultsFound
158
            - pref: OPACNoResultsFound
159
              type: textarea
159
              type: textarea
160
              class: code
160
              class: code
161
        -
162
            - 'Display the URI in the 856u field as an image on: '
163
            - pref: Display856uAsImage
164
              choices:
165
                  OFF: "Neither Details or Results pages"
166
                  Details: "Details page only"
167
                  Results: "Results page only"
168
                  Both: "Both Details and Results pages" 
169
            - 'Note: The corresponding OPACXSLT option must be turned 
170
on.'
171
161
    Features:
172
    Features:
162
        -
173
        -
163
            - pref: opacuserlogin
174
            - pref: opacuserlogin
(-)a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl (+13 lines)
Lines 22-27 Link Here
22
    <xsl:variable name="OPACURLOpenInNewWindow" select="marc:sysprefs/marc:syspref[@name='OPACURLOpenInNewWindow']"/>
22
    <xsl:variable name="OPACURLOpenInNewWindow" select="marc:sysprefs/marc:syspref[@name='OPACURLOpenInNewWindow']"/>
23
    <xsl:variable name="URLLinkText" select="marc:sysprefs/marc:syspref[@name='URLLinkText']"/>
23
    <xsl:variable name="URLLinkText" select="marc:sysprefs/marc:syspref[@name='URLLinkText']"/>
24
    <xsl:variable name="ShowISBD" select="marc:sysprefs/marc:syspref[@name='viewISBD']"/>
24
    <xsl:variable name="ShowISBD" select="marc:sysprefs/marc:syspref[@name='viewISBD']"/>
25
    <xsl:variable name="Show856uAsImage" select="marc:sysprefs/marc:syspref[@name='Display856uAsImage']"/>
25
        <xsl:variable name="leader" select="marc:leader"/>
26
        <xsl:variable name="leader" select="marc:leader"/>
26
        <xsl:variable name="leader6" select="substring($leader,7,1)"/>
27
        <xsl:variable name="leader6" select="substring($leader,7,1)"/>
27
        <xsl:variable name="leader7" select="substring($leader,8,1)"/>
28
        <xsl:variable name="leader7" select="substring($leader,8,1)"/>
Lines 510-515 Link Here
510
        <xsl:for-each select="marc:datafield[@tag=856]">
511
        <xsl:for-each select="marc:datafield[@tag=856]">
511
                            <xsl:if test="$OPACURLOpenInNewWindow='0'">
512
                            <xsl:if test="$OPACURLOpenInNewWindow='0'">
512
                                   <a><xsl:attribute name="href"><xsl:value-of select="marc:subfield[@code='u']"/></xsl:attribute>
513
                                   <a><xsl:attribute name="href"><xsl:value-of select="marc:subfield[@code='u']"/></xsl:attribute>
514
                                    <xsl:if test="$Show856uAsImage='Details' or $Show856uAsImage='Both'">
515
                                      <xsl:element name="img"><xsl:attribute name="src"><xsl:value-of select="marc:subfield[@code='u']"/></xsl:attribute><xsl:attribute name="height">100</xsl:attribute></xsl:element>
516
                                    </xsl:if>
513
                                    <xsl:choose>
517
                                    <xsl:choose>
514
                                    <xsl:when test="marc:subfield[@code='y' or @code='3' or @code='z']">
518
                                    <xsl:when test="marc:subfield[@code='y' or @code='3' or @code='z']">
515
                                        <xsl:call-template name="subfieldSelect">
519
                                        <xsl:call-template name="subfieldSelect">
Lines 521-526 Link Here
521
                                        <xsl:when test="$URLLinkText!=''">
525
                                        <xsl:when test="$URLLinkText!=''">
522
                                                <xsl:value-of select="$URLLinkText"/>
526
                                                <xsl:value-of select="$URLLinkText"/>
523
                                        </xsl:when>
527
                                        </xsl:when>
528
                                        <xsl:when test="$Show856uAsImage='Details' or $Show856uAsImage='Both'">
529
                                                 <xsl:text></xsl:text>
530
                                        </xsl:when>
524
                                        <xsl:otherwise>
531
                                        <xsl:otherwise>
525
                                                <xsl:text>Click here to access online</xsl:text>
532
                                                <xsl:text>Click here to access online</xsl:text>
526
                                        </xsl:otherwise>
533
                                        </xsl:otherwise>
Lines 531-536 Link Here
531
                              </xsl:if>
538
                              </xsl:if>
532
                            <xsl:if test="$OPACURLOpenInNewWindow='1'">
539
                            <xsl:if test="$OPACURLOpenInNewWindow='1'">
533
                                   <a target='_blank'><xsl:attribute name="href"><xsl:value-of select="marc:subfield[@code='u']"/></xsl:attribute>
540
                                   <a target='_blank'><xsl:attribute name="href"><xsl:value-of select="marc:subfield[@code='u']"/></xsl:attribute>
541
                                    <xsl:if test="$Show856uAsImage='Details' or $Show856uAsImage='Both'">
542
                                      <xsl:element name="img"><xsl:attribute name="src"><xsl:value-of select="marc:subfield[@code='u']"/></xsl:attribute><xsl:attribute name="height">100</xsl:attribute></xsl:element>
543
                                    </xsl:if>
534
                                    <xsl:choose>
544
                                    <xsl:choose>
535
                                    <xsl:when test="marc:subfield[@code='y' or @code='3' or @code='z']">
545
                                    <xsl:when test="marc:subfield[@code='y' or @code='3' or @code='z']">
536
                                        <xsl:call-template name="subfieldSelect">
546
                                        <xsl:call-template name="subfieldSelect">
Lines 542-547 Link Here
542
                                        <xsl:when test="$URLLinkText!=''">
552
                                        <xsl:when test="$URLLinkText!=''">
543
                                                <xsl:value-of select="$URLLinkText"/>
553
                                                <xsl:value-of select="$URLLinkText"/>
544
                                        </xsl:when>
554
                                        </xsl:when>
555
                                        <xsl:when test="$Show856uAsImage='Details' or $Show856uAsImage='Both'">
556
                                                 <xsl:text></xsl:text>
557
                                        </xsl:when>
545
                                        <xsl:otherwise>
558
                                        <xsl:otherwise>
546
                                                <xsl:text>Click here to access online</xsl:text>
559
                                                <xsl:text>Click here to access online</xsl:text>
547
                                        </xsl:otherwise>
560
                                        </xsl:otherwise>
(-)a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACResults.xsl (-1 / +13 lines)
Lines 22-27 Link Here
22
    <xsl:variable name="DisplayOPACiconsXSLT" select="marc:sysprefs/marc:syspref[@name='DisplayOPACiconsXSLT']"/>
22
    <xsl:variable name="DisplayOPACiconsXSLT" select="marc:sysprefs/marc:syspref[@name='DisplayOPACiconsXSLT']"/>
23
    <xsl:variable name="OPACURLOpenInNewWindow" select="marc:sysprefs/marc:syspref[@name='OPACURLOpenInNewWindow']"/>
23
    <xsl:variable name="OPACURLOpenInNewWindow" select="marc:sysprefs/marc:syspref[@name='OPACURLOpenInNewWindow']"/>
24
    <xsl:variable name="URLLinkText" select="marc:sysprefs/marc:syspref[@name='URLLinkText']"/>
24
    <xsl:variable name="URLLinkText" select="marc:sysprefs/marc:syspref[@name='URLLinkText']"/>
25
    <xsl:variable name="Show856uAsImage" select="marc:sysprefs/marc:syspref[@name='Display856uAsImage']"/>
25
        <xsl:variable name="leader" select="marc:leader"/>
26
        <xsl:variable name="leader" select="marc:leader"/>
26
        <xsl:variable name="leader6" select="substring($leader,7,1)"/>
27
        <xsl:variable name="leader6" select="substring($leader,7,1)"/>
27
        <xsl:variable name="leader7" select="substring($leader,8,1)"/>
28
        <xsl:variable name="leader7" select="substring($leader,8,1)"/>
Lines 905-910 Link Here
905
                            <xsl:for-each select="marc:datafield[@tag=856]">
906
                            <xsl:for-each select="marc:datafield[@tag=856]">
906
                            <xsl:if test="$OPACURLOpenInNewWindow='0'">
907
                            <xsl:if test="$OPACURLOpenInNewWindow='0'">
907
                                   <a><xsl:attribute name="href"><xsl:value-of select="marc:subfield[@code='u']"/></xsl:attribute>
908
                                   <a><xsl:attribute name="href"><xsl:value-of select="marc:subfield[@code='u']"/></xsl:attribute>
909
                                   <xsl:if test="$Show856uAsImage='Results' or $Show856uAsImage='Both'">
910
                                      <xsl:element name="img"><xsl:attribute name="src"><xsl:value-of select="marc:subfield[@code='u']"/></xsl:attribute><xsl:attribute name="height">100</xsl:attribute></xsl:element>
911
                                   </xsl:if>
908
                                    <xsl:choose>
912
                                    <xsl:choose>
909
                                    <xsl:when test="marc:subfield[@code='y' or @code='3' or @code='z']">
913
                                    <xsl:when test="marc:subfield[@code='y' or @code='3' or @code='z']">
910
                                        <xsl:call-template name="subfieldSelect">                        
914
                                        <xsl:call-template name="subfieldSelect">                        
Lines 916-921 Link Here
916
					<xsl:when test="$URLLinkText!=''">
920
					<xsl:when test="$URLLinkText!=''">
917
						<xsl:value-of select="$URLLinkText"/>
921
						<xsl:value-of select="$URLLinkText"/>
918
					</xsl:when>
922
					</xsl:when>
923
					<xsl:when test="$Show856uAsImage='Results' or $Show856uAsImage='Both'">
924
             <xsl:text></xsl:text>
925
          </xsl:when>
919
					<xsl:otherwise>
926
					<xsl:otherwise>
920
						<xsl:text>Click here to access online</xsl:text>
927
						<xsl:text>Click here to access online</xsl:text>
921
					</xsl:otherwise>
928
					</xsl:otherwise>
Lines 926-931 Link Here
926
                              </xsl:if>
933
                              </xsl:if>
927
                            <xsl:if test="$OPACURLOpenInNewWindow='1'">
934
                            <xsl:if test="$OPACURLOpenInNewWindow='1'">
928
                                   <a target='_blank'><xsl:attribute name="href"><xsl:value-of select="marc:subfield[@code='u']"/></xsl:attribute>
935
                                   <a target='_blank'><xsl:attribute name="href"><xsl:value-of select="marc:subfield[@code='u']"/></xsl:attribute>
936
                                   <xsl:if test="$Show856uAsImage='Results' or $Show856uAsImage='Both'">
937
                                      <xsl:element name="img"><xsl:attribute name="src"><xsl:value-of select="marc:subfield[@code='u']"/></xsl:attribute><xsl:attribute name="height">100</xsl:attribute></xsl:element>
938
                                   </xsl:if>                               
929
                                    <xsl:choose>
939
                                    <xsl:choose>
930
                                    <xsl:when test="marc:subfield[@code='y' or @code='3' or @code='z']">
940
                                    <xsl:when test="marc:subfield[@code='y' or @code='3' or @code='z']">
931
                                        <xsl:call-template name="subfieldSelect">                        
941
                                        <xsl:call-template name="subfieldSelect">                        
Lines 937-942 Link Here
937
					<xsl:when test="$URLLinkText!=''">
947
					<xsl:when test="$URLLinkText!=''">
938
						<xsl:value-of select="$URLLinkText"/>
948
						<xsl:value-of select="$URLLinkText"/>
939
					</xsl:when>
949
					</xsl:when>
950
					<xsl:when test="$Show856uAsImage='Results' or $Show856uAsImage='Both'">
951
             <xsl:text></xsl:text>
952
          </xsl:when>
940
					<xsl:otherwise>
953
					<xsl:otherwise>
941
						<xsl:text>Click here to access online</xsl:text>
954
						<xsl:text>Click here to access online</xsl:text>
942
					</xsl:otherwise>
955
					</xsl:otherwise>
943
- 

Return to bug 5738