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

(-)a/C4/XSLT.pm (-22 / +3 lines)
Lines 266-276 sub XSLTParse4Display { Link Here
266
        }
266
        }
267
    }
267
    }
268
268
269
    my $partsxml = '';
269
    # possibly show analytics link in Detail views
270
    # possibly insert component records into Detail views
271
    if ($xslsyspref =~ m/Details/) {
270
    if ($xslsyspref =~ m/Details/) {
272
        $biblio //= Koha::Biblios->find( $biblionumber );
271
        $biblio //= Koha::Biblios->find( $biblionumber );
273
        my $components = $biblio->get_marc_analytics(300);
272
        my $components = $biblio->get_marc_analytics();
274
        $variables->{show_analytics_link} = ( scalar @{$components} == 0 ) ? 0 : 1;
273
        $variables->{show_analytics_link} = ( scalar @{$components} == 0 ) ? 0 : 1;
275
274
276
        my $showcomp = C4::Context->preference('ShowComponentRecords');
275
        my $showcomp = C4::Context->preference('ShowComponentRecords');
Lines 281-305 sub XSLTParse4Display { Link Here
281
                || ( $showcomp eq 'opac'  && $xslsyspref =~ m/OPAC/ ) )
280
                || ( $showcomp eq 'opac'  && $xslsyspref =~ m/OPAC/ ) )
282
          )
281
          )
283
        {
282
        {
284
285
             $variables->{show_analytics_link} = 0;
283
             $variables->{show_analytics_link} = 0;
286
287
             my $search_query = $biblio->get_analytics_query;
288
             $variables->{ComponentPartQuery} = $search_query;
289
290
             my @componentPartRecordXML = ('<componentPartRecords>');
291
             for my $cb ( @{ $components } ) {
292
                 if( ref $cb eq 'MARC::Record'){
293
                     $cb = $cb->as_xml_record();
294
                 } else {
295
                     $cb = decode('utf8', $cb);
296
                 }
297
                 # Remove the xml header
298
                 $cb =~ s/^<\?xml.*?\?>//;
299
                 push @componentPartRecordXML,$cb;
300
             }
301
             push @componentPartRecordXML, '</componentPartRecords>';
302
             $partsxml = join "\n", @componentPartRecordXML;
303
        }
284
        }
304
    }
285
    }
305
286
Lines 309-315 sub XSLTParse4Display { Link Here
309
    }
290
    }
310
    $varxml .= "</variables>\n";
291
    $varxml .= "</variables>\n";
311
292
312
    $xmlrecord =~ s/\<\/record\>/$itemsxml$sysxml$varxml$partsxml\<\/record\>/;
293
    $xmlrecord =~ s/\<\/record\>/$itemsxml$sysxml$varxml\<\/record\>/;
313
    if ($fixamps) { # We need to correct the ampersand entities that Zebra outputs
294
    if ($fixamps) { # We need to correct the ampersand entities that Zebra outputs
314
        $xmlrecord =~ s/\&amp;amp;/\&amp;/g;
295
        $xmlrecord =~ s/\&amp;amp;/\&amp;/g;
315
        $xmlrecord =~ s/\&amp\;lt\;/\&lt\;/g;
296
        $xmlrecord =~ s/\&amp\;lt\;/\&lt\;/g;
(-)a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss (-9 lines)
Lines 577-583 ol { Link Here
577
577
578
    li {
578
    li {
579
        list-style: decimal;
579
        list-style: decimal;
580
        list-style-position: inside;
581
    }
580
    }
582
581
583
    &.bibliodetails {
582
    &.bibliodetails {
Lines 598-611 ol { Link Here
598
    padding: 7px 0;
597
    padding: 7px 0;
599
}
598
}
600
599
601
.componentPartRecordsContainer {
602
    float: right;
603
    overflow-y: auto;
604
    overflow-x: hidden;
605
    max-width: 50%;
606
    max-height: 25em;
607
}
608
609
#editions {
600
#editions {
610
    table,
601
    table,
611
    td {
602
    td {
(-)a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl (-2 lines)
Lines 115-122 Link Here
115
            </h1>
115
            </h1>
116
        </xsl:if>
116
        </xsl:if>
117
117
118
	<xsl:call-template name="showComponentParts"/>
119
120
        <!--Bug 13381 -->
118
        <!--Bug 13381 -->
121
        <xsl:if test="marc:datafield[@tag=245]">
119
        <xsl:if test="marc:datafield[@tag=245]">
122
            <h1 class="title" property="name">
120
            <h1 class="title" property="name">
(-)a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slimUtils.xsl (-73 lines)
Lines 577-655 Link Here
577
                </xsl:call-template>
577
                </xsl:call-template>
578
        </xsl:if>
578
        </xsl:if>
579
    </xsl:template>
579
    </xsl:template>
580
581
    <xsl:template name="showComponentParts">
582
        <!-- Component part records: Displaying title and author of component part records -->
583
        <xsl:if test="marc:componentPartRecords">
584
            <xsl:variable name="ComponentPartQuery" select="marc:variables/marc:variable[@name='ComponentPartQuery']" />
585
            <div class="results_summary componentPartRecordsContainer">
586
                <h5>Component part records</h5>
587
                <ol class="componentParts">
588
                    <xsl:for-each select="marc:componentPartRecords/marc:record">
589
                        <li>
590
                            <span class="componentPartRecord">
591
                                <span class="componentPartRecordTitle">
592
                                    <a>
593
                                    <xsl:attribute name="href">/cgi-bin/koha/catalogue/detail.pl?biblionumber=<xsl:value-of select="marc:datafield[@tag=999]/marc:subfield[@code='c']" /></xsl:attribute>
594
                                    <xsl:choose>
595
                                        <xsl:when test="marc:datafield[@tag=245]/marc:subfield[@code='a']">
596
                                            <xsl:value-of select="substring-before( concat(marc:datafield[@tag=245]/marc:subfield[@code='a'], '/'), '/')" />
597
                                        </xsl:when>
598
                                        <xsl:when test="marc:datafield[@tag=240]/marc:subfield[@code='a']">
599
					  <xsl:for-each select="marc:datafield[@tag=240]">
600
					    <xsl:call-template name="chopPunctuation">
601
					      <xsl:with-param name="chopString">
602
						<xsl:call-template name="subfieldSelect">
603
						  <xsl:with-param name="codes">amnp</xsl:with-param>
604
						</xsl:call-template>
605
					      </xsl:with-param>
606
					    </xsl:call-template>
607
					  </xsl:for-each>
608
                                        </xsl:when>
609
                                        <xsl:when test="marc:datafield[@tag=130]/marc:subfield[@code='a']">
610
					  <xsl:for-each select="marc:datafield[@tag=130]">
611
					    <xsl:call-template name="chopPunctuation">
612
					      <xsl:with-param name="chopString">
613
						<xsl:call-template name="subfieldSelect">
614
						  <xsl:with-param name="codes">amnp</xsl:with-param>
615
						</xsl:call-template>
616
					      </xsl:with-param>
617
					    </xsl:call-template>
618
					  </xsl:for-each>
619
                                        </xsl:when>
620
                                        <xsl:otherwise>
621
                                            <xsl:text>[Record with no title statement]</xsl:text>
622
                                        </xsl:otherwise>
623
                                    </xsl:choose>
624
                                    </a>
625
                                </span>
626
				<xsl:choose>
627
                                  <xsl:when test="marc:datafield[@tag=100]/marc:subfield[@code='a']">
628
                                    -
629
                                    <span class="componentPartRecordAuthor">
630
                                        <xsl:value-of select="marc:datafield[@tag=100]/marc:subfield[@code='a']" />
631
                                    </span>
632
                                  </xsl:when>
633
                                  <xsl:when test="marc:datafield[@tag=110]/marc:subfield[@code='a']">
634
                                    -
635
                                    <span class="componentPartRecordAuthor">
636
                                        <xsl:value-of select="marc:datafield[@tag=110]/marc:subfield[@code='a']" />
637
                                    </span>
638
                                  </xsl:when>
639
				</xsl:choose>
640
                            </span>
641
                        </li>
642
                    </xsl:for-each>
643
                </ol>
644
                <xsl:choose>
645
                    <xsl:when test="count(marc:componentPartRecords/marc:record) = 300">
646
                        <p>Only 300 results are shown: <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=<xsl:value-of select="str:encode-uri($ComponentPartQuery, true())"/></xsl:attribute>show all component parts</a></p>
647
                     </xsl:when>
648
                </xsl:choose>
649
            </div>
650
        </xsl:if>
651
    </xsl:template>
652
653
</xsl:stylesheet>
580
</xsl:stylesheet>
654
581
655
<!-- Stylus Studio meta-information - (c)1998-2002 eXcelon Corp.
582
<!-- Stylus Studio meta-information - (c)1998-2002 eXcelon Corp.
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl (-2 lines)
Lines 127-134 Link Here
127
            </h2>
127
            </h2>
128
        </xsl:if>
128
        </xsl:if>
129
129
130
	<xsl:call-template name="showComponentParts"/>
131
132
            <!--Bug 13381 -->
130
            <!--Bug 13381 -->
133
            <xsl:if test="marc:datafield[@tag=245]">
131
            <xsl:if test="marc:datafield[@tag=245]">
134
                <h1 class="title" property="name">
132
                <h1 class="title" property="name">
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slimUtils.xsl (-68 lines)
Lines 541-613 Link Here
541
                </xsl:call-template>
541
                </xsl:call-template>
542
        </xsl:if>
542
        </xsl:if>
543
    </xsl:template>
543
    </xsl:template>
544
545
    <xsl:template name="showComponentParts">
546
        <!-- Component part records: Displaying title and author of component part records -->
547
        <xsl:if test="marc:componentPartRecords">
548
            <div class="results_summary componentPartRecordsContainer">
549
                <h5>Component part records</h5>
550
                <ol class="componentParts">
551
                    <xsl:for-each select="marc:componentPartRecords/marc:record">
552
                        <li>
553
                            <span class="componentPartRecord">
554
                                <span class="componentPartRecordTitle">
555
                                    <a>
556
                                    <xsl:attribute name="href">/cgi-bin/koha/opac-detail.pl?biblionumber=<xsl:value-of select="marc:datafield[@tag=999]/marc:subfield[@code='c']" /></xsl:attribute>
557
                                    <xsl:choose>
558
                                        <xsl:when test="marc:datafield[@tag=245]/marc:subfield[@code='a']">
559
                                            <xsl:value-of select="substring-before( concat(marc:datafield[@tag=245]/marc:subfield[@code='a'], '/'), '/')" />
560
                                        </xsl:when>
561
                                        <xsl:when test="marc:datafield[@tag=240]/marc:subfield[@code='a']">
562
					  <xsl:for-each select="marc:datafield[@tag=240]">
563
					    <xsl:call-template name="chopPunctuation">
564
					      <xsl:with-param name="chopString">
565
						<xsl:call-template name="subfieldSelect">
566
						  <xsl:with-param name="codes">amnp</xsl:with-param>
567
						</xsl:call-template>
568
					      </xsl:with-param>
569
					    </xsl:call-template>
570
					  </xsl:for-each>
571
                                        </xsl:when>
572
                                        <xsl:when test="marc:datafield[@tag=130]/marc:subfield[@code='a']">
573
					  <xsl:for-each select="marc:datafield[@tag=130]">
574
					    <xsl:call-template name="chopPunctuation">
575
					      <xsl:with-param name="chopString">
576
						<xsl:call-template name="subfieldSelect">
577
						  <xsl:with-param name="codes">amnp</xsl:with-param>
578
						</xsl:call-template>
579
					      </xsl:with-param>
580
					    </xsl:call-template>
581
					  </xsl:for-each>
582
                                        </xsl:when>
583
                                        <xsl:otherwise>
584
                                            <xsl:text>[Record with no title statement]</xsl:text>
585
                                        </xsl:otherwise>
586
                                    </xsl:choose>
587
                                    </a>
588
                                </span>
589
				<xsl:choose>
590
                                  <xsl:when test="marc:datafield[@tag=100]/marc:subfield[@code='a']">
591
                                    -
592
                                    <span class="componentPartRecordAuthor">
593
                                        <xsl:value-of select="marc:datafield[@tag=100]/marc:subfield[@code='a']" />
594
                                    </span>
595
                                  </xsl:when>
596
                                  <xsl:when test="marc:datafield[@tag=110]/marc:subfield[@code='a']">
597
                                    -
598
                                    <span class="componentPartRecordAuthor">
599
                                        <xsl:value-of select="marc:datafield[@tag=110]/marc:subfield[@code='a']" />
600
                                    </span>
601
                                  </xsl:when>
602
				</xsl:choose>
603
                            </span>
604
                        </li>
605
                    </xsl:for-each>
606
                </ol>
607
            </div>
608
        </xsl:if>
609
    </xsl:template>
610
611
</xsl:stylesheet>
544
</xsl:stylesheet>
612
545
613
<!-- Stylus Studio meta-information - (c)1998-2002 eXcelon Corp.
546
<!-- Stylus Studio meta-information - (c)1998-2002 eXcelon Corp.
614
- 

Return to bug 11175