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

(-)a/C4/XSLT.pm (-23 / +4 lines)
Lines 281-291 sub XSLTParse4Display { Link Here
281
        }
281
        }
282
    }
282
    }
283
283
284
    my $partsxml = '';
284
    # possibly show analytics link in Detail views
285
    # possibly insert component records into Detail views
286
    if ( $xslsyspref eq "OPACXSLTDetailsDisplay" || $xslsyspref eq "XSLTDetailsDisplay" ) {
285
    if ( $xslsyspref eq "OPACXSLTDetailsDisplay" || $xslsyspref eq "XSLTDetailsDisplay" ) {
287
        my $biblio //= Koha::Biblios->find( $biblionumber );
286
        $biblio //= Koha::Biblios->find( $biblionumber );
288
        my $components = $biblio->get_marc_components(300);
287
        my $components = $biblio->get_marc_components();
289
        $variables->{show_analytics_link} = ( scalar @{$components} == 0 ) ? 0 : 1;
288
        $variables->{show_analytics_link} = ( scalar @{$components} == 0 ) ? 0 : 1;
290
289
291
        my $showcomp = C4::Context->preference('ShowComponentRecords');
290
        my $showcomp = C4::Context->preference('ShowComponentRecords');
Lines 296-320 sub XSLTParse4Display { Link Here
296
                || ( $showcomp eq 'opac'  && $xslsyspref =~ m/OPAC/ ) )
295
                || ( $showcomp eq 'opac'  && $xslsyspref =~ m/OPAC/ ) )
297
          )
296
          )
298
        {
297
        {
299
300
             $variables->{show_analytics_link} = 0;
298
             $variables->{show_analytics_link} = 0;
301
302
             my $search_query = $biblio->get_analytics_query;
303
             $variables->{ComponentPartQuery} = $search_query;
304
305
             my @componentPartRecordXML = ('<componentPartRecords>');
306
             for my $cb ( @{ $components } ) {
307
                 if( ref $cb eq 'MARC::Record'){
308
                     $cb = $cb->as_xml_record();
309
                 } else {
310
                     $cb = decode('utf8', $cb);
311
                 }
312
                 # Remove the xml header
313
                 $cb =~ s/^<\?xml.*?\?>//;
314
                 push @componentPartRecordXML,$cb;
315
             }
316
             push @componentPartRecordXML, '</componentPartRecords>';
317
             $partsxml = join "\n", @componentPartRecordXML;
318
        }
299
        }
319
    }
300
    }
320
301
Lines 325-331 sub XSLTParse4Display { Link Here
325
    $varxml .= "</variables>\n";
306
    $varxml .= "</variables>\n";
326
307
327
    my $sysxml = get_xslt_sysprefs();
308
    my $sysxml = get_xslt_sysprefs();
328
    $xmlrecord =~ s/\<\/record\>/$itemsxml$sysxml$varxml$partsxml\<\/record\>/;
309
    $xmlrecord =~ s/\<\/record\>/$itemsxml$sysxml$varxml\<\/record\>/;
329
    if ($fixamps) { # We need to correct the ampersand entities that Zebra outputs
310
    if ($fixamps) { # We need to correct the ampersand entities that Zebra outputs
330
        $xmlrecord =~ s/\&amp;amp;/\&amp;/g;
311
        $xmlrecord =~ s/\&amp;amp;/\&amp;/g;
331
        $xmlrecord =~ s/\&amp\;lt\;/\&lt\;/g;
312
        $xmlrecord =~ s/\&amp\;lt\;/\&lt\;/g;
(-)a/catalogue/detail.pl (+22 lines)
Lines 211-216 foreach my $subscription (@subscriptions) { Link Here
211
    push @subs, \%cell;
211
    push @subs, \%cell;
212
}
212
}
213
213
214
# Get component parts details
215
my $showcomp = C4::Context->preference('ShowComponentRecords');
216
if ( $showcomp eq 'both' || $showcomp eq 'staff' ) {
217
    if ( my $components = $biblio->get_marc_components(300) ) {
218
        my $parts;
219
        for my $part ( @{$components} ) {
220
            $part = MARC::Record->new_from_xml( $part, 'UTF-8' );
221
222
            push @{$parts},
223
              XSLTParse4Display(
224
                {
225
                    biblionumber => $biblionumber,
226
                    record       => $part,
227
                    xsl_syspref  => "XSLTResultsDisplay",
228
                    fix_amps     => 1,
229
                }
230
              );
231
        }
232
        $template->param( ComponentParts => $parts );
233
    }
234
}
235
214
# Get acquisition details
236
# Get acquisition details
215
if ( C4::Context->preference('AcquisitionDetails') ) {
237
if ( C4::Context->preference('AcquisitionDetails') ) {
216
    my $orders = Koha::Acquisition::Orders->search(
238
    my $orders = Koha::Acquisition::Orders->search(
(-)a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss (-9 lines)
Lines 594-600 ol { Link Here
594
594
595
    li {
595
    li {
596
        list-style: decimal;
596
        list-style: decimal;
597
        list-style-position: inside;
598
    }
597
    }
599
598
600
    &.bibliodetails {
599
    &.bibliodetails {
Lines 615-628 ol { Link Here
615
    padding: 7px 0;
614
    padding: 7px 0;
616
}
615
}
617
616
618
.componentPartRecordsContainer {
619
    float: right;
620
    overflow-y: auto;
621
    overflow-x: hidden;
622
    max-width: 50%;
623
    max-height: 25em;
624
}
625
626
#editions {
617
#editions {
627
    table,
618
    table,
628
    td {
619
    td {
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt (+18 lines)
Lines 269-274 Link Here
269
        </li>
269
        </li>
270
    [% END %]
270
    [% END %]
271
[% IF ( MARCNOTES || notes ) %]<li><a href="#description">Descriptions ([% ( MARCNOTES.size || 1 ) | html %])</a></li>[% END %]
271
[% IF ( MARCNOTES || notes ) %]<li><a href="#description">Descriptions ([% ( MARCNOTES.size || 1 ) | html %])</a></li>[% END %]
272
[% IF ( ComponentParts ) %]<li><a href="#components">Components ([% ( ComponentParts.size || 1 ) %])</a></li>[% END %]
272
[% IF ( subscriptionsnumber ) %]<li><a href="#subscriptions">Subscriptions</a></li>[% END %]
273
[% IF ( subscriptionsnumber ) %]<li><a href="#subscriptions">Subscriptions</a></li>[% END %]
273
[% IF Koha.Preference('AcquisitionDetails') %]<li><a href="#acq_details">Acquisition details</a></li>[% END %]
274
[% IF Koha.Preference('AcquisitionDetails') %]<li><a href="#acq_details">Acquisition details</a></li>[% END %]
274
[% IF suggestions.count %]<li><a href="#suggestion_details">Suggestion details</a></li>[% END %]
275
[% IF suggestions.count %]<li><a href="#suggestion_details">Suggestion details</a></li>[% END %]
Lines 674-679 Note that permanent location is a code, and location may be an authval. Link Here
674
675
675
[% END %]
676
[% END %]
676
677
678
[% IF ComponentParts.size %]
679
<div id="components">
680
    <div class="content_set">
681
        <table>
682
            [% FOR PART IN ComponentParts %]
683
            <tr>
684
                <td>
685
                    [% PART | $raw %]
686
                </td>
687
            </tr>
688
            [% END %]
689
        </table>
690
    </div>
691
</div>
692
693
[% END %]
694
677
[% IF ( subscriptionsnumber ) %]
695
[% IF ( subscriptionsnumber ) %]
678
<div id="subscriptions">
696
<div id="subscriptions">
679
<div id="catalogue_detail_subscriptions">
697
<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 (-72 lines)
Lines 578-655 Link Here
578
        </xsl:if>
578
        </xsl:if>
579
    </xsl:template>
579
    </xsl:template>
580
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>
581
</xsl:stylesheet>
654
582
655
<!-- Stylus Studio meta-information - (c)1998-2002 eXcelon Corp.
583
<!-- Stylus Studio meta-information - (c)1998-2002 eXcelon Corp.
(-)a/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss (-8 lines)
Lines 292-305 th { Link Here
292
}
292
}
293
293
294
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 {
295
#members {
304
    p {
296
    p {
305
        color: #727272;
297
        color: #727272;
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt (+17 lines)
Lines 402-407 Link Here
402
                            [% IF SYNDETICS_SUMMARY %][% SET title_notes_count = title_notes_count + 1 %][% END %]
402
                            [% IF SYNDETICS_SUMMARY %][% SET title_notes_count = title_notes_count + 1 %][% END %]
403
                            <li id="tab_descriptions"> <a href="#descriptions">Title notes ( [% title_notes_count | html %] )</a></li>
403
                            <li id="tab_descriptions"> <a href="#descriptions">Title notes ( [% title_notes_count | html %] )</a></li>
404
                        [% END %]
404
                        [% END %]
405
                        [% IF ( ComponentParts ) %]<li><a href="#components">Components ([% ( ComponentParts.size || 1 ) %])</a></li>[% END %]
405
                        [% IF ( SYNDETICS_TOC ) %]
406
                        [% IF ( SYNDETICS_TOC ) %]
406
                            <li id="tab_toc"> <a href="#toc">TOC</a></li>
407
                            <li id="tab_toc"> <a href="#toc">TOC</a></li>
407
                        [% END %]
408
                        [% END %]
Lines 584-589 Link Here
584
                        </div> <!-- / #descriptions -->
585
                        </div> <!-- / #descriptions -->
585
                    [% END # / IF MARCNOTES || notes %]
586
                    [% END # / IF MARCNOTES || notes %]
586
587
588
                    [% IF ComponentParts.size %]
589
                    <div id="components">
590
                        <div class="content_set">
591
                            <table>
592
                                [% FOR PART IN ComponentParts %]
593
                                <tr>
594
                                    <td>
595
                                        [% PART | $raw %]
596
                                    </td>
597
                                </tr>
598
                                [% END %]
599
                            </table>
600
                        </div>
601
                    </div>
602
                    [% END %]
603
587
                    [% IF ( SyndeticsEnabled ) %]
604
                    [% IF ( SyndeticsEnabled ) %]
588
                        [% IF ( SyndeticsTOC && SYNDETICS_TOC ) %]
605
                        [% IF ( SyndeticsTOC && SYNDETICS_TOC ) %]
589
                            <div id="toc">
606
                            <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 (-66 lines)
Lines 542-613 Link Here
542
        </xsl:if>
542
        </xsl:if>
543
    </xsl:template>
543
    </xsl:template>
544
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>
545
</xsl:stylesheet>
612
546
613
<!-- Stylus Studio meta-information - (c)1998-2002 eXcelon Corp.
547
<!-- Stylus Studio meta-information - (c)1998-2002 eXcelon Corp.
(-)a/opac/opac-detail.pl (-1 / +22 lines)
Lines 657-662 my $separatebranch = C4::Context->preference('OpacSeparateHoldingsBranch'); Link Here
657
my $viewallitems = $query->param('viewallitems');
657
my $viewallitems = $query->param('viewallitems');
658
my $max_items_to_display = C4::Context->preference('OpacMaxItemsToDisplay') // 50;
658
my $max_items_to_display = C4::Context->preference('OpacMaxItemsToDisplay') // 50;
659
659
660
# Get component parts details
661
my $showcomp = C4::Context->preference('ShowComponentRecords');
662
if ( $showcomp eq 'both' || $showcomp eq 'opac' ) {
663
    if ( my $components = $biblio->get_marc_components(300) ) {
664
        my $parts;
665
        for my $part ( @{$components} ) {
666
            $part = MARC::Record->new_from_xml( $part, 'UTF-8' );
667
668
            push @{$parts},
669
              XSLTParse4Display(
670
                {
671
                    biblionumber => $biblionumber,
672
                    record       => $part,
673
                    xsl_syspref  => 'OPACXSLTResultsDisplay',
674
                    fix_amps     => 1,
675
                }
676
              );
677
        }
678
        $template->param( ComponentParts => $parts );
679
    }
680
}
681
660
# Get items on order
682
# Get items on order
661
my ( @itemnumbers_on_order );
683
my ( @itemnumbers_on_order );
662
if ( C4::Context->preference('OPACAcquisitionDetails' ) ) {
684
if ( C4::Context->preference('OPACAcquisitionDetails' ) ) {
663
- 

Return to bug 11175