From 43886c983da575717db255c56dc08ad766cf2b89 Mon Sep 17 00:00:00 2001
From: Martin Stenberg <martin@xinxidi.net>
Date: Thu, 5 Nov 2015 13:58:55 +0100
Subject: [PATCH] Bug 15116: Show menu at the top of batch circ page

This patch adds the user interaction menu to the top of the batch checkout
page, places focus on the barcode text field and adds a discrete shortcut link
for printing receipts.

Signed-off-by: Frederic Demians <f.demians@tamil.fr>
  Works as promised. Improve batch checkout general UI workflow.
---
 .../en/modules/circ/circulation_batch_checkouts.tt   | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation_batch_checkouts.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation_batch_checkouts.tt
index 4e392d2..3f3fb8a 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation_batch_checkouts.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation_batch_checkouts.tt
@@ -21,6 +21,18 @@
 <script type="text/javascript">
 //<![CDATA[
 $(document).ready(function() {
+        if($('#barcodelist').length) {
+            $('#barcodelist').focus();
+        } else if ($('#checkoutrenew').length) {
+            $('#checkoutrenew').focus();
+        } else if ($('#printslipshortcut').length) {
+            $('#printslipshortcut').focus();
+        }
+
+        $('#printslipshortcut').on('click', function(){
+            $('#printslip').click();
+        });
+
         $("#issuest").dataTable($.extend(true, {}, dataTablesDefaults, {
             "sDom": 't',
             "aaSorting": [],
@@ -52,6 +64,10 @@ $(document).ready(function() {
 
 <div class="yui-g">
 
+[% IF ( borrowernumber ) %]
+[% INCLUDE 'members-toolbar.inc' %]
+[% END %]
+
 [% IF NOT batch_allowed %]
   <div class="dialog message">You are not allowed to use batch checkout for this patron</div>
 [% ELSIF NOT checkout_infos %]
@@ -256,8 +272,10 @@ $(document).ready(function() {
       <input type="hidden" name="debt_confirmed" value="1" />
       <input type="hidden" name="branch" value="[% branch %]" />
       <input type="hidden" name="batch" value="1" />
-      <input type="submit" class="approve" value="Checkout or renew" />
+      <input type="submit" id="checkoutrenew" class="approve" value="Checkout or renew" />
     </form>
+    [% ELSE %]
+        <p><a href="#" id="printslipshortcut">Print slip</a></p>
     [% END %]
 
 [% END %]
-- 
2.6.2