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/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 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/modules/catalogue/detail.tt (+18 lines)
Lines 278-283 Link Here
278
        </li>
278
        </li>
279
    [% END %]
279
    [% END %]
280
[% IF ( MARCNOTES || notes ) %]<li><a href="#description">Descriptions ([% ( MARCNOTES.size || 1 ) | html %])</a></li>[% END %]
280
[% IF ( MARCNOTES || notes ) %]<li><a href="#description">Descriptions ([% ( MARCNOTES.size || 1 ) | html %])</a></li>[% END %]
281
[% IF ( ComponentParts ) %]<li><a href="#components">Components ([% ( ComponentParts.size || 1 ) %])</a></li>[% END %]
281
[% IF ( subscriptionsnumber ) %]<li><a href="#subscriptions">Subscriptions</a></li>[% END %]
282
[% IF ( subscriptionsnumber ) %]<li><a href="#subscriptions">Subscriptions</a></li>[% END %]
282
[% IF Koha.Preference('AcquisitionDetails') %]<li><a href="#acq_details">Acquisition details</a></li>[% END %]
283
[% IF Koha.Preference('AcquisitionDetails') %]<li><a href="#acq_details">Acquisition details</a></li>[% END %]
283
[% IF suggestions.count %]<li><a href="#suggestion_details">Suggestion details</a></li>[% END %]
284
[% IF suggestions.count %]<li><a href="#suggestion_details">Suggestion details</a></li>[% END %]
Lines 683-688 Note that permanent location is a code, and location may be an authval. Link Here
683
684
684
[% END %]
685
[% END %]
685
686
687
[% IF ComponentParts.size %]
688
<div id="components">
689
    <div class="content_set">
690
        <table>
691
            [% FOR PART IN ComponentParts %]
692
            <tr>
693
                <td>
694
                    [% PART | $raw %]
695
                </td>
696
            </tr>
697
            [% END %]
698
        </table>
699
    </div>
700
</div>
701
702
[% END %]
703
686
[% IF ( subscriptionsnumber ) %]
704
[% IF ( subscriptionsnumber ) %]
687
<div id="subscriptions">
705
<div id="subscriptions">
688
<div id="catalogue_detail_subscriptions">
706
<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 531-536 Link Here
531
                            [% IF SYNDETICS_SUMMARY %][% SET title_notes_count = title_notes_count + 1 %][% END %]
531
                            [% IF SYNDETICS_SUMMARY %][% SET title_notes_count = title_notes_count + 1 %][% END %]
532
                            <li id="tab_descriptions"> <a href="#descriptions">Title notes ( [% title_notes_count | html %] )</a></li>
532
                            <li id="tab_descriptions"> <a href="#descriptions">Title notes ( [% title_notes_count | html %] )</a></li>
533
                        [% END %]
533
                        [% END %]
534
                        [% IF ( ComponentParts ) %]<li><a href="#components">Components ([% ( ComponentParts.size || 1 ) %])</a></li>[% END %]
534
                        [% IF ( SYNDETICS_TOC ) %]
535
                        [% IF ( SYNDETICS_TOC ) %]
535
                            <li id="tab_toc"> <a href="#toc">TOC</a></li>
536
                            <li id="tab_toc"> <a href="#toc">TOC</a></li>
536
                        [% END %]
537
                        [% END %]
Lines 713-718 Link Here
713
                        </div> <!-- / #descriptions -->
714
                        </div> <!-- / #descriptions -->
714
                    [% END # / IF MARCNOTES || notes %]
715
                    [% END # / IF MARCNOTES || notes %]
715
716
717
                    [% IF ComponentParts.size %]
718
                    <div id="components">
719
                        <div class="content_set">
720
                            <table>
721
                                [% FOR PART IN ComponentParts %]
722
                                <tr>
723
                                    <td>
724
                                        [% PART | $raw %]
725
                                    </td>
726
                                </tr>
727
                                [% END %]
728
                            </table>
729
                        </div>
730
                    </div>
731
                    [% END %]
732
716
                    [% IF ( SyndeticsEnabled ) %]
733
                    [% IF ( SyndeticsEnabled ) %]
717
                        [% IF ( SyndeticsTOC && SYNDETICS_TOC ) %]
734
                        [% IF ( SyndeticsTOC && SYNDETICS_TOC ) %]
718
                            <div id="toc">
735
                            <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 690-695 my $separatebranch = C4::Context->preference('OpacSeparateHoldingsBranch'); Link Here
690
my $viewallitems = $query->param('viewallitems');
690
my $viewallitems = $query->param('viewallitems');
691
my $max_items_to_display = C4::Context->preference('OpacMaxItemsToDisplay') // 50;
691
my $max_items_to_display = C4::Context->preference('OpacMaxItemsToDisplay') // 50;
692
692
693
# Get component parts details
694
my $showcomp = C4::Context->preference('ShowComponentRecords');
695
if ( $showcomp eq 'both' || $showcomp eq 'opac' ) {
696
    if ( my $components = $biblio->get_marc_analytics(300) ) {
697
        my $xslparts = C4::Context->preference('OPACXSLTResultsDisplay') || "default";
698
        if ( $xslparts ) {
699
            my $parts;
700
            for my $part ( @{$components} ) {
701
                $part = MARC::Record->new_from_xml( $part, 'UTF-8' );
702
703
                push @{$parts},
704
                  XSLTParse4Display( 1, $part, "OPACXSLTResultsDisplay", 1,
705
                    undef, $sysxml, $xslparts, $lang, );
706
            }
707
            $template->param(
708
               ComponentParts => $parts
709
            );
710
        }
711
    }
712
}
713
693
# Get items on order
714
# Get items on order
694
my ( @itemnumbers_on_order );
715
my ( @itemnumbers_on_order );
695
if ( C4::Context->preference('OPACAcquisitionDetails' ) ) {
716
if ( C4::Context->preference('OPACAcquisitionDetails' ) ) {
696
- 

Return to bug 11175