Bug 7469: put focus on 1st field of creation form instead of search box (Acquisition)
authorFridolyn SOMERS <fridolyn.somers@biblibre.com>
Tue, 6 Aug 2013 12:21:10 +0000 (14:21 +0200)
committerGalen Charlton <gmc@esilibrary.com>
Mon, 16 Sep 2013 15:53:17 +0000 (15:53 +0000)
When a user creates a new vendor, a new borrower or a new basket
(maybe on others page too, to be listed), a creation form is displayed,
but the focus is still on the search textbox on page top.

It would be probably better to switch the focus to the first field of
the creation form.

This patch adds the focus, for acquisitions module, on first input for
pages with a data creation or modification or pages with only one form
(like Z3950 search).

Test plan :
Go to pages and look where is the focus :
- acqui/basketgroup.pl : focus on "Basket group name:"
- acqui/basketheader.pl : focus on "Basket name:"
- acqui/invoices.tt : focus on "Invoice no:"
- acqui/modordernotes.pl : focus on "Notes:"
- acqui/neworderempty.pl : focus on "Title:"
- acqui/supplier.pl : focus on "Name:"
- acqui/z3950_search.pl : focus on "Title:"

Signed-off-by: Melia Meggs <melia@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
The focus choice is relevant and works as described.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basketgroup.tt
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basketheader.tt
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoices.tt
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/modordernotes.tt
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/z3950_search.tt

index d4027a5..b6cdc52 100644 (file)
@@ -182,7 +182,7 @@ function submitForm(form) {
                                        <fieldset id="various" class="brief">
                                        <ol>
                         <li><label for="basketgroupname">Basket group name:</label>
-                                                       <input type="text" name="basketgroupname" id="basketgroupname" value="[% name %]" /></li>
+                                                       <input type="text" name="basketgroupname" id="basketgroupname" value="[% name %]" class="focus" /></li>
                         <li><label for="billingplace">Billing place:</label>
                                                        <select name="billingplace" id="billingplace" style="width:13em;">
                                 <option value="">--</option>
index 49e704a..85fc946 100644 (file)
@@ -66,7 +66,7 @@ function Check(ff) {
                 [% END %]
                 <li>
                     <label for="basketname" class="required">Basket name: </label> &nbsp;
-                        <input type="text" name="basketname" id="basketname" size="40" maxlength="80" value="[% basketname %]" />
+                        <input type="text" name="basketname" id="basketname" size="40" maxlength="80" value="[% basketname %]" class="focus" />
                 </li>
                  <li>
                     <label for="billingplace">Billing place:</label>
index 584d787..40114ad 100644 (file)
@@ -145,7 +145,7 @@ $(document).ready(function() {
         <ol>
           <li>
             <label for="invoicenumber">Invoice no:</label>
-            <input type="text" id="invoicenumber" name="invoicenumber" value="[% invoicenumber %]" />
+            <input type="text" id="invoicenumber" name="invoicenumber" value="[% invoicenumber %]" class="focus" />
           </li>
           <li>
             <label for="supplier">Vendor:</label>
index 0961f4a..6fc4867 100644 (file)
@@ -16,7 +16,7 @@
       <form action="/cgi-bin/koha/acqui/modordernotes.pl" method="post">
         <fieldset class="brief">
           <label for="ordernotes">Notes:</label>
-          <textarea id="ordernotes" name="ordernotes" rows="3" cols="30">[% ordernotes %]</textarea>
+          <textarea id="ordernotes" name="ordernotes" rows="3" cols="30" class="focus">[% ordernotes %]</textarea>
         </fieldset>
         <input type="hidden" name="referrer" value="[% referrer %]" />
         <input type="hidden" name="ordernumber" value="[% ordernumber %]" />
index da8f88a..c7f9be0 100644 (file)
@@ -239,7 +239,7 @@ $(document).ready(function()
                 <input type="hidden" name="title" value="[% title |html %]" /> <span class="title">[% title |html %]</span>
             [% ELSE %]
             <label for="entertitle" class="required">Title: </label>
-                <input type="text" id="entertitle" size="50" name="title" value="[% title |html %]" />
+                <input type="text" id="entertitle" size="50" name="title" value="[% title |html %]" class="focus" />
             [% END %]
         </li>
         <li>
index 0dba956..2ac576a 100644 (file)
@@ -66,7 +66,7 @@ if (f.company.value == "") {
         <fieldset class="rows">
             <legend>Company details</legend>
             <ol><li><label for="company" class="required">Name: * </label>
-                <input type="text" size="40" id="company" name="company" value="[% name %]" /></li>
+                <input type="text" size="40" id="company" name="company" value="[% name %]" class="focus" /></li>
             <li><label for="company_postal">Postal address: </label>
                     <textarea id="company_postal" name="company_postal" cols="40" rows="3">[% postal %]</textarea></li>
             <li><label for="physical">Physical address: </label>
index 2983dc3..e1df515 100644 (file)
@@ -90,7 +90,7 @@ tr.selected { background-color : #FFFFCC; } tr.selected td { background-color :
        <div class="yui-g">
     <div class="yui-u first">
            <fieldset class="rows">
-                <ol><li><label for="searchtitle">Title: </label> <input type="text" id="searchtitle"  name="title" value="[% title |html %]" /></li>
+         <ol><li><label for="searchtitle">Title: </label> <input type="text" id="searchtitle"  name="title" value="[% title |html %]" class="focus" /></li>
                 <li><label for="isbn">ISBN: </label> <input type="text" id="isbn" name="isbn" value="[% isbn %]" /></li>
          <li><label for="lccall">LC call number: </label> <input type="text" id="lccall" name="lccall" value="" /></li>
          <li><label for="controlnumber">Control no.: </label> <input type="text" id="controlnumber" name="controlnumber" value="" /></li>