From 5b67eb5d42ee505b32a0022ab0bd7f6dce127220 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 20 May 2013 09:53:38 +0200 Subject: [PATCH] Bug 10283: Hide "many items" on second tab when using OpacSeparateHoldings If there are over 50 items in the holdings or Other holdings tab, the warning and link 'This record has many physical items. Click here to view them all.' is only shown for the first tab. Test plan: - Switch on the OpacSeparateHoldings pref. - Go on a biblio detail page at the OPAC with more than 50 items - Check that the 'view all' link appears on the second tab. Signed-off-by: Srdjan Signed-off-by: Katrin Fischer Works as described, passes all tests and QA script. Signed-off-by: Galen Charlton (cherry picked from commit 363e986c60b8d3a0fc6badf3739e58fbb3e65801) Signed-off-by: Tomas Cohen Arazi --- koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt | 10 +++++++--- opac/opac-detail.pl | 5 ++++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt index 5ee94902eb..27f39134cc 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt @@ -1008,8 +1008,8 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
[% IF ( itemloop.size ) %] - [% IF ( lotsofitems ) %] -

This record has many physical items. Click here to view them all.

+ [% IF ( lotsofholdingsitems ) %] +

This record has many physical items. Click here to view them all.

[% ELSE %] [% INCLUDE items_table items=itemloop tab="holdings" %] [% END %] @@ -1044,7 +1044,11 @@ YAHOO.util.Event.onContentReady("furtherm", function () { [% IF (SeparateHoldings) %]
[% IF (otheritemloop.size) %] - [% INCLUDE items_table items=otheritemloop tab="otherholdings" %] + [% IF lotsofothersholdingsitems %] +

This record has many physical items. Click here to view them all.

+ [% ELSE %] + [% INCLUDE items_table items=otheritemloop tab="otherholdings" %] + [% END %] [% ELSE %] No other items. [% END %] diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl index 8bc66938e4..2db55088a1 100755 --- a/opac/opac-detail.pl +++ b/opac/opac-detail.pl @@ -624,7 +624,10 @@ if (scalar(@itemloop) == 0 || scalar(@otheritemloop) == 0) { # TODO: The limit of 50 could be a syspref my $viewallitems = $query->param('viewallitems'); if (scalar(@itemloop) >= 50 && !$viewallitems) { - $template->param('lotsofitems' => 1); + $template->param('lotsofholdingsitems' => 1); +} +if (scalar(@otheritemloop) >= 50 && !$viewallitems) { + $template->param('lotsofothersholdingsitems' => 1); } ## get notes and subjects from MARC record -- 2.39.5