Bug 5347: Set translatable the "no email" error
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / acqui / lateorders.tt
index 1e64e1f..cca2d8f 100644 (file)
@@ -1,6 +1,23 @@
 [% INCLUDE 'doc-head-open.inc' %]
 <title>Koha &rsaquo; Acquisitions &rsaquo; Late orders</title>
 [% INCLUDE 'doc-head-close.inc' %]
+<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
+<script type="text/javascript">
+//<![CDATA[
+$(document).ready(function() {
+    $("input:checkbox[name=claim_for]").click(function(){
+        var supplierid = $(this).attr('supplierid');
+        if ( $("input:checkbox[name=claim_for]:checked").length > 0) {
+            $("input:checkbox[name=claim_for][supplierid!="+supplierid+"]").attr('disabled', true);
+        } else {
+            $("input:checkbox[name=claim_for]").attr('disabled', false);
+        }
+    });
+    $('#CheckAll').click(function(){ $("#late_orders td").checkCheckboxes();});
+    $('#CheckNone').click(function(){ $("#late_orders td").unCheckCheckboxes();});
+});
+//]]>
+</script>
 </head>
 <body>
 [% INCLUDE 'header.inc' %]
 <h1>[% IF ( Supplier ) %][% Supplier %] : [% END %]Late orders</h1>
 <div id="acqui_lateorders">
 
+[% IF error_claim %]
+    [% IF ( error_claim == "no_email" ) %]
+        <div class="error">This vendor has no email</div>
+    [% ELSE %]
+        <div class="error">[% error_claim %]</div>
+    [% END %]
+[% END %]
+[% IF info_claim %]
+    <div class="info">Email has been sent.</div>
+[% END %]
 [% IF ( lateorders ) %]
 <form action="lateorders.pl" name="claim" method="post">
   <input type="hidden" name="op" value="send_alert" />
+  <input type="hidden" name="delay" value="[% delay %]" />
+  <input type="hidden" name="supplierid" value="[% SupplierId %]" />
        [% IF ( letters ) %]
        <p><label for="letter_code">Claim using notice: </label><select name="letter_code" id="letter_code">
          [% FOREACH letter IN letters %]
          </select>
        </p>
        [% END %]
-    <table>
+    <table id="late_orders">
         <tr>
             <th>Order Date</th>
             <th>Vendor</th>
             <th>Information</th>
             <th>Total cost</th>
             <th>Basket</th>
-            <th>&nbsp;</th>
+            <th>Claims count</th>
+            <th>Claimed date</th>
+            [% IF Supplier %]
+                <th><a id="CheckAll" href="#">Check all</a><br /><a id="CheckNone" href="#">Uncheck all</a></th>
+            [% ELSE %]
+                <th></th>
+            [% END %]
         </tr>
     [% FOREACH lateorder IN lateorders %]
         [% UNLESS ( loop.odd ) %]<tr class="highlight">
         [% ELSE %]<tr>[% END %]
             <td>
+                ([% lateorder.supplierid %])
                 [% lateorder.orderdate %]
                 ([% lateorder.latesince %] days)
             </td>
                  </p>
                  <p title="branch">[% lateorder.branch %]</p>
             </td>
+            <td>[% lateorder.claims_count %]</td>
+            <td>[% lateorder.claimed_date %]</td>
             <td>
-                <input type="checkbox" name="claim_for" value="[% lateorder.ordernumber %]" />
+                [% UNLESS lateorder.budget_lock %]
+                    <input type="checkbox" class="checkbox" name="claim_for" value="[% lateorder.ordernumber %]"  supplierid="[% lateorder.supplierid %]"/>
+                [% END %]
+             </td>
             </td>
         </tr>
         [% END %]
             <th colspan="2">&nbsp;</th>
             <th>[% total %]</th>
             <th>&nbsp;</th>
+            <th>&nbsp;</th>
+            <th>&nbsp;</th>
             <td>
                 <input type="submit" value="Claim Order" />
             </td>