From a64207bfd61ec22173134f60d6daebbbe70dc46d Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Mon, 9 Aug 2021 08:30:12 +0100 Subject: [PATCH] Bug 11175: (WIP) Display components in own tab --- catalogue/detail.pl | 20 +++++++++++++++++++ .../prog/en/modules/catalogue/detail.tt | 18 +++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/catalogue/detail.pl b/catalogue/detail.pl index 8017b0c6ac..90ff2d58f1 100755 --- a/catalogue/detail.pl +++ b/catalogue/detail.pl @@ -210,6 +210,26 @@ foreach my $subscription (@subscriptions) { push @subs, \%cell; } +# Get component parts details +my $showcomp = C4::Context->preference('ShowComponentRecords'); +if ( $showcomp eq 'both' || $showcomp eq 'staff' ) { + if ( my $components = $biblio->get_marc_analytics(300) ) { + my $xslparts = C4::Context->preference('XSLTResultsDisplay') || "default"; + if ( $xslparts ) { + my $parts; + for my $part ( @{$components} ) { + $part = MARC::Record->new_from_xml( $part, 'UTF-8' ); + + push @{$parts}, + XSLTParse4Display( 1, $part, "XSLTResultsDisplay", 1, + undef, $sysxml, $xslparts, $lang, ); + } + $template->param( + ComponentParts => $parts + ); + } + } +} # Get acquisition details if ( C4::Context->preference('AcquisitionDetails') ) { diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt index 494e836e26..5b3cb63c5b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -278,6 +278,7 @@ [% END %] [% IF ( MARCNOTES || notes ) %]
  • Descriptions ([% ( MARCNOTES.size || 1 ) | html %])
  • [% END %] +[% IF ( ComponentParts ) %]
  • Components ([% ( ComponentParts.size || 1 ) %])
  • [% END %] [% IF ( subscriptionsnumber ) %]
  • Subscriptions
  • [% END %] [% IF Koha.Preference('AcquisitionDetails') %]
  • Acquisition details
  • [% END %] [% IF suggestions.count %]
  • Suggestion details
  • [% END %] @@ -683,6 +684,23 @@ Note that permanent location is a code, and location may be an authval. [% END %] +[% IF ComponentParts.size %] +
    +
    + + [% FOR PART IN ComponentParts %] + + + + [% END %] +
    + [% PART | $raw %] +
    +
    +
    + +[% END %] + [% IF ( subscriptionsnumber ) %]
    -- 2.20.1