Bug 17812 - Return focus to barcode field after toggling on-site checkouts
authorOwen Leonard <oleonard@myacpl.org>
Tue, 3 Jan 2017 15:08:32 +0000 (15:08 +0000)
committerKyle M Hall <kyle@bywatersolutions.com>
Mon, 8 May 2017 13:17:38 +0000 (09:17 -0400)
This patch changes the behavior of the checkout form so that after
checking boxes in the "checkout settings" panel the cursor focus is
automatically moved to the barcode field.

To test, apply the patch and enable OnSiteCheckouts and
decreaseLoanHighHolds system preferences.

- Open any patron account in circulation.
- Expand the "Checkout settings" panel.
- Click the label or checkbox for "Automatic renewal", "Don't
  decrease checkout length based on holds" and "On-site checkout"
- Confirm that the focus has moved to the barcode field.

Works as advertised.
Signed-off-by: Marc VĂ©ron <veron@veron.ch>

Signed-off-by: Marjorie Barry-Vila <marjorie.barry-vila@ccsr.qc.ca>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt
koha-tmpl/intranet-tmpl/prog/js/pages/circulation.js

index e133b95..d474196 100644 (file)
@@ -643,7 +643,7 @@ No patron matched <span class="ex">[% message | html %]</span>
                 [% IF NEEDSCONFIRMATION %]
                     <input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" disabled="disabled" />
                 [% ELSE %]
-                    <input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" />
+                    <input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" class="circ_setting" />
                 [% END %]
 
                 <label for="auto_renew">Automatic renewal</label>
@@ -658,9 +658,9 @@ No patron matched <span class="ex">[% message | html %]</span>
                         [% END %]
                     [% ELSE %]
                         [% IF override_high_holds %]
-                            <input type="checkbox" name="override_high_holds" id="override_high_holds" value="1" checked="checked" />
+                            <input type="checkbox" name="override_high_holds" id="override_high_holds" value="1" class="circ_setting" checked="checked" />
                         [% ELSE %]
-                            <input type="checkbox" name="override_high_holds" id="override_high_holds" value="1" />
+                            <input type="checkbox" name="override_high_holds" id="override_high_holds" value="1" class="circ_setting" />
                         [% END %]
                     [% END %]
                     <label for="override_high_holds">Don't decrease checkout length based on holds</label>
@@ -677,7 +677,7 @@ No patron matched <span class="ex">[% message | html %]</span>
                         <input type="hidden" name="onsite_checkout" checked="checked" value="1" />
                     </div>
                 [% ELSE %]
-                    <input type="checkbox" id="onsite_checkout" name="onsite_checkout" /> <label for="onsite_checkout">On-site checkout</label>
+                    <input type="checkbox" id="onsite_checkout" name="onsite_checkout" class="circ_setting" /> <label for="onsite_checkout">On-site checkout</label>
                 [% END %]
             </div>
         [% END %]
index 4683b5d..cbe274b 100644 (file)
@@ -77,6 +77,10 @@ $(document).ready(function() {
         }
     });
 
+    $(".circ_setting").on("click",function(){
+        $("#barcode").focus();
+    });
+
 });
 
 function export_checkouts(format) {