Bug 7521: Templates should use receive_serials permission
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / serials / serials-collection.tt
index 9717899..7b8efef 100644 (file)
@@ -64,13 +64,14 @@ $(document).ready(function() {
 [% UNLESS ( popup ) %]
        [% INCLUDE 'serials-toolbar.inc' %]
 
-       <h1>Serial Collection information for  <i>[% bibliotitle %]</i> ([% location %] ) 
+       <h1>Serial Collection information for  <i>[% bibliotitle %]</i>
+        [% IF location %] ([% location %] ) [% END %]
                [% IF ( callnumber ) %]callnumber: [% callnumber %][% END %]</h1>
 [% END %]
 
 [% IF ( subscriptions ) %]
 <table>
-[% IF ( onesubscription ) %]
+[% IF ( subscriptions.size == 1 ) %]
 <caption> Subscription Summary</caption>
 [% ELSE %]
 <caption> Subscription Summaries</caption>
@@ -160,9 +161,10 @@ $(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 %]
+[% IF ( subscriptioncount > 1 ) %]
+<tr ><td colspan="8">  <a href="serials-collection.pl?biblionumber=[% biblionumber %]">See any subscription attached to this biblio</a></td>
+</tr>
+[% END %]
 [% END %]
 </table>
 [% END %]
@@ -180,9 +182,9 @@ $(document).ready(function() {
 
  [% FOREACH year IN years %]
 <div id="subscription-year-[% year.year %]">
-        <table style="width:400px;">
+        <table>
          <tr>
-[% UNLESS ( year.onesubscription ) %]
+[% IF ( subscriptions.size > 1 ) %]
                 <th># Subs</th>
 [% END %]
                 <th>Date published
@@ -199,12 +201,12 @@ $(document).ready(function() {
                 </th>
                <th>Routing
                </th>
-                <th>Edit
-                </th>
+
+                [% IF ( CAN_user_serials_receive_serials ) %]<th>Edit</th>[% END %]
             </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>
@@ -228,6 +230,7 @@ $(document).ready(function() {
                <td>
                   <a href="" onclick="print_slip([% serial.subscriptionid |html %], '[% serial.serialseq |html %]'); return false" >Print list</a>
                </td>
+            [% IF ( CAN_user_serials_receive_serials ) %]
                 <td>
                   [% IF ( serial.cannotedit ) %]
                     disabled
@@ -243,10 +246,16 @@ $(document).ready(function() {
                     [% END %]
                   [% END %]
                 </td>
+            [% END %]
             </tr>
       [% END %]
         </table>
-      <p><input type="submit" value="Edit serials" />&nbsp;<input type="button" value="Generate Next" onclick="javascript:generateNext([% year.subscriptionidlist %])" /></p>
+    [% IF ( CAN_user_serials_receive_serials ) %]
+        <p>
+            <input type="submit" value="Edit serials" />&nbsp;
+            <input type="button" value="Generate Next" onclick="javascript:generateNext([% subscriptionidlist %])" />
+        </p>
+    [% END %]
     </div>
     [% END %]
   <input type="hidden" name="subscriptionid" value="[% subscriptionidlist %]" />