Bug 7338 Links on Serial Collection page
authorFrédéric Demians <f.demians@tamil.fr>
Fri, 9 Dec 2011 07:32:01 +0000 (08:32 +0100)
committerPaul Poulain <paul.poulain@biblibre.com>
Fri, 6 Jan 2012 14:10:35 +0000 (15:10 +0100)
Don't display link to the serial, when the collection page displays just
one subscription. Display it when several subscriptions. Alway display a
link for displaying biblio record other subscriptions.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Patch works nicely, but always shows link to 'any subscriptions'.
I did a follow-up so the link would only show if there was more
than 1 subscription for the record.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>

koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tt
serials/serials-collection.pl

index 93c4fdc..ed126af 100644 (file)
@@ -71,7 +71,7 @@ $(document).ready(function() {
 
 [% IF ( subscriptions ) %]
 <table>
-[% IF ( onesubscription ) %]
+[% IF ( subscriptions.size == 1 ) %]
 <caption> Subscription Summary</caption>
 [% ELSE %]
 <caption> Subscription Summaries</caption>
@@ -161,9 +161,8 @@ $(document).ready(function() {
       </tr>
 [% END %]
 [% IF ( subscr ) %]
-[% UNLESS ( onesubscription ) %]
-<tr ><td colspan="7">  <a href="serials-collection.pl?biblionumber=[% biblionumber %]">See any subscription attached to this biblio</a></td>
-</tr>[% END %]
+<tr ><td colspan="8">  <a href="serials-collection.pl?biblionumber=[% biblionumber %]">See any subscription attached to this biblio</a></td>
+</tr>
 [% END %]
 </table>
 [% END %]
@@ -183,7 +182,7 @@ $(document).ready(function() {
 <div id="subscription-year-[% year.year %]">
         <table>
          <tr>
-[% UNLESS ( year.onesubscription ) %]
+[% IF ( subscriptions.size > 1 ) %]
                 <th># Subs</th>
 [% END %]
                 <th>Date published
@@ -205,7 +204,7 @@ $(document).ready(function() {
             </tr>
       [% FOREACH serial IN year.serials %]
     [% UNLESS ( loop.odd ) %]<tr class="highlight">[% ELSE %]<tr>[% END %]
-[% UNLESS ( serial.onesubscription ) %]
+[% IF ( subscriptions.size > 1 ) %]
                  <td><a href="serials-collection.pl?subscriptionid=[% serial.subscriptionid %]">[% serial.subscriptionid %]</a></td>
 [% END %]
                 <td>
index 8c7c32b..c4605e0 100755 (executable)
@@ -147,7 +147,6 @@ foreach (@$location) {
 
 chop $subscriptionidlist;
 $template->param(
-          onesubscription => (scalar(@$subscriptiondescs)==1),
           subscriptionidlist => $subscriptionidlist,
           biblionumber => $biblionumber,
           subscriptions => $subscriptiondescs,