Bug 10283: Hide "many items" on second tab when using OpacSeparateHoldings
authorJonathan Druart <jonathan.druart@biblibre.com>
Mon, 20 May 2013 07:53:38 +0000 (09:53 +0200)
committerGalen Charlton <gmc@esilibrary.com>
Thu, 31 Oct 2013 16:53:56 +0000 (16:53 +0000)
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 <srdjan@catalyst.net.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described, passes all tests and QA script.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt
opac/opac-detail.pl

index e5d9c3c..05c4010 100644 (file)
@@ -1039,8 +1039,8 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
 
 <div id="holdings">
 [% IF ( itemloop.size ) %]
-    [% IF ( lotsofitems ) %]
-       <p>This record has many physical items. <a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblionumber %]&amp;viewallitems=1#holdings">Click here to view them all.</a></p>
+    [% IF ( lotsofholdingsitems ) %]
+        <p>This record has many physical items. <a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblionumber %]&amp;viewallitems=1#holdings">Click here to view them all.</a></p>
     [% ELSE %]
         [% INCLUDE items_table items=itemloop tab="holdings" %]
     [% END %]
@@ -1076,7 +1076,11 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
 [% IF (SeparateHoldings) %]
     <div id="otherholdings">
         [% IF (otheritemloop.size) %]
-            [% INCLUDE items_table items=otheritemloop tab="otherholdings" %]
+            [% IF lotsofothersholdingsitems %]
+                <p>This record has many physical items. <a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblionumber %]&amp;viewallitems=1#otherholdings">Click here to view them all.</a></p>
+            [% ELSE %]
+                [% INCLUDE items_table items=otheritemloop tab="otherholdings" %]
+            [% END %]
         [% ELSE %]
             No other items.
         [% END %]
index 5bbf0fb..41de4fd 100755 (executable)
@@ -631,7 +631,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