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

(-)a/C4/XSLT.pm (-2 / +2 lines)
Lines 245-255 sub XSLTParse4Display { Link Here
245
    # Check if we should add extra content based on system preference
245
    # Check if we should add extra content based on system preference
246
    if ( C4::Context->preference('ExtraContentForXSLTDisplay') ) {
246
    if ( C4::Context->preference('ExtraContentForXSLTDisplay') ) {
247
247
248
        my $scrubber               = C4::Scrubber->new();
248
        my $scrubber               = C4::Scrubber->new('staff');
249
        my $extracontentvalue      = C4::Context->preference('ExtraContentForXSLTDisplay');
249
        my $extracontentvalue      = C4::Context->preference('ExtraContentForXSLTDisplay');
250
        my $extracontentproccessed = process_tt( $extracontentvalue, { record => $record } );
250
        my $extracontentproccessed = process_tt( $extracontentvalue, { record => $record } );
251
        my $cleanxml               = $scrubber->scrub($extracontentproccessed);
251
        my $cleanxml               = $scrubber->scrub($extracontentproccessed);
252
        $extracontentxml = "<extracontent><content>" . $cleanxml . "</content></extracontent>";
252
        $extracontentxml = qq{<extracontent><content>$cleanxml</content></extracontent>};
253
    }
253
    }
254
254
255
    # embed variables
255
    # embed variables
(-)a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl (-4 / +36 lines)
Lines 14-20 Link Here
14
    <xsl:template match="/">
14
    <xsl:template match="/">
15
            <xsl:apply-templates/>
15
            <xsl:apply-templates/>
16
    </xsl:template>
16
    </xsl:template>
17
17
    <!-- Template for adding custom content from ExtraContentForXSLTDisplay and preserving HTML and TT from the preference -->
18
    <xsl:template match="marc:extracontent//node()">
19
      <xsl:choose>
20
        <xsl:when test="self::text() or self::comment()">
21
          <xsl:value-of select="."/>
22
        </xsl:when>
23
        <xsl:otherwise>
24
          <xsl:element name="{local-name()}">
25
            <xsl:for-each select="@*">
26
              <xsl:attribute name="{name()}">
27
                <xsl:value-of select="."/>
28
              </xsl:attribute>
29
            </xsl:for-each>
30
            <xsl:apply-templates select="node()"/>
31
          </xsl:element>
32
        </xsl:otherwise>
33
      </xsl:choose>
34
    </xsl:template>
18
    <xsl:template match="marc:record">
35
    <xsl:template match="marc:record">
19
36
20
        <!-- Option: Display Alternate Graphic Representation (MARC 880)  -->
37
        <!-- Option: Display Alternate Graphic Representation (MARC 880)  -->
Lines 1568-1577 Link Here
1568
        </xsl:for-each>
1585
        </xsl:for-each>
1569
        </span>
1586
        </span>
1570
        </xsl:if>
1587
        </xsl:if>
1571
        <xsl:if test="marc:extracontent and normalize-space(string(marc:extracontent/marc:content)) != ''">
1572
            <xsl:copy-of select="marc:extracontent/marc:content/node()"/>
1573
        </xsl:if>
1574
1588
1589
        <!-- Process custom fields from  ExtraContentForXSLTDisplay system preference -->
1590
        <xsl:for-each select="marc:extracontent/marc:content/node()">
1591
          <xsl:choose>
1592
            <xsl:when test="self::text() or self::comment()">
1593
              <xsl:value-of select="."/>
1594
            </xsl:when>
1595
            <xsl:otherwise>
1596
              <xsl:element name="{local-name()}">
1597
                <xsl:for-each select="@*">
1598
                  <xsl:attribute name="{name()}">
1599
                    <xsl:value-of select="."/>
1600
                  </xsl:attribute>
1601
                </xsl:for-each>
1602
                <xsl:apply-templates select="node()"/>
1603
              </xsl:element>
1604
            </xsl:otherwise>
1605
          </xsl:choose>
1606
        </xsl:for-each>
1575
1607
1576
        <!-- Indicate if record is suppressed in OPAC -->
1608
        <!-- Indicate if record is suppressed in OPAC -->
1577
        <xsl:choose>
1609
        <xsl:choose>
(-)a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetResults.xsl (-4 / +36 lines)
Lines 12-17 Link Here
12
    <xsl:template match="/">
12
    <xsl:template match="/">
13
            <xsl:apply-templates/>
13
            <xsl:apply-templates/>
14
    </xsl:template>
14
    </xsl:template>
15
    <!-- Template for adding custom content from ExtraContentForXSLTDisplay and preserving HTML and TT from the preference -->
16
    <xsl:template match="marc:extracontent//node()">
17
      <xsl:choose>
18
        <xsl:when test="self::text() or self::comment()">
19
          <xsl:value-of select="."/>
20
        </xsl:when>
21
        <xsl:otherwise>
22
          <xsl:element name="{local-name()}">
23
            <xsl:for-each select="@*">
24
              <xsl:attribute name="{name()}">
25
                <xsl:value-of select="."/>
26
              </xsl:attribute>
27
            </xsl:for-each>
28
            <xsl:apply-templates select="node()"/>
29
          </xsl:element>
30
        </xsl:otherwise>
31
      </xsl:choose>
32
    </xsl:template>
15
    <xsl:template match="marc:record">
33
    <xsl:template match="marc:record">
16
34
17
        <!-- Option: Display Alternate Graphic Representation (MARC 880)  -->
35
        <!-- Option: Display Alternate Graphic Representation (MARC 880)  -->
Lines 1021-1029 Link Here
1021
        </span>
1039
        </span>
1022
        </xsl:if>
1040
        </xsl:if>
1023
    </xsl:if>
1041
    </xsl:if>
1024
    <xsl:if test="marc:extracontent and normalize-space(string(marc:extracontent/marc:content)) != ''">
1042
    <!-- Process custom fields from  ExtraContentForXSLTDisplay system preference -->
1025
        <xsl:copy-of select="marc:extracontent/marc:content/node()"/>
1043
    <xsl:for-each select="marc:extracontent/marc:content/node()">
1026
    </xsl:if>
1044
      <xsl:choose>
1045
        <xsl:when test="self::text() or self::comment()">
1046
          <xsl:value-of select="."/>
1047
        </xsl:when>
1048
        <xsl:otherwise>
1049
          <xsl:element name="{local-name()}">
1050
            <xsl:for-each select="@*">
1051
              <xsl:attribute name="{name()}">
1052
                <xsl:value-of select="."/>
1053
              </xsl:attribute>
1054
            </xsl:for-each>
1055
            <xsl:apply-templates select="node()"/>
1056
          </xsl:element>
1057
        </xsl:otherwise>
1058
      </xsl:choose>
1059
    </xsl:for-each>
1027
1060
1028
    <!-- Content Warning -->
1061
    <!-- Content Warning -->
1029
    <xsl:variable name="ContentWarningField" select="marc:sysprefs/marc:syspref[@name='ContentWarningField']"/>
1062
    <xsl:variable name="ContentWarningField" select="marc:sysprefs/marc:syspref[@name='ContentWarningField']"/>
1030
- 

Return to bug 39860