From 8c5584dadc445df0b2379ea0c8e71160c90622dc Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 29 Aug 2017 13:36:24 -0300 Subject: [PATCH] Bug 15851: Only display 'show analytics' link if there are --- catalogue/detail.pl | 30 +++++++++++----------- .../prog/en/xslt/MARC21slim2intranetDetail.xsl | 3 +++ 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/catalogue/detail.pl b/catalogue/detail.pl index 1e18a1d667..61e734a738 100755 --- a/catalogue/detail.pl +++ b/catalogue/detail.pl @@ -88,21 +88,6 @@ my $fw = GetFrameworkCode($biblionumber); my $showallitems = $query->param('showallitems'); my $marcflavour = C4::Context->preference("marcflavour"); -# XSLT processing of some stuff -my $xslfile = C4::Context->preference('XSLTDetailsDisplay'); -my $lang = $xslfile ? C4::Languages::getlanguage() : undef; -my $sysxml = $xslfile ? C4::XSLT::get_xslt_sysprefs() : undef; - -if ( $xslfile ) { - $template->param( - XSLTDetailsDisplay => '1', - XSLTBloc => XSLTParse4Display( - $biblionumber, $record, "XSLTDetailsDisplay", - 1, undef, $sysxml, $xslfile, $lang - ) - ); -} - $template->param( 'SpineLabelShowPrintOnBibDetails' => C4::Context->preference("SpineLabelShowPrintOnBibDetails") ); $template->param( ocoins => GetCOinSBiblio($record) ); @@ -344,6 +329,21 @@ if (scalar(@itemloop) == 0 || scalar(@otheritemloop) == 0) { } } +# XSLT processing of some stuff +my $xslfile = C4::Context->preference('XSLTDetailsDisplay'); +if ( $xslfile ) { + my $lang = C4::Languages::getlanguage(); + my $sysxml = C4::XSLT::get_xslt_sysprefs(); + $sysxml .= qq|$analytics_flag|; + $template->param( + XSLTDetailsDisplay => '1', + XSLTBloc => XSLTParse4Display( + $biblionumber, $record, "XSLTDetailsDisplay", + 1, undef, $sysxml, $xslfile, $lang + ) + ); +} + $template->param( norequests => $norequests ); $template->param( MARCNOTES => $marcnotesarray, diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl index b699341bc4..71e3d00cc1 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl +++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl @@ -40,6 +40,7 @@ " + @@ -254,6 +255,7 @@ + Analytics: @@ -268,6 +270,7 @@ + -- 2.11.0