Merge branch 'bug_8557' into 3.12-master
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / acqui / orderreceive.tt
index c6559c3..e88f9ce 100644 (file)
@@ -4,6 +4,25 @@
 [% INCLUDE 'additem.js.inc' %]
 <script type="text/javascript" src="[% themelang %]/js/additem.js"> </script>
 <script type="text/javascript">
+
+var nav = window.Event ? true : false;
+if (nav) {
+       window.captureEvents(Event.KEYDOWN);
+       window.onkeydown = NetscapeEventHandler_KeyDown;
+} else {
+       document.onkeydown = IEEventHandler_KeyDown;
+}
+
+function NetscapeEventHandler_KeyDown(e) {
+       if (e.which == 13 && e.target.type != 'textarea' && e.target.type != 'submit') { return false; }
+       return true;
+}
+
+function IEEventHandler_KeyDown() {
+       if (event.keyCode == 13 && event.srcElement.type != 'textarea' && event.srcElement.type != 'submit')
+               return false;
+       return true;
+}
 //<![CDATA[
     function Check(form) {
         [% IF (AcqCreateItemReceiving) %]
                 }
             });
 
-            var alertString;
-            if (total_errors==0) {
-                return true;
-            } else {
-                alertString  = _("Form not submitted because of the following problem(s)");
+            if (total_errors != 0) {
+                var alertString = _("Form not submitted because of the following problem(s)");
                 alertString += "\n------------------------------------------------------------------------------------\n";
                 alertString += "\n- "+ total_errors+_(" mandatory fields empty (highlighted)");
                 alert(alertString);
                 return false;
             }
 
+            if(check_additem('[% UniqueItemFields %]') == false){
+                alert(_('Duplicate values detected. Please correct the errors and resubmit.') );
+                return false;
+            };
+
             // Remove last itemblock if it is not in items_list
             var lastitemblock = $("#outeritemblock > div:last");
             var tobedeleted = true;
             if(tobedeleted){
                 $(lastitemblock).remove();
             }
-
-            if(check_additem('[% UniqueItemFields %]') == false){
-                alert(_('Duplicate values detected. Please correct the errors and resubmit.') );
-                if(tobedeleted) {
-                    $(lastitemblock).appendTo("#outeritemblock");
-                }
-                return false;
-            };
         [% END %]
 
         return true;
                             <th>&nbsp;</th>
                             <th>&nbsp;</th>
                             <th>Barcode</th>
-                            <th>Home branch</th>
-                            <th>Holding branch</th>
+                            <th>Home library</th>
+                            <th>Holding library</th>
                             <th>Not for loan</th>
                             <th>Restricted</th>
                             <th>Location</th>
 
 </div>
 </div><div class="yui-g"><fieldset class="action">
-        <input type="submit"  value="Save" />
+        <input type="submit"  value="Save" class="button" accesskey="w" />
         <a class="cancel" href="/cgi-bin/koha/acqui/parcel.pl?invoiceid=[% invoiceid %]">Cancel</a>
 </fieldset></div>    </form>
 [% ELSE %]
-<div id="acqui_acquire_orderlist">
-    <table>
-    <tr>
-        <th>Basket</th>
-        <th>ISBN</th>
-        <th>Title</th>
-        <th>Author</th>
-        <th>Qty</th>
-        <th>Received</th>
-    </tr>
-    [% FOREACH loo IN loop %]
-        <tr>
-            <td>[% loo.basketno %]</td>
-            <td>[% loo.isbn %]</td>
-         <td><a href="orderreceive.pl?ordernumber=[% loo.ordernumber %]&amp;invoiceid=[% invoiceid %]">[% loo.title |html %]</a></td>
-            <td>[% loo.author %]</td>
-            <td>[% loo.quantity %]</td>
-            <td>[% loo.quantityreceived %]</td>
-        </tr>
-    [% END %]
-    </table>
-</div>
+    This ordernumber does not exist.
 [% END %]
 
 </div>