From abc9a215f84e716041bd2187debc13f1692d0c9c Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Mon, 9 Aug 2021 08:30:12 +0100 Subject: [PATCH] WIP: Display components in own tab https://bugs.koha-community.org/show_bug.cgi?id=11175 --- catalogue/detail.pl | 19 ++++++++++++++++ .../prog/en/modules/catalogue/detail.tt | 22 +++++++++++++++++++ 2 files changed, 41 insertions(+) diff --git a/catalogue/detail.pl b/catalogue/detail.pl index 8017b0c6ac..3fd64e9fe7 100755 --- a/catalogue/detail.pl +++ b/catalogue/detail.pl @@ -210,6 +210,25 @@ 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 = [ '

test

' ]; + for my $part ( @{$components} ) { + push @{$parts}, XSLTParse4Display( + 1, $part, "XSLTResultsDisplay", 1, + undef, $sysxml, $xslparts, $lang, + ); + } + $template->param( + ShowComponentParts => $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..ac72260713 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 ( ShowComponentParts ) %]
  • Components ([% ( ShowComponentParts.size || 1 ) %])
  • [% END %] [% IF ( subscriptionsnumber ) %]
  • Subscriptions
  • [% END %] [% IF Koha.Preference('AcquisitionDetails') %]
  • Acquisition details
  • [% END %] [% IF suggestions.count %]
  • Suggestion details
  • [% END %] @@ -683,6 +684,27 @@ Note that permanent location is a code, and location may be an authval. [% END %] +[% IF ShowComponentParts.size %] +
    +
    +

    Components

    + + [% FOR PART IN ShowComponentParts %] + + + + + [% END %] +
    + 1 + + [% PART | $raw %] +
    +
    +
    + +[% END %] + [% IF ( subscriptionsnumber ) %]
    -- 2.20.1