Bug 9875: Hide empty items tab
authorJulian Maurice <julian.maurice@biblibre.com>
Thu, 10 Jan 2013 16:01:37 +0000 (17:01 +0100)
committerJared Camins-Esakov <jcamins@cpbibliography.com>
Wed, 20 Mar 2013 18:37:52 +0000 (14:37 -0400)
The two holdings tabs displayed whether
or not there is anything to go in them.

Signed-off-by: Corinne Bulac <corinne.hayet@bulac.fr>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
If one item list is empty, no empty tab is shown.
All tests and QA script pass.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>

catalogue/detail.pl
opac/opac-detail.pl

index ec6f6eb..a5b32c6 100755 (executable)
@@ -281,6 +281,14 @@ foreach my $item (@items) {
     }
 }
 
+# Display only one tab if one items list is empty
+if (scalar(@itemloop) == 0 || scalar(@otheritemloop) == 0) {
+    $template->param(SeparateHoldings => 0);
+    if (scalar(@itemloop) == 0) {
+        @itemloop = @otheritemloop;
+    }
+}
+
 $template->param( norequests => $norequests );
 $template->param(
        MARCNOTES   => $marcnotesarray,
index 883ea7c..4371f65 100755 (executable)
@@ -576,6 +576,14 @@ for my $itm (@items) {
     }
 }
 
+# Display only one tab if one items list is empty
+if (scalar(@itemloop) == 0 || scalar(@otheritemloop) == 0) {
+    $template->param(SeparateHoldings => 0);
+    if (scalar(@itemloop) == 0) {
+        @itemloop = @otheritemloop;
+    }
+}
+
 # If there is a lot of items, and the user has not decided
 # to view them all yet, we first warn him
 # TODO: The limit of 50 could be a syspref