Merge remote-tracking branch 'origin/new/bug_7310'
[koha_fer] / koha-tmpl / intranet-tmpl / prog / en / modules / acqui / lateorders.tt
index 8227722..cf54b03 100644 (file)
@@ -1,22 +1,27 @@
+[% USE KohaDates %]
 [% 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>
+[% INCLUDE 'calendar.inc' %]
 <script type="text/javascript">
 //<![CDATA[
 $(document).ready(function() {
     $("input:checkbox[name=claim_for]").click(function(){
-        var supplierid = $(this).attr('supplierid');
+        var booksellerid = $(this).attr('booksellerid');
         if ( $("input:checkbox[name=claim_for]:checked").length > 0) {
-            $("input:checkbox[name=claim_for][supplierid!="+supplierid+"]").attr('disabled', true);
+            $("input:checkbox[name=claim_for][booksellerid!="+booksellerid+"]").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>
+<body id="acq_lateorders" class="acq">
 [% INCLUDE 'header.inc' %]
 [% INCLUDE 'acquisitions-search.inc' %]
 
@@ -32,16 +37,20 @@ $(document).ready(function() {
 <div id="acqui_lateorders">
 
 [% IF error_claim %]
-    <div class="error">[% error_claim %]</div>
+    [% 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">[% info_claim %]</div>
+    <div class="dialog message">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 %]" />
+  <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
        [% IF ( letters ) %]
        <p><label for="letter_code">Claim using notice: </label><select name="letter_code" id="letter_code">
          [% FOREACH letter IN letters %]
@@ -50,18 +59,18 @@ $(document).ready(function() {
          </select>
        </p>
        [% END %]
-    <table>
+    <table id="late_orders">
         <tr>
-            <th>Order Date</th>
+            <th>Order date</th>
+            <th>Estimated delivery date</th>
             <th>Vendor</th>
             <th>Information</th>
             <th>Total cost</th>
             <th>Basket</th>
             <th>Claims count</th>
             <th>Claimed date</th>
-            <!-- TMPL_IF name="Supplier" -->
             [% IF Supplier %]
-                <th><input type="checkbox" id="checkAll"></th>
+                <th><a id="CheckAll" href="#">Check all</a><br /><a id="CheckNone" href="#">Uncheck all</a></th>
             [% ELSE %]
                 <th></th>
             [% END %]
@@ -75,6 +84,11 @@ $(document).ready(function() {
                 ([% lateorder.latesince %] days)
             </td>
             <td>
+                [% IF ( lateorder.estimateddeliverydate ) %]
+                    [% lateorder.estimateddeliverydate | $KohaDates  %]
+                [% END %]
+            </td>
+            <td>
                 [% lateorder.supplier %]
             </td>
             <td>
@@ -103,7 +117,7 @@ $(document).ready(function() {
             <td>[% lateorder.claimed_date %]</td>
             <td>
                 [% UNLESS lateorder.budget_lock %]
-                    <input type="checkbox" name="claim_for" value="[% lateorder.ordernumber %]"  supplierid="[% lateorder.supplierid %]"/>
+                    <input type="checkbox" class="checkbox" name="claim_for" value="[% lateorder.ordernumber %]"  booksellerid="[% lateorder.supplierid %]"/>
                 [% END %]
              </td>
             </td>
@@ -111,7 +125,7 @@ $(document).ready(function() {
         [% END %]
         <tr> 
             <th>Total</th>
-            <th colspan="2">&nbsp;</th>
+            <th colspan="3">&nbsp;</th>
             <th>[% total %]</th>
             <th>&nbsp;</th>
             <th>&nbsp;</th>
@@ -134,9 +148,40 @@ $(document).ready(function() {
 [% FOREACH ERROR_LOO IN ERROR_LOOP %]
 [% IF ( ERROR_LOO.delay_digits ) %]<p class="error">The number of days ([% ERROR_LOO.bad_delay %]) must be a number between 0 and 999.</p>[% END %]
 [% END %]
-<ol><li><label for="delay">Order date:</label><input size="3" maxlength="3" id="delay" type="text" name="delay" value="[% delay %]" /> days ago</li>
-       <li><label for="supplierid">Vendor:</label>
-               <select id="supplierid" size="1" tabindex="" name="supplierid">
+<ol>
+    <li><label for="delay">Order date:</label><input size="3" maxlength="3" id="delay" type="text" name="delay" value="[% delay %]" /> days ago</li>
+    <li><label for="delay">Estimated Delivery date from: </label>
+        <input type="text" size="10" id="estimateddeliverydatefrom" name="estimateddeliverydatefrom" value="[% estimateddeliverydatefrom %]" />
+        <img src="[% themelang %]/lib/calendar/cal.gif" id="openCalendarFrom" style="cursor: pointer;" alt="Show Calendar" />
+        <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
+    </li>
+    <li><label for="delay">To: </label>
+        <input type="text" size="10" id="estimateddeliverydateto" name="estimateddeliverydateto" value="[% estimateddeliverydateto %]" />
+        <img src="[% themelang %]/lib/calendar/cal.gif" id="openCalendarTo" style="cursor: pointer;" alt="Show Calendar" />
+        <script type="text/javascript">
+            // return true if the date is blocked.
+            function disable_from(date) {var limit = get_Calendar_limit(date,'estimateddeliverydatefrom'); return (limit && limit < date);}
+            function disable_to(date) {var limit = get_Calendar_limit(date,'estimateddeliverydateto'); return (limit && limit < date);}
+            Calendar.setup({
+                inputField : "estimateddeliverydatefrom",
+                ifFormat : "[% DHTMLcalendar_dateformat %]",
+                button : "openCalendarFrom",
+                disableFunc : disable_from,
+                dateStatusFunc : disable_from
+            });
+            Calendar.setup({
+                inputField : "estimateddeliverydateto",
+                ifFormat : "[% DHTMLcalendar_dateformat %]",
+                button : "openCalendarTo",
+                disableFunc : disable_to,
+                dateStatusFunc : disable_to
+             });
+        </script>
+        <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
+    </li>
+
+       <li><label for="booksellerid">Vendor:</label>
+               <select id="booksellerid" size="1" tabindex="" name="booksellerid">
                        <option value=""/>
                        [% FOREACH SUPPLIER_LOO IN SUPPLIER_LOOP %]
                 [% IF ( SUPPLIER_LOO.selected ) %]<option value="[% SUPPLIER_LOO.id %]" selected="selected">[% SUPPLIER_LOO.name %]</option>