auto focus on search box
[koha_fer] / koha-tmpl / intranet-tmpl / prog / en / catalogue / advsearch.tmpl
index c641ae0..45a6a1b 100644 (file)
@@ -1,4 +1,6 @@
-<!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->Koha -- Catalogue: Advanced Search<!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
+<!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
+<title>Koha &rsaquo; Catalogue &rsaquo; Advanced Search</title>
+<!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
 <!-- TMPL_INCLUDE NAME="menus.inc" -->
 <!-- TMPL_INCLUDE NAME="menu-catalogue.inc" -->
 
@@ -7,7 +9,7 @@
 <!-- TMPL_IF NAME="expanded_options" -->
 <h1>Advanced Search</h1>
 <!-- TMPL_ELSE -->
-<h1>Search the Library Catalogue</h1>
+<h1>Search the Catalogue</h1>
 <!-- /TMPL_IF -->
 
 <!-- TMPL_IF NAME="if_expanded_options_actually_worked" -->
     </fieldset>
 <!-- /REMOTE DATABASES -->
 <!-- /TMPL_IF -->
-<!-- TMPL_ELSE -->
-<h3>Search the Library Catalogue</h3>
 <!-- /TMPL_IF -->
 
 <!-- BOOLEAN SEARCH OPTIONS -->
     <fieldset>
-    <!-- TMPL_IF NAME="expanded_options" --><legend>Search For: </legend><!-- /TMPL_IF --> 
+    <legend>Search For: </legend>
     <!-- TMPL_LOOP NAME="search_boxes_loop" -->
 
-        <!-- TMPL_IF NAME="expanded_options" --><!-- TMPL_IF NAME="search_boxes_label" --><p style="text-indent: 4.5em;"><!-- TMPL_ELSE --><p><!-- /TMPL_IF --><!-- TMPL_ELSE --><p><!-- /TMPL_IF -->
+        <!-- TMPL_IF NAME="expanded_options" -->
+            <!-- TMPL_IF NAME="scan_index" -->
+                <p><label for='scan'>Scan Indexes</label><input type='checkbox' name='scan' id='scan' value='1'/></p>
+            <!-- /TMPL_IF -->
+        <!-- /TMPL_IF -->
+            <p>
         <!-- TMPL_IF NAME="expanded_options" -->
             <select name='op'>
                 <option value='and' selected='selected'>and</option>
@@ -68,6 +73,7 @@
     <option value="nt" <!-- TMPL_IF NAME="selected" -->selected="<!-- TMPL_VAR NAME="selected" -->"<!-- /TMPL_IF -->>Notes/Comments</option>
     <option value="pb" <!-- TMPL_IF NAME="selected" -->selected="<!-- TMPL_VAR NAME="selected" -->"<!-- /TMPL_IF -->>Publisher</option>
     <option value="pl" <!-- TMPL_IF NAME="selected" -->selected="<!-- TMPL_VAR NAME="selected" -->"<!-- /TMPL_IF -->>Publisher Location</option>
+    <option value="yr" <!-- TMPL_IF NAME="selected" -->selected="<!-- TMPL_VAR NAME="selected" -->"<!-- /TMPL_IF -->>Publication Date</option>
     <option value="sn" <!-- TMPL_IF NAME="selected" -->selected="<!-- TMPL_VAR NAME="selected" -->"<!-- /TMPL_IF -->>Standard Number</option>
     <option value="nb" <!-- TMPL_IF NAME="selected" -->selected="<!-- TMPL_VAR NAME="selected" -->"<!-- /TMPL_IF -->>&nbsp;&nbsp;&nbsp;&nbsp; ISBN</option>
     <option value="ns" <!-- TMPL_IF NAME="selected" -->selected="<!-- TMPL_VAR NAME="selected" -->"<!-- /TMPL_IF -->>&nbsp;&nbsp;&nbsp;&nbsp; ISSN</option>
     <option value="bc" <!-- TMPL_IF NAME="selected" -->selected="<!-- TMPL_VAR NAME="selected" -->"<!-- /TMPL_IF -->>Barcode</option>
 
         </select>
-        <input type="text" size="30" name="q" title="Enter search terms" value=""/>
-            <!-- TMPL_IF NAME="expanded_options" -->
-        <!-- TMPL_IF NAME="scan_index" --><input type='checkbox' name='scan' id='scan' value='1'/><label for='scan'>Scan Indexes</label><!-- /TMPL_IF -->
-        <!-- TMPL_IF NAME="add_field" --><a href="JavaScript:add_field();" id="ButtonPlus" title="Add another field">[+]</a><!-- /TMPL_IF -->
+        <input id="search_box" type="text" size="30" name="q" title="Enter search terms" value=""/>
+        <!-- TMPL_IF NAME="expanded_options" -->
+            <!-- TMPL_IF NAME="add_field" -->
+                <a href="JavaScript:add_field();" id="ButtonPlus" title="Add another field">[+]</a>
             <!-- /TMPL_IF -->
-        </p>
+        <!-- /TMPL_IF -->
 
     <!-- /TMPL_LOOP -->
     </fieldset>
 <!-- /BOOLEAN SEARCH OPTIONS -->
-<fieldset style="margin-right:20%">
-    <legend>Itemtype to: match any of the following </legend>
-    <p>
+    <div id="itemtypelist">
+    <h2>Itemtype limit to any of the following:</h2>
+    <table>
+        <tr>
       <!--TMPL_LOOP Name="itemtypeloop"-->
-        <input type="checkbox" id="mt-<!--TMPL_VAR Name="number" -->" name="limit" value="mt:<!--TMPL_VAR Name="code" -->"/><img border="0" src="<!--TMPL_VAR Name="imageurl" -->" alt="<!--TMPL_VAR Name="description" -->" title="<!--TMPL_VAR Name="description" -->"/>
-        <!-- TMPL_UNLESS name="count5" --></p><p><!-- /TMPL_UNLESS -->
+        <td><p>
+        <!-- TMPL_IF name="imageurl"--><img border="0" src="<!--TMPL_VAR Name="imageurl" -->" alt="<!--TMPL_VAR Name="description" -->" /><!-- /TMPL_IF --><input type="checkbox" id="mt-<!--TMPL_VAR Name="number" -->" name="limit" value="mt:<!--TMPL_VAR Name="code" -->"/>&nbsp;
+        <!--TMPL_VAR Name="description" --></p></td>
+        <!-- TMPL_UNLESS name="count5" --></tr><tr><!-- /TMPL_UNLESS -->
       <!--/TMPL_LOOP-->
-      </p>
-    </p>
-</fieldset>
-
+      </tr>
+    </table>
+    </div>
 <!-- TMPL_IF NAME="expanded_options" -->
 <!-- BASIC LIMITS -->
 <!--TMPL_IF Name="usmarc"-->
 <!-- AVAILABILITY LIMITS -->
     <fieldset><legend>Location and availability: </legend>
         <p>
-        <label>Branch</label><select name="limit" id="branchloop">
+        <label>Library</label><select name="limit" id="branchloop">
         <!-- TMPL_LOOP NAME="branchloop" -->
         <option value="<!-- TMPL_VAR NAME='value' -->"><!-- TMPL_VAR NAME='branchname' --></option>
         <!-- /TMPL_LOOP -->
             <!-- TMPL_ELSE -->
             <a href="/cgi-bin/koha/catalogue/search.pl?expanded_options=1">[More options]</a>
             <!-- /TMPL_IF -->
-            <a href="/cgi-bin/koha/catalogue/search.pl?do=Clear">[New Search]</a> 
+            <a href="/cgi-bin/koha/catalogue/search.pl?do=Clear">[New search]</a> 
             </p>
 <!-- /SEARCH BUTTONS -->
 </div>
 </form>
 
 <script type="text/JavaScript" language="JavaScript">
-       /**
-        *  Function add_field();
-     *  This function allows to display a new field to search.
-     */
-       function add_field() {
-               var ButtonPlus = document.getElementById('ButtonPlus');
-               var line       = ButtonPlus.parentNode;
-               var dad        = line.parentNode;
-               dad.appendChild(line.cloneNode(true));
-               line.removeChild(ButtonPlus);
-       }
+
+document.getElementById('search_box').focus(); // auto focus on the search input.
+
+/**
+ *  Function add_field();
+ *  This function allows to display a new field to search.
+ */
+function add_field() {
+    var ButtonPlus = document.getElementById('ButtonPlus');
+    var line       = ButtonPlus.parentNode;
+    var dad        = line.parentNode;
+    dad.appendChild(line.cloneNode(true));
+    line.removeChild(ButtonPlus);
+}
+
 </script>
 
 <!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->