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

(-)a/koha-tmpl/opac-tmpl/prog/en/xslt/UNIMARCslim2OPACDetail.xsl (-34 / +99 lines)
Lines 15-59 Link Here
15
</xsl:template>
15
</xsl:template>
16
16
17
<xsl:template match="marc:record">
17
<xsl:template match="marc:record">
18
  <xsl:variable name="Show856uAsImage" select="marc:sysprefs/marc:syspref[@name='OPACDisplay856uAsImage']"/>
19
  <xsl:variable name="leader" select="marc:leader"/>
18
  <xsl:variable name="leader" select="marc:leader"/>
20
  <xsl:variable name="leader6" select="substring($leader,7,1)"/>
19
  <xsl:variable name="leader6" select="substring($leader,7,1)"/>
21
  <xsl:variable name="leader7" select="substring($leader,8,1)"/>
20
  <xsl:variable name="leader7" select="substring($leader,8,1)"/>
22
  <xsl:variable name="biblionumber" select="marc:datafield[@tag=090]/marc:subfield[@code='a']"/>
21
  <xsl:variable name="biblionumber" select="marc:datafield[@tag=090]/marc:subfield[@code='a']"/>
23
22
  <xsl:variable name="DisplayOPACiconsXSLT" select="marc:sysprefs/marc:syspref[@name='DisplayOPACiconsXSLT']"    />
23
  <xsl:variable name="OPACURLOpenInNewWindow" select="marc:sysprefs/marc:syspref[@name='OPACURLOpenInNewWindo    w']"/>
24
  <xsl:variable name="URLLinkText" select="marc:sysprefs/marc:syspref[@name='URLLinkText']"/>
25
  <xsl:variable name="ShowISBD" select="marc:sysprefs/marc:syspref[@name='viewISBD']"/>
24
26
25
  <xsl:if test="marc:datafield[@tag=200]">
27
  <xsl:if test="marc:datafield[@tag=200]">
26
    <xsl:for-each select="marc:datafield[@tag=200]">
28
    <xsl:for-each select="marc:datafield[@tag=200]">
27
      <h1>
29
      <h1>
28
        <xsl:call-template name="addClassRtl" />
30
        <xsl:call-template name="addClassRtl" />
29
        <xsl:variable name="title" select="marc:subfield[@code='a']"/>
31
        <xsl:for-each select="marc:subfield">
30
        <xsl:variable name="ntitle"
32
          <xsl:choose>
31
         select="translate($title, '&#x0098;&#x009C;','')"/>
33
            <xsl:when test="@code='a'">
32
        <xsl:value-of select="$ntitle" />
34
              <xsl:variable name="title" select="."/>
33
        <xsl:if test="marc:subfield[@code='e']">
35
              <xsl:variable name="ntitle"
34
          <xsl:text> : </xsl:text>
36
               select="translate($title, '&#x0088;&#x0089;&#x0098;&#x009C;','')"/>
35
          <xsl:for-each select="marc:subfield[@code='e']">
37
              <xsl:value-of select="$ntitle" />
36
            <xsl:value-of select="."/>
38
            </xsl:when>
37
          </xsl:for-each>
39
            <xsl:when test="@code='b'">
38
        </xsl:if>
40
              <xsl:text> [</xsl:text>
39
        <xsl:if test="marc:subfield[@code='b']">
41
              <xsl:value-of select="."/>
40
          <xsl:text> [</xsl:text>
42
              <xsl:text>]</xsl:text>
41
          <xsl:value-of select="marc:subfield[@code='b']"/>
43
            </xsl:when>
42
          <xsl:text>]</xsl:text>
44
            <xsl:when test="@code='d'">
43
        </xsl:if>
45
              <xsl:text> = </xsl:text>
44
        <xsl:if test="marc:subfield[@code='f']">
46
              <xsl:value-of select="."/>
45
          <xsl:text> / </xsl:text>
47
            </xsl:when>
46
          <xsl:value-of select="marc:subfield[@code='f']"/>
48
            <xsl:when test="@code='e'">
47
        </xsl:if>
49
              <xsl:text> : </xsl:text>
48
        <xsl:if test="marc:subfield[@code='g']">
50
              <xsl:value-of select="."/>
49
          <xsl:text> ; </xsl:text>
51
            </xsl:when>
50
          <xsl:value-of select="marc:subfield[@code='g']"/>
52
            <xsl:when test="@code='f'">
51
        </xsl:if>
53
              <xsl:text> / </xsl:text>
54
              <xsl:value-of select="."/>
55
            </xsl:when>
56
            <xsl:when test="@code='g'">
57
              <xsl:text> ; </xsl:text>
58
              <xsl:value-of select="."/>
59
            </xsl:when>
60
            <xsl:otherwise>
61
              <xsl:text>, </xsl:text>
62
              <xsl:value-of select="."/>
63
            </xsl:otherwise>
64
          </xsl:choose>
65
        </xsl:for-each>
52
      </h1>
66
      </h1>
53
    </xsl:for-each>
67
    </xsl:for-each>
54
  </xsl:if>
68
  </xsl:if>
55
69
56
  <xsl:call-template name="tag_4xx" />
70
  <div id="views">
71
    <span class="view">
72
      <span id="Normalview">Normal View</span>
73
    </span>
74
    <span class="view">
75
      <a id="MARCviewPop" href="/cgi-bin/koha/opac-showmarc.pl?id={marc:datafield[@tag=090]/marc:subfield[@code='a']}" title="MARC" rel="gb_page_center[600,500]">MARC View</a>
76
    </span>
77
    <span class="view">
78
      <a id="MARCview" href="/cgi-bin/koha/opac-MARCdetail.pl?biblionumber={marc:datafield[@tag=090]/marc:subfield[@code='a']}" title="MARC">Expanded MARC View</a>
79
    </span>
80
    <xsl:if test="$ShowISBD!='0'">
81
        <span class="view">
82
          <a id="ISBDview" href="/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber={marc:datafield[@tag=090]/marc:subfield[@code='a']}">Card View (ISBD)</a>
83
        </span>
84
    </xsl:if>
85
  </div>
86
87
  <xsl:call-template name="tag_title">
88
    <xsl:with-param name="tag">454</xsl:with-param>
89
    <xsl:with-param name="label">Translation of</xsl:with-param>
90
  </xsl:call-template>
91
92
  <xsl:call-template name="tag_title">
93
    <xsl:with-param name="tag">461</xsl:with-param>
94
    <xsl:with-param name="label">Set Level</xsl:with-param>
95
  </xsl:call-template>
96
97
  <xsl:call-template name="tag_title">
98
    <xsl:with-param name="tag">464</xsl:with-param>
99
    <xsl:with-param name="label">Piece-Analytic Level</xsl:with-param>
100
  </xsl:call-template>
57
101
58
  <xsl:call-template name="tag_7xx">
102
  <xsl:call-template name="tag_7xx">
59
    <xsl:with-param name="tag">700</xsl:with-param>
103
    <xsl:with-param name="tag">700</xsl:with-param>
Lines 85-93 Link Here
85
    <xsl:with-param name="label">Corporate Author (Secondary)</xsl:with-param>
129
    <xsl:with-param name="label">Corporate Author (Secondary)</xsl:with-param>
86
  </xsl:call-template>
130
  </xsl:call-template>
87
131
132
  <xsl:call-template name="tag_title">
133
    <xsl:with-param name="tag">500</xsl:with-param>
134
    <xsl:with-param name="label">Uniform Title</xsl:with-param>
135
  </xsl:call-template>
136
137
  <xsl:call-template name="tag_title">
138
    <xsl:with-param name="tag">503</xsl:with-param>
139
    <xsl:with-param name="label">Uniform Conventional Heading</xsl:with-param>
140
  </xsl:call-template>
141
88
  <xsl:if test="marc:datafield[@tag=101]">
142
  <xsl:if test="marc:datafield[@tag=101]">
89
	  <span class="results_summary">
143
    <span class="results_summary">
90
      <span class="label">Language: </span>
144
      <span class="label">Language:</span>
91
      <xsl:for-each select="marc:datafield[@tag=101]">
145
      <xsl:for-each select="marc:datafield[@tag=101]">
92
        <xsl:for-each select="marc:subfield">
146
        <xsl:for-each select="marc:subfield">
93
          <xsl:choose>
147
          <xsl:choose>
Lines 133-138 Link Here
133
    </span>
187
    </span>
134
  </xsl:if>
188
  </xsl:if>
135
189
190
  <xsl:call-template name="tag_comma">
191
    <xsl:with-param name="tag">205</xsl:with-param>
192
    <xsl:with-param name="label">Edition Statement</xsl:with-param>
193
  </xsl:call-template>
194
136
  <xsl:call-template name="tag_210" />
195
  <xsl:call-template name="tag_210" />
137
196
138
  <xsl:call-template name="tag_215" />
197
  <xsl:call-template name="tag_215" />
Lines 350-373 Link Here
350
409
351
  <xsl:if test="marc:datafield[@tag=856]">
410
  <xsl:if test="marc:datafield[@tag=856]">
352
    <span class="results_summary">
411
    <span class="results_summary">
353
      <span class="label">Online Resources: </span>
412
      <span class="label">Online Resources:</span>
354
      <xsl:for-each select="marc:datafield[@tag=856]">
413
      <xsl:for-each select="marc:datafield[@tag=856]">
355
        <xsl:variable name="SubqText"><xsl:value-of select="marc:subfield[@code='q']"/></xsl:variable>
356
        <a>
414
        <a>
357
          <xsl:attribute name="href">
415
          <xsl:attribute name="href">
358
            <xsl:value-of select="marc:subfield[@code='u']"/>
416
            <xsl:value-of select="marc:subfield[@code='u']"/>
359
          </xsl:attribute>
417
          </xsl:attribute>
418
          <xsl:if test="$OPACURLOpenInNewWindow='1'">
419
            <xsl:attribute name="target">_blank</xsl:attribute>
420
          </xsl:if>
360
          <xsl:choose>
421
          <xsl:choose>
361
            <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')">
362
              <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="height">100</xsl:attribute></xsl:element><xsl:text></xsl:text>
363
            </xsl:when>
364
            <xsl:when test="marc:subfield[@code='y' or @code='3' or @code='z']">
422
            <xsl:when test="marc:subfield[@code='y' or @code='3' or @code='z']">
365
              <xsl:call-template name="subfieldSelect">
423
              <xsl:call-template name="subfieldSelect">
366
                <xsl:with-param name="codes">y3z</xsl:with-param>
424
                <xsl:with-param name="codes">y3z</xsl:with-param>
367
              </xsl:call-template>
425
              </xsl:call-template>
368
            </xsl:when>
426
            </xsl:when>
369
            <xsl:when test="not(marc:subfield[@code='y']) and not(marc:subfield[@code='3']) and not(marc:subfield[@code='z'])">
427
            <xsl:when test="not(marc:subfield[@code='y']) and not(marc:subfield[@code='3']) and not(marc:subfield[@code='z'])">
370
              Click here to access online
428
              <xsl:choose>
429
                <xsl:when test="$URLLinkText!=''">
430
                  <xsl:value-of select="$URLLinkText"/>
431
                </xsl:when>
432
                <xsl:otherwise>
433
                  <xsl:text>Click here to access online</xsl:text>
434
                </xsl:otherwise>
435
              </xsl:choose>
371
            </xsl:when>
436
            </xsl:when>
372
          </xsl:choose>
437
          </xsl:choose>
373
        </a>
438
        </a>
(-)a/koha-tmpl/opac-tmpl/prog/en/xslt/UNIMARCslim2OPACResults.xsl (-36 / +54 lines)
Lines 18-24 Link Here
18
</xsl:template>
18
</xsl:template>
19
19
20
<xsl:template match="marc:record">
20
<xsl:template match="marc:record">
21
  <xsl:variable name="Show856uAsImage" select="marc:sysprefs/marc:syspref[@name='OPACDisplay856uAsImage']"/>
22
  <xsl:variable name="leader" select="marc:leader"/>
21
  <xsl:variable name="leader" select="marc:leader"/>
23
  <xsl:variable name="leader6" select="substring($leader,7,1)"/>
22
  <xsl:variable name="leader6" select="substring($leader,7,1)"/>
24
  <xsl:variable name="leader7" select="substring($leader,8,1)"/>
23
  <xsl:variable name="leader7" select="substring($leader,8,1)"/>
Lines 31-72 Link Here
31
30
32
  <xsl:if test="marc:datafield[@tag=200]">
31
  <xsl:if test="marc:datafield[@tag=200]">
33
    <xsl:for-each select="marc:datafield[@tag=200]">
32
    <xsl:for-each select="marc:datafield[@tag=200]">
34
      <xsl:variable name="title" select="marc:subfield[@code='a']"/>
35
      <xsl:variable name="ntitle"
36
       select="translate($title, '&#x0098;&#x009C;','')"/>
37
      <div>
38
        <xsl:call-template name="addClassRtl" />
33
        <xsl:call-template name="addClassRtl" />
39
        <span class="results_summary">
34
        <xsl:for-each select="marc:subfield">
40
          <span class="label"/>
35
          <xsl:choose>
41
          <a>
36
            <xsl:when test="@code='a'">
42
            <xsl:attribute name="href">/cgi-bin/koha/opac-detail.pl?biblionumber=<xsl:value-of select="$biblionumber"/></xsl:attribute>
37
              <xsl:variable name="title" select="."/>
43
            <xsl:value-of select="$ntitle" />
38
              <xsl:variable name="ntitle"
44
          </a>
39
                select="translate($title, '&#x0088;&#x0089;&#x0098;&#x009C;','')"/>
45
          <xsl:if test="marc:subfield[@code='e']">
40
              <a>
46
            <xsl:text> : </xsl:text>
41
                <xsl:attribute name="href">
47
            <xsl:for-each select="marc:subfield[@code='e']">
42
                  <xsl:text>/cgi-bin/koha/opac-detail.pl?biblionumber=</xsl:text>
43
                  <xsl:value-of select="$biblionumber"/>
44
                </xsl:attribute>
45
                <xsl:value-of select="$ntitle" />
46
              </a>
47
            </xsl:when>
48
            <xsl:when test="@code='b'">
49
              <xsl:text> [</xsl:text>
48
              <xsl:value-of select="."/>
50
              <xsl:value-of select="."/>
49
            </xsl:for-each>
51
              <xsl:text>]</xsl:text>
50
          </xsl:if>
52
            </xsl:when>
51
          <xsl:if test="marc:subfield[@code='b']">
53
            <xsl:when test="@code='d'">
52
            <xsl:text> [</xsl:text>
54
              <xsl:text> = </xsl:text>
53
            <xsl:value-of select="marc:subfield[@code='b']"/>
55
              <xsl:value-of select="."/>
54
            <xsl:text>]</xsl:text>
56
            </xsl:when>
55
          </xsl:if>
57
            <xsl:when test="@code='e'">
56
          <xsl:if test="marc:subfield[@code='f']">
58
              <xsl:text> : </xsl:text>
57
            <xsl:text> / </xsl:text>
59
              <xsl:value-of select="."/>
58
            <xsl:value-of select="marc:subfield[@code='f']"/>
60
            </xsl:when>
59
          </xsl:if>
61
            <xsl:when test="@code='f'">
60
          <xsl:if test="marc:subfield[@code='g']">
62
              <xsl:text> / </xsl:text>
61
            <xsl:text> ; </xsl:text>
63
              <xsl:value-of select="."/>
62
            <xsl:value-of select="marc:subfield[@code='g']"/>
64
            </xsl:when>
63
          </xsl:if>
65
            <xsl:when test="@code='g'">
64
        </span>
66
              <xsl:text> ; </xsl:text>
65
      </div>
67
              <xsl:value-of select="."/>
68
            </xsl:when>
69
            <xsl:otherwise>
70
              <xsl:text>, </xsl:text>
71
              <xsl:value-of select="."/>
72
            </xsl:otherwise>
73
          </xsl:choose>
74
        </xsl:for-each>
66
    </xsl:for-each>
75
    </xsl:for-each>
67
  </xsl:if>
76
  </xsl:if>
68
77
69
  <xsl:call-template name="tag_4xx" />
78
  <xsl:call-template name="tag_title">
79
    <xsl:with-param name="tag">454</xsl:with-param>
80
    <xsl:with-param name="label">Translation of</xsl:with-param>
81
  </xsl:call-template>
82
  
83
  <xsl:call-template name="tag_title">
84
    <xsl:with-param name="tag">461</xsl:with-param>
85
    <xsl:with-param name="label">Set Level</xsl:with-param>
86
  </xsl:call-template>
87
88
  <xsl:call-template name="tag_title">
89
    <xsl:with-param name="tag">464</xsl:with-param>
90
    <xsl:with-param name="label">Piece-Analytic Level</xsl:with-param>
91
  </xsl:call-template>
70
92
71
  <xsl:call-template name="tag_210" />
93
  <xsl:call-template name="tag_210" />
72
94
Lines 77-83 Link Here
77
    <xsl:choose>
99
    <xsl:choose>
78
      <xsl:when test="marc:datafield[@tag=856]">
100
      <xsl:when test="marc:datafield[@tag=856]">
79
        <xsl:for-each select="marc:datafield[@tag=856]">
101
        <xsl:for-each select="marc:datafield[@tag=856]">
80
        <xsl:variable name="SubqText"><xsl:value-of select="marc:subfield[@code='q']"/></xsl:variable>
81
          <xsl:choose>
102
          <xsl:choose>
82
            <xsl:when test="@ind2=0">
103
            <xsl:when test="@ind2=0">
83
              <a>
104
              <a>
Lines 85-93 Link Here
85
                  <xsl:value-of select="marc:subfield[@code='u']"/>
106
                  <xsl:value-of select="marc:subfield[@code='u']"/>
86
                </xsl:attribute>
107
                </xsl:attribute>
87
                <xsl:choose>
108
                <xsl:choose>
88
                  <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')">
89
                     <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="height">100</xsl:attribute></xsl:element><xsl:text></xsl:text>
90
                  </xsl:when>
91
                  <xsl:when test="marc:subfield[@code='y' or @code='3' or @code='z']">
109
                  <xsl:when test="marc:subfield[@code='y' or @code='3' or @code='z']">
92
                    <xsl:call-template name="subfieldSelect">                        
110
                    <xsl:call-template name="subfieldSelect">                        
93
                      <xsl:with-param name="codes">y3z</xsl:with-param>                    
111
                      <xsl:with-param name="codes">y3z</xsl:with-param>                    
(-)a/koha-tmpl/opac-tmpl/prog/en/xslt/UNIMARCslimUtils.xsl (-214 / +262 lines)
Lines 2-8 Link Here
2
2
3
<!DOCTYPE stylesheet [<!ENTITY nbsp "&#160;" >]>
3
<!DOCTYPE stylesheet [<!ENTITY nbsp "&#160;" >]>
4
4
5
<xsl:stylesheet version="1.0" xmlns:marc="http://www.loc.gov/MARC21/slim" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
5
<xsl:stylesheet version="1.0"
6
  xmlns:marc="http://www.loc.gov/MARC21/slim"
7
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
8
  exclude-result-prefixes="marc items">
6
9
7
  <xsl:template name="datafield">
10
  <xsl:template name="datafield">
8
    <xsl:param name="tag"/>
11
    <xsl:param name="tag"/>
Lines 23-59 Link Here
23
    </xsl:element>
26
    </xsl:element>
24
  </xsl:template>
27
  </xsl:template>
25
28
29
  <xsl:template name="subfieldSelect">
30
    <xsl:param name="codes"/>
31
    <xsl:param name="delimeter"><xsl:text> </xsl:text></xsl:param>
32
    <xsl:param name="subdivCodes"/>
33
    <xsl:param name="subdivDelimiter"/>
34
    <xsl:variable name="str">
35
      <xsl:for-each select="marc:subfield">
36
        <xsl:if test="contains($codes, @code)">
37
          <xsl:if test="contains($subdivCodes, @code)">
38
            <xsl:value-of select="$subdivDelimiter"/>
39
          </xsl:if>
40
          <xsl:value-of select="text()"/><xsl:value-of select="$delimeter"/>
41
        </xsl:if>
42
      </xsl:for-each>
43
    </xsl:variable>
44
    <xsl:value-of select="substring($str,1,string-length($str)-string-length($delimeter))"/>
45
  </xsl:template>
46
47
  <xsl:template name="buildSpaces">
48
    <xsl:param name="spaces"/>
49
    <xsl:param name="char"><xsl:text> </xsl:text></xsl:param>
50
    <xsl:if test="$spaces>0">
51
      <xsl:value-of select="$char"/>
52
      <xsl:call-template name="buildSpaces">
53
        <xsl:with-param name="spaces" select="$spaces - 1"/>
54
        <xsl:with-param name="char" select="$char"/>
55
      </xsl:call-template>
56
    </xsl:if>
57
  </xsl:template>
58
59
  <xsl:template name="chopPunctuation">
60
    <xsl:param name="chopString"/>
61
    <xsl:variable name="length" select="string-length($chopString)"/>
62
    <xsl:choose>
63
      <xsl:when test="$length=0"/>
64
      <xsl:when test="contains('.:,;/ ', substring($chopString,$length,1))">
65
        <xsl:call-template name="chopPunctuation">
66
          <xsl:with-param name="chopString" select="substring($chopString,1,$length - 1)"/>
67
        </xsl:call-template>
68
      </xsl:when>
69
      <xsl:when test="not($chopString)"/>
70
      <xsl:otherwise><xsl:value-of select="$chopString"/></xsl:otherwise>
71
    </xsl:choose>
72
    <xsl:text> </xsl:text>
73
  </xsl:template>
74
75
  <xsl:template name="addClassRtl">
76
    <xsl:variable name="lang" select="marc:subfield[@code='7']" />
77
    <xsl:if test="$lang = 'ha' or $lang = 'Hebrew' or $lang = 'fa' or $lang = 'Arabe'">
78
      <xsl:attribute name="class">rtl</xsl:attribute>
79
    </xsl:if>
80
  </xsl:template>
81
82
  <xsl:template name="tag_title">
83
    <xsl:param name="tag" />
84
    <xsl:param name="label" />
85
    <xsl:if test="marc:datafield[@tag=$tag]">
86
      <span class="results_summary">
87
        <span class="label">
88
        <xsl:value-of select="$label"/>: </span>
89
        <xsl:for-each select="marc:datafield[@tag=$tag]">
90
          <xsl:call-template name="addClassRtl" />
91
          <xsl:for-each select="marc:subfield">
92
            <xsl:choose>
93
              <xsl:when test="@code='a'">
94
                <xsl:variable name="title" select="."/>
95
                <xsl:variable name="ntitle"
96
                 select="translate($title, '&#x0088;&#x0089;&#x0098;&#x009C;','')"/>
97
                <xsl:value-of select="$ntitle" />
98
              </xsl:when>
99
              <xsl:when test="@code='b'">
100
                <xsl:text>[</xsl:text>
101
                <xsl:value-of select="."/>
102
                <xsl:text>]</xsl:text>
103
              </xsl:when>
104
              <xsl:when test="@code='d'">
105
                <xsl:text> = </xsl:text>
106
                <xsl:value-of select="."/>
107
              </xsl:when>
108
              <xsl:when test="@code='e'">
109
                <xsl:text> : </xsl:text>
110
                <xsl:value-of select="."/>
111
              </xsl:when>
112
              <xsl:when test="@code='f'">
113
                <xsl:text> / </xsl:text>
114
                <xsl:value-of select="."/>
115
              </xsl:when>
116
              <xsl:when test="@code='g'">
117
                <xsl:text> ; </xsl:text>
118
                <xsl:value-of select="."/>
119
              </xsl:when>
120
              <xsl:otherwise>
121
                <xsl:if test="position()>1">
122
                  <xsl:text>, </xsl:text>
123
                </xsl:if>
124
                <xsl:value-of select="."/>
125
              </xsl:otherwise>
126
            </xsl:choose>
127
          </xsl:for-each>
128
          <xsl:if test="not (position() = last())">
129
            <xsl:text> • </xsl:text>
130
          </xsl:if>
131
        </xsl:for-each>
132
      </span>
133
    </xsl:if>
134
  </xsl:template>
135
136
  <xsl:template name="tag_comma">
137
    <xsl:param name="tag" />
138
    <xsl:param name="label" />
139
    <xsl:if test="marc:datafield[@tag=$tag]">
140
      <span class="results_summary">
141
        <span class="label">
142
        <xsl:value-of select="$label"/>: </span>
143
        <xsl:for-each select="marc:datafield[@tag=$tag]">
144
          <xsl:call-template name="addClassRtl" />
145
          <xsl:for-each select="marc:subfield">
146
            <xsl:if test="position()>1">
147
              <xsl:text>, </xsl:text>
148
            </xsl:if>
149
            <xsl:value-of select="."/>
150
          </xsl:for-each>
151
          <xsl:if test="not (position() = last())">
152
            <xsl:text> • </xsl:text>
153
          </xsl:if>
154
        </xsl:for-each>
155
      </span>
156
    </xsl:if>
157
  </xsl:template>
158
26
  <xsl:template name="tag_210">
159
  <xsl:template name="tag_210">
27
    <span class="results_summary">
160
    <span class="results_summary">
28
      <span class="label">Publication: </span>
161
      <span class="label">Publication:</span>
29
      <xsl:for-each select="marc:datafield[@tag=210]">
162
      <xsl:for-each select="marc:datafield[@tag=210]">
30
        <span>
163
        <span>
31
          <xsl:call-template name="addClassRtl" />
164
          <xsl:call-template name="addClassRtl" />
32
          <xsl:value-of select="marc:subfield[@code='a']"/>
165
          <xsl:for-each select="marc:subfield">
33
          <xsl:if test="marc:subfield[@code='b']">
166
            <xsl:choose>
34
            <xsl:if test="marc:subfield[@code='a']">, </xsl:if>
167
              <xsl:when test="@code='c' or @code='g'">
35
            <xsl:value-of select="marc:subfield[@code='b']"/>
168
                <xsl:if test="position()>1">
36
          </xsl:if>
169
                  <xsl:text> : </xsl:text>
37
          <xsl:if test="marc:subfield[@code='a' or @code='b']">
170
                </xsl:if>
38
            <xsl:if test="marc:subfield[@code='a']"> : </xsl:if>
171
                <xsl:value-of select="."/>
39
            <xsl:value-of select="marc:subfield[@code='c']"/>
172
              </xsl:when>
40
          </xsl:if>
173
              <xsl:otherwise>
41
          <xsl:if test="marc:subfield[@code='d']">
174
                <xsl:if test="position()>1">
42
            <xsl:if test="marc:subfield[@code='a' or @code='c']">, </xsl:if>
175
                  <xsl:text>, </xsl:text>
43
            <xsl:value-of select="marc:subfield[@code='d']"/>
176
                </xsl:if>
44
          </xsl:if>
177
                <xsl:value-of select="."/>
45
          <xsl:if test="marc:subfield[@code='e']">
178
              </xsl:otherwise>
46
            <xsl:if test="marc:subfield[@code='a' or @code='c' or @code='d']"> — </xsl:if>
179
            </xsl:choose>
47
            <xsl:value-of select="marc:subfield[@code='e']"/>
180
          </xsl:for-each>
48
          </xsl:if>
49
          <xsl:if test="marc:subfield[@code='g']">
50
            <xsl:if test="marc:subfield[@code='e']"> : </xsl:if>
51
            <xsl:value-of select="marc:subfield[@code='g']"/>
52
          </xsl:if>
53
          <xsl:if test="marc:subfield[@code='h']">
54
            <xsl:if test="marc:subfield[@code='e' or @code='g']">, </xsl:if>
55
            <xsl:value-of select="marc:subfield[@code='h']"/>
56
          </xsl:if>
57
          <xsl:if test="not (position() = last())">
181
          <xsl:if test="not (position() = last())">
58
            <xsl:text> • </xsl:text>
182
            <xsl:text> • </xsl:text>
59
          </xsl:if>
183
          </xsl:if>
Lines 62-68 Link Here
62
    </span>
186
    </span>
63
  </xsl:template>
187
  </xsl:template>
64
188
65
	<xsl:template name="tag_215">
189
  <xsl:template name="tag_215">
66
    <xsl:for-each select="marc:datafield[@tag=215]">
190
    <xsl:for-each select="marc:datafield[@tag=215]">
67
  	  <span class="results_summary">
191
  	  <span class="results_summary">
68
        <span class="label">Description: </span>
192
        <span class="label">Description: </span>
Lines 82-300 Link Here
82
    </xsl:for-each>
206
    </xsl:for-each>
83
  </xsl:template>
207
  </xsl:template>
84
208
85
	<xsl:template name="tag_4xx">
209
  <xsl:template name="tag_onesubject">
86
    <xsl:for-each select="marc:datafield[@tag=464 or @tag=461]">
210
    <xsl:choose>
87
    	  <span class="results_summary">
211
      <xsl:when test="marc:subfield[@code=9]">
88
        <span class="label">Linked with: </span>
212
        <xsl:for-each select="marc:subfield">
89
        <span>
213
          <xsl:if test="@code='9'">
90
          <xsl:call-template name="addClassRtl" />
214
            <xsl:variable name="start" select="position()"/>
91
          <xsl:if test="marc:subfield[@code='t']">
215
            <xsl:variable name="ends">
92
            <xsl:value-of select="marc:subfield[@code='t']"/>
216
              <xsl:for-each select="../marc:subfield[position() &gt; $start]">
93
          </xsl:if>
217
                <xsl:if test="@code=3 or @code=9 or @code=2">
94
          <xsl:if test="marc:subfield[@code='e']"> :
218
                  <xsl:variable name="end" select="position() + $start"/>
95
            <xsl:value-of select="marc:subfield[@code='e']"/>
219
                  <xsl:value-of select="$end"/>
96
          </xsl:if>
220
                  <xsl:text>,</xsl:text>
97
          <xsl:if test="marc:subfield[@code='f']"> /
221
                </xsl:if>
98
            <xsl:value-of select="marc:subfield[@code='f']"/>
222
              </xsl:for-each>
99
          </xsl:if>
223
            </xsl:variable>
100
          <xsl:if test="marc:subfield[@code='v']">,
224
            <xsl:variable name="end">
101
            <xsl:value-of select="marc:subfield[@code='v']"/>
225
              <xsl:choose>
102
          </xsl:if>
226
                <xsl:when test="string-length($ends) > 0">
103
        </span>
227
                  <xsl:value-of select="substring-before($ends,',')"/>
104
      </span>
228
                </xsl:when>
105
    </xsl:for-each>
229
                <xsl:otherwise>
106
  </xsl:template>
230
                  <xsl:text>1000</xsl:text>
107
231
                </xsl:otherwise>
108
	<xsl:template name="subfieldSelect">
232
              </xsl:choose>
109
		<xsl:param name="codes"/>
233
            </xsl:variable>
110
		<xsl:param name="delimeter"><xsl:text> </xsl:text></xsl:param>
234
            <xsl:variable name="display">
111
		<xsl:param name="subdivCodes"/>
235
              <xsl:for-each select="../marc:subfield[position() &gt; $start and position() &lt; $end]">
112
		<xsl:param name="subdivDelimiter"/>
236
                <xsl:value-of select="."/>
113
		<xsl:variable name="str">
237
                <xsl:if test="not(position()=last())">
114
			<xsl:for-each select="marc:subfield">
238
                  <xsl:text>, </xsl:text>
115
				<xsl:if test="contains($codes, @code)">
239
                </xsl:if>
116
                    <xsl:if test="contains($subdivCodes, @code)">
240
              </xsl:for-each>
117
                        <xsl:value-of select="$subdivDelimiter"/>
241
            </xsl:variable>
118
                    </xsl:if>
242
            <a>
119
					<xsl:value-of select="text()"/><xsl:value-of select="$delimeter"/>
243
              <xsl:attribute name="href">
120
				</xsl:if>
244
                <xsl:text>/cgi-bin/koha/opac-search.pl?q=an:</xsl:text>
121
			</xsl:for-each>
245
                <xsl:value-of select="."/>
122
		</xsl:variable>
246
              </xsl:attribute>
123
		<xsl:value-of select="substring($str,1,string-length($str)-string-length($delimeter))"/>
247
              <xsl:value-of select="$display"/>
124
	</xsl:template>
248
            </a>
125
249
            <xsl:variable name="ncommas"
126
	<xsl:template name="buildSpaces">
250
                 select="string-length($ends) - string-length(translate($ends, ',', ''))" />
127
		<xsl:param name="spaces"/>
251
            <xsl:if test="$ncommas &gt; 1">
128
		<xsl:param name="char"><xsl:text> </xsl:text></xsl:param>
252
              <xsl:text> -- </xsl:text>
129
		<xsl:if test="$spaces>0">
253
            </xsl:if>
130
			<xsl:value-of select="$char"/>
131
			<xsl:call-template name="buildSpaces">
132
				<xsl:with-param name="spaces" select="$spaces - 1"/>
133
				<xsl:with-param name="char" select="$char"/>
134
			</xsl:call-template>
135
		</xsl:if>
136
	</xsl:template>
137
138
	<xsl:template name="chopPunctuation">
139
		<xsl:param name="chopString"/>
140
		<xsl:variable name="length" select="string-length($chopString)"/>
141
		<xsl:choose>
142
			<xsl:when test="$length=0"/>
143
			<xsl:when test="contains('.:,;/ ', substring($chopString,$length,1))">
144
				<xsl:call-template name="chopPunctuation">
145
					<xsl:with-param name="chopString" select="substring($chopString,1,$length - 1)"/>
146
				</xsl:call-template>
147
			</xsl:when>
148
			<xsl:when test="not($chopString)"/>
149
			<xsl:otherwise><xsl:value-of select="$chopString"/></xsl:otherwise>
150
		</xsl:choose>
151
    <xsl:text> </xsl:text>
152
	</xsl:template>
153
154
	<xsl:template name="addClassRtl">
155
    <xsl:variable name="lang" select="marc:subfield[@code='7']" />
156
    <xsl:if test="$lang = 'ha' or $lang = 'Hebrew' or $lang = 'fa' or $lang = 'Arabe'">
157
      <xsl:attribute name="class">rtl</xsl:attribute>
158
    </xsl:if>
159
  </xsl:template>
160
161
  <xsl:template name="tag_title">
162
    <xsl:param name="tag" />
163
    <xsl:param name="label" />
164
    <xsl:if test="marc:datafield[@tag=$tag]">
165
      <span class="results_summary">
166
        <span class="label"><xsl:value-of select="$label"/>: </span>
167
        <xsl:for-each select="marc:datafield[@tag=$tag]">
168
          <xsl:value-of select="marc:subfield[@code='a']" />
169
          <xsl:if test="marc:subfield[@code='d']">
170
            <xsl:text> : </xsl:text>
171
            <xsl:value-of select="marc:subfield[@code='e']"/>
172
          </xsl:if>
173
          <xsl:if test="marc:subfield[@code='e']">
174
            <xsl:for-each select="marc:subfield[@code='e']">
175
              <xsl:text> </xsl:text>
176
              <xsl:value-of select="."/>
177
            </xsl:for-each>
178
          </xsl:if>
179
          <xsl:if test="marc:subfield[@code='f']">
180
            <xsl:text> / </xsl:text>
181
            <xsl:value-of select="marc:subfield[@code='f']"/>
182
          </xsl:if>
183
          <xsl:if test="marc:subfield[@code='h']">
184
            <xsl:text>, </xsl:text>
185
            <xsl:value-of select="marc:subfield[@code='h']"/>
186
          </xsl:if>
187
          <xsl:if test="marc:subfield[@code='i']">
188
            <xsl:text>, </xsl:text>
189
            <xsl:value-of select="marc:subfield[@code='i']"/>
190
          </xsl:if>
191
          <xsl:if test="marc:subfield[@code='v']">
192
            <xsl:text>, </xsl:text>
193
            <xsl:value-of select="marc:subfield[@code='v']"/>
194
          </xsl:if>
195
          <xsl:if test="marc:subfield[@code='x']">
196
            <xsl:text>, </xsl:text>
197
            <xsl:value-of select="marc:subfield[@code='x']"/>
198
          </xsl:if>
199
          <xsl:if test="marc:subfield[@code='z']">
200
            <xsl:text>, </xsl:text>
201
            <xsl:value-of select="marc:subfield[@code='z']"/>
202
          </xsl:if>
254
          </xsl:if>
203
        </xsl:for-each>
255
        </xsl:for-each>
204
      </span>
256
      </xsl:when>
257
      <xsl:otherwise>
258
        <a>
259
          <xsl:attribute name="href">
260
            <xsl:text>/cgi-bin/koha/opac-search.pl?q=su:</xsl:text>
261
            <xsl:value-of select="marc:subfield[@code='a']"/>
262
          </xsl:attribute>
263
          <xsl:call-template name="chopPunctuation">
264
            <xsl:with-param name="chopString">
265
              <xsl:call-template name="subfieldSelect">
266
                <xsl:with-param name="codes">abcdfijkmnpvxyz</xsl:with-param>
267
                <xsl:with-param name="subdivCodes">ijknpxyz</xsl:with-param>
268
                <xsl:with-param name="subdivDelimiter">-- </xsl:with-param>
269
              </xsl:call-template>
270
            </xsl:with-param>
271
          </xsl:call-template>
272
        </a>
273
      </xsl:otherwise>
274
    </xsl:choose>
275
    <xsl:if test="not(position()=last())">
276
      <xsl:text> | </xsl:text>
205
    </xsl:if>
277
    </xsl:if>
206
  </xsl:template>
278
  </xsl:template>
207
279
208
209
  <xsl:template name="tag_subject">
280
  <xsl:template name="tag_subject">
210
    <xsl:param name="tag" />
281
    <xsl:param name="tag" />
211
    <xsl:param name="label" />
282
    <xsl:param name="label" />
212
    <xsl:if test="marc:datafield[@tag=$tag]">
283
    <xsl:if test="marc:datafield[@tag=$tag]">
213
      <span class="results_summary">
284
      <span class="results_summary">
214
        <span class="label"><xsl:value-of select="$label"/>: </span>
285
        <span class="label">
215
        <xsl:for-each select="marc:datafield[@tag=$tag]">
286
          <xsl:value-of select="$label"/>
216
          <a>
287
          <xsl:text>: </xsl:text>
217
            <xsl:choose>
288
        </span>
218
              <xsl:when test="marc:subfield[@code=9]">
289
        <span class="value">
219
                <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
290
          <xsl:for-each select="marc:datafield[@tag=$tag]">
220
              </xsl:when>
291
            <xsl:call-template name="tag_onesubject">
221
              <xsl:otherwise>
222
                <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=su:<xsl:value-of select="marc:subfield[@code='a']"/></xsl:attribute>
223
              </xsl:otherwise>
224
            </xsl:choose>
225
            <xsl:call-template name="chopPunctuation">
226
              <xsl:with-param name="chopString">
227
                <xsl:call-template name="subfieldSelect">
228
                    <xsl:with-param name="codes">abcdjpvxyz</xsl:with-param>
229
                    <xsl:with-param name="subdivCodes">jpxyz</xsl:with-param>
230
                    <xsl:with-param name="subdivDelimiter">-- </xsl:with-param>
231
                </xsl:call-template>
232
              </xsl:with-param>
233
            </xsl:call-template>
292
            </xsl:call-template>
234
          </a>
293
          </xsl:for-each>
235
          <xsl:if test="not (position()=last())">
294
        </span>
236
            <xsl:text> | </xsl:text>
237
          </xsl:if>
238
        </xsl:for-each>
239
      </span>
295
      </span>
240
    </xsl:if>
296
    </xsl:if>
241
  </xsl:template>
297
  </xsl:template>
242
298
243
244
  <xsl:template name="tag_7xx">
299
  <xsl:template name="tag_7xx">
245
    <xsl:param name="tag" />
300
    <xsl:param name="tag" />
246
    <xsl:param name="label" />
301
    <xsl:param name="label" />
247
    <xsl:if test="marc:datafield[@tag=$tag]">
302
    <xsl:if test="marc:datafield[@tag=$tag]">
248
      <span class="results_summary">
303
      <span class="results_summary">
249
        <span class="label"><xsl:value-of select="$label" />: </span>
304
        <span class="label">
250
        <xsl:for-each select="marc:datafield[@tag=$tag]">
305
          <xsl:value-of select="$label" />
251
          <span>
306
          <xsl:text>: </xsl:text>
252
            <xsl:call-template name="addClassRtl" />
307
        </span>
308
        <span class="value">
309
          <xsl:for-each select="marc:datafield[@tag=$tag]">
253
            <a>
310
            <a>
254
              <xsl:choose>
311
              <xsl:choose>
255
                <xsl:when test="marc:subfield[@code=9]">
312
                <xsl:when test="marc:subfield[@code=9]">
256
                  <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
313
                  <xsl:attribute name="href">
314
                    <xsl:text>/cgi-bin/koha/opac-search.pl?q=an:</xsl:text>
315
                    <xsl:value-of select="marc:subfield[@code=9]"/>
316
                  </xsl:attribute>
257
                </xsl:when>
317
                </xsl:when>
258
                <xsl:otherwise>
318
                <xsl:otherwise>
259
                  <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=au:<xsl:value-of select="marc:subfield[@code='a']"/><xsl:text> </xsl:text><xsl:value-of select="marc:subfield[@code='b']"/></xsl:attribute>
319
                  <xsl:attribute name="href">
320
                    <xsl:text>/cgi-bin/koha/opac-search.pl?q=au:</xsl:text>
321
                    <xsl:value-of select="marc:subfield[@code='a']"/>
322
                    <xsl:text> </xsl:text>
323
                    <xsl:value-of select="marc:subfield[@code='b']"/>
324
                  </xsl:attribute>
260
                </xsl:otherwise>
325
                </xsl:otherwise>
261
              </xsl:choose>
326
              </xsl:choose>
262
              <xsl:if test="marc:subfield[@code='a']">
327
              <xsl:for-each select="marc:subfield[@code='a' or @code='b' or @code='4' or @code='c' or @code='d' or @code='f' or @code='g' or @code='p']">
263
                <xsl:value-of select="marc:subfield[@code='a']"/>
328
                <xsl:choose>
264
              </xsl:if>
329
                  <xsl:when test="@code='9'">
265
              <xsl:if test="marc:subfield[@code='b']">
330
                  </xsl:when>
266
                <xsl:text>, </xsl:text>
331
                  <xsl:otherwise>
267
                <xsl:value-of select="marc:subfield[@code='b']"/>
332
                    <xsl:value-of select="."/>
268
              </xsl:if>
333
                  </xsl:otherwise>
269
              <xsl:if test="marc:subfield[@code='c']">
334
                </xsl:choose>
270
                <xsl:text>, </xsl:text>
335
                <xsl:if test="not(position() = last())">
271
                <xsl:value-of select="marc:subfield[@code='c']"/>
336
                  <xsl:text>, </xsl:text>
272
              </xsl:if>
337
                </xsl:if>
273
              <xsl:if test="marc:subfield[@code='d']">
338
              </xsl:for-each>
274
                <xsl:text> </xsl:text>
275
                <xsl:value-of select="marc:subfield[@code='d']"/>
276
              </xsl:if>
277
              <xsl:if test="marc:subfield[@code='f']">
278
                <span dir="ltr">
279
                <xsl:text> (</xsl:text>
280
                <xsl:value-of select="marc:subfield[@code='f']"/>
281
                <xsl:text>)</xsl:text>
282
                </span>
283
              </xsl:if>
284
              <xsl:if test="marc:subfield[@code='g']">
285
                <xsl:text> </xsl:text>
286
                <xsl:value-of select="marc:subfield[@code='g']"/>
287
              </xsl:if>
288
              <xsl:if test="marc:subfield[@code='p']">
289
                <xsl:text> </xsl:text>
290
                <xsl:value-of select="marc:subfield[@code='p']"/>
291
              </xsl:if>
292
            </a>
339
            </a>
293
          </span>
340
            <xsl:if test="not(position() = last())">
294
          <xsl:if test="not (position() = last())">
341
              <span style="padding: 3px;">
295
            <xsl:text> ; </xsl:text>
342
                <xsl:text>;</xsl:text>
296
          </xsl:if>
343
              </span>
297
        </xsl:for-each>
344
            </xsl:if>
345
          </xsl:for-each>
346
        </span>
298
      </span>
347
      </span>
299
    </xsl:if>
348
    </xsl:if>
300
  </xsl:template>
349
  </xsl:template>
301
- 

Return to bug 6314