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

(-)a/C4/XSLT.pm (-22 / +3 lines)
Lines 282-292 sub XSLTParse4Display { Link Here
282
        }
282
        }
283
    }
283
    }
284
284
285
    my $partsxml = '';
285
    # possibly show analytics link in Detail views
286
    # possibly insert component records into Detail views
287
    if ($xslsyspref =~ m/Details/) {
286
    if ($xslsyspref =~ m/Details/) {
288
        $biblio //= Koha::Biblios->find( $biblionumber );
287
        $biblio //= Koha::Biblios->find( $biblionumber );
289
        my $components = $biblio->get_marc_analytics(300);
288
        my $components = $biblio->get_marc_analytics();
290
        $variables->{show_analytics_link} = ( scalar @{$components} == 0 ) ? 0 : 1;
289
        $variables->{show_analytics_link} = ( scalar @{$components} == 0 ) ? 0 : 1;
291
290
292
        my $showcomp = C4::Context->preference('ShowComponentRecords');
291
        my $showcomp = C4::Context->preference('ShowComponentRecords');
Lines 297-321 sub XSLTParse4Display { Link Here
297
                || ( $showcomp eq 'opac'  && $xslsyspref =~ m/OPAC/ ) )
296
                || ( $showcomp eq 'opac'  && $xslsyspref =~ m/OPAC/ ) )
298
          )
297
          )
299
        {
298
        {
300
301
             $variables->{show_analytics_link} = 0;
299
             $variables->{show_analytics_link} = 0;
302
303
             my $search_query = $biblio->get_analytics_query;
304
             $variables->{ComponentPartQuery} = $search_query;
305
306
             my @componentPartRecordXML = ('<componentPartRecords>');
307
             for my $cb ( @{ $components } ) {
308
                 if( ref $cb eq 'MARC::Record'){
309
                     $cb = $cb->as_xml_record();
310
                 } else {
311
                     $cb = decode('utf8', $cb);
312
                 }
313
                 # Remove the xml header
314
                 $cb =~ s/^<\?xml.*?\?>//;
315
                 push @componentPartRecordXML,$cb;
316
             }
317
             push @componentPartRecordXML, '</componentPartRecords>';
318
             $partsxml = join "\n", @componentPartRecordXML;
319
        }
300
        }
320
    }
301
    }
321
302
Lines 326-332 sub XSLTParse4Display { Link Here
326
    $varxml .= "</variables>\n";
307
    $varxml .= "</variables>\n";
327
308
328
    my $sysxml = get_xslt_sysprefs();
309
    my $sysxml = get_xslt_sysprefs();
329
    $xmlrecord =~ s/\<\/record\>/$itemsxml$sysxml$varxml$partsxml\<\/record\>/;
310
    $xmlrecord =~ s/\<\/record\>/$itemsxml$sysxml$varxml\<\/record\>/;
330
    if ($fixamps) { # We need to correct the ampersand entities that Zebra outputs
311
    if ($fixamps) { # We need to correct the ampersand entities that Zebra outputs
331
        $xmlrecord =~ s/\&amp;amp;/\&amp;/g;
312
        $xmlrecord =~ s/\&amp;amp;/\&amp;/g;
332
        $xmlrecord =~ s/\&amp\;lt\;/\&lt\;/g;
313
        $xmlrecord =~ s/\&amp\;lt\;/\&lt\;/g;
(-)a/catalogue/detail.pl (+20 lines)
Lines 210-215 foreach my $subscription (@subscriptions) { Link Here
210
    push @subs, \%cell;
210
    push @subs, \%cell;
211
}
211
}
212
212
213
# Get component parts details
214
my $showcomp = C4::Context->preference('ShowComponentRecords');
215
if ( $showcomp eq 'both' || $showcomp eq 'staff' ) {
216
    if ( my $components = $biblio->get_marc_analytics(300) ) {
217
        my $xslparts = C4::Context->preference('XSLTResultsDisplay') || "default";
218
        if ( $xslparts ) {
219
            my $parts;
220
            for my $part ( @{$components} ) {
221
                $part = MARC::Record->new_from_xml( $part, 'UTF-8' );
222
223
                push @{$parts},
224
                  XSLTParse4Display( 1, $part, "XSLTResultsDisplay", 1,
225
                    undef, $sysxml, $xslparts, $lang, );
226
            }
227
            $template->param(
228
               ComponentParts => $parts
229
            );
230
        }
231
    }
232
}
213
233
214
# Get acquisition details
234
# Get acquisition details
215
if ( C4::Context->preference('AcquisitionDetails') ) {
235
if ( C4::Context->preference('AcquisitionDetails') ) {
(-)a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss (-9 lines)
Lines 583-589 ol { Link Here
583
583
584
    li {
584
    li {
585
        list-style: decimal;
585
        list-style: decimal;
586
        list-style-position: inside;
587
    }
586
    }
588
587
589
    &.bibliodetails {
588
    &.bibliodetails {
Lines 604-617 ol { Link Here
604
    padding: 7px 0;
603
    padding: 7px 0;
605
}
604
}
606
605
607
.componentPartRecordsContainer {
608
    float: right;
609
    overflow-y: auto;
610
    overflow-x: hidden;
611
    max-width: 50%;
612
    max-height: 25em;
613
}
614
615
#editions {
606
#editions {
616
    table,
607
    table,
617
    td {
608
    td {
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt (+18 lines)
Lines 274-279 Link Here
274
        </li>
274
        </li>
275
    [% END %]
275
    [% END %]
276
[% IF ( MARCNOTES || notes ) %]<li><a href="#description">Descriptions ([% ( MARCNOTES.size || 1 ) | html %])</a></li>[% END %]
276
[% IF ( MARCNOTES || notes ) %]<li><a href="#description">Descriptions ([% ( MARCNOTES.size || 1 ) | html %])</a></li>[% END %]
277
[% IF ( ComponentParts ) %]<li><a href="#components">Components ([% ( ComponentParts.size || 1 ) %])</a></li>[% END %]
277
[% IF ( subscriptionsnumber ) %]<li><a href="#subscriptions">Subscriptions</a></li>[% END %]
278
[% IF ( subscriptionsnumber ) %]<li><a href="#subscriptions">Subscriptions</a></li>[% END %]
278
[% IF Koha.Preference('AcquisitionDetails') %]<li><a href="#acq_details">Acquisition details</a></li>[% END %]
279
[% IF Koha.Preference('AcquisitionDetails') %]<li><a href="#acq_details">Acquisition details</a></li>[% END %]
279
[% IF suggestions.count %]<li><a href="#suggestion_details">Suggestion details</a></li>[% END %]
280
[% IF suggestions.count %]<li><a href="#suggestion_details">Suggestion details</a></li>[% END %]
Lines 679-684 Note that permanent location is a code, and location may be an authval. Link Here
679
680
680
[% END %]
681
[% END %]
681
682
683
[% IF ComponentParts.size %]
684
<div id="components">
685
    <div class="content_set">
686
        <table>
687
            [% FOR PART IN ComponentParts %]
688
            <tr>
689
                <td>
690
                    [% PART | $raw %]
691
                </td>
692
            </tr>
693
            [% END %]
694
        </table>
695
    </div>
696
</div>
697
698
[% END %]
699
682
[% IF ( subscriptionsnumber ) %]
700
[% IF ( subscriptionsnumber ) %]
683
<div id="subscriptions">
701
<div id="subscriptions">
684
<div id="catalogue_detail_subscriptions">
702
<div id="catalogue_detail_subscriptions">
(-)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/css/src/opac.scss (-9 lines)
Lines 291-305 th { Link Here
291
    }
291
    }
292
}
292
}
293
293
294
295
.componentPartRecordsContainer {
296
    float: right;
297
    overflow-y: auto;
298
    overflow-x: hidden;
299
    max-width: 50%;
300
    max-height: 25em;
301
}
302
303
#members {
294
#members {
304
    p {
295
    p {
305
        color: #727272;
296
        color: #727272;
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt (+17 lines)
Lines 378-383 Link Here
378
                            [% IF SYNDETICS_SUMMARY %][% SET title_notes_count = title_notes_count + 1 %][% END %]
378
                            [% IF SYNDETICS_SUMMARY %][% SET title_notes_count = title_notes_count + 1 %][% END %]
379
                            <li id="tab_descriptions"> <a href="#descriptions">Title notes ( [% title_notes_count | html %] )</a></li>
379
                            <li id="tab_descriptions"> <a href="#descriptions">Title notes ( [% title_notes_count | html %] )</a></li>
380
                        [% END %]
380
                        [% END %]
381
                        [% IF ( ComponentParts ) %]<li><a href="#components">Components ([% ( ComponentParts.size || 1 ) %])</a></li>[% END %]
381
                        [% IF ( SYNDETICS_TOC ) %]
382
                        [% IF ( SYNDETICS_TOC ) %]
382
                            <li id="tab_toc"> <a href="#toc">TOC</a></li>
383
                            <li id="tab_toc"> <a href="#toc">TOC</a></li>
383
                        [% END %]
384
                        [% END %]
Lines 560-565 Link Here
560
                        </div> <!-- / #descriptions -->
561
                        </div> <!-- / #descriptions -->
561
                    [% END # / IF MARCNOTES || notes %]
562
                    [% END # / IF MARCNOTES || notes %]
562
563
564
                    [% IF ComponentParts.size %]
565
                    <div id="components">
566
                        <div class="content_set">
567
                            <table>
568
                                [% FOR PART IN ComponentParts %]
569
                                <tr>
570
                                    <td>
571
                                        [% PART | $raw %]
572
                                    </td>
573
                                </tr>
574
                                [% END %]
575
                            </table>
576
                        </div>
577
                    </div>
578
                    [% END %]
579
563
                    [% IF ( SyndeticsEnabled ) %]
580
                    [% IF ( SyndeticsEnabled ) %]
564
                        [% IF ( SyndeticsTOC && SYNDETICS_TOC ) %]
581
                        [% IF ( SyndeticsTOC && SYNDETICS_TOC ) %]
565
                            <div id="toc">
582
                            <div id="toc">
(-)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 (-67 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.
(-)a/opac/opac-detail.pl (-1 / +21 lines)
Lines 656-661 my $separatebranch = C4::Context->preference('OpacSeparateHoldingsBranch'); Link Here
656
my $viewallitems = $query->param('viewallitems');
656
my $viewallitems = $query->param('viewallitems');
657
my $max_items_to_display = C4::Context->preference('OpacMaxItemsToDisplay') // 50;
657
my $max_items_to_display = C4::Context->preference('OpacMaxItemsToDisplay') // 50;
658
658
659
# Get component parts details
660
my $showcomp = C4::Context->preference('ShowComponentRecords');
661
if ( $showcomp eq 'both' || $showcomp eq 'opac' ) {
662
    if ( my $components = $biblio->get_marc_analytics(300) ) {
663
        my $xslparts = C4::Context->preference('OPACXSLTResultsDisplay') || "default";
664
        if ( $xslparts ) {
665
            my $parts;
666
            for my $part ( @{$components} ) {
667
                $part = MARC::Record->new_from_xml( $part, 'UTF-8' );
668
669
                push @{$parts},
670
                  XSLTParse4Display( 1, $part, "OPACXSLTResultsDisplay", 1,
671
                    undef, $sysxml, $xslparts, $lang, );
672
            }
673
            $template->param(
674
               ComponentParts => $parts
675
            );
676
        }
677
    }
678
}
679
659
# Get items on order
680
# Get items on order
660
my ( @itemnumbers_on_order );
681
my ( @itemnumbers_on_order );
661
if ( C4::Context->preference('OPACAcquisitionDetails' ) ) {
682
if ( C4::Context->preference('OPACAcquisitionDetails' ) ) {
662
- 

Return to bug 11175