Revert "Modifying styling of resident search boxes in order to prevent brief appearan...
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / includes / cataloging-search.inc
1 <!-- Begin Cataloging Resident Search Box -->
2 <!-- TMPL_IF NAME="CircAutocompl" --><script type="text/javascript">
3 //<![CDATA[
4 YAHOO.util.Event.onContentReady("header_search", function() {
5     new function() {
6         // Define a custom formatter function
7         this.fnCustomFormatter = function(oResultItem, sQuery) {
8             var name        = oResultItem[0];
9             var cardnumber  = oResultItem[1];
10             var address     = oResultItem[2];
11             var city        = oResultItem[3];
12             var zip         = oResultItem[4];
13             var aMarkup = [
14                 "<div class=\"sample-result\">",
15                 name,
16                 " (",
17                 cardnumber,
18                 ")<small> -- ",
19                 address,
20                 ", ",
21                 city,
22                 "</small>",
23                 "</div>"];
24             return (aMarkup.join(""));
25         };
26
27         // Instantiate one XHR DataSource and define schema as an array:
28         //     ["Record Delimiter",
29         //     "Field Delimiter"]
30         this.oACDS = new YAHOO.widget.DS_XHR("/cgi-bin/koha/circ/ysearch.pl", ["\n", "\t"]);
31         this.oACDS.responseType = YAHOO.widget.DS_XHR.TYPE_FLAT;
32         this.oACDS.maxCacheEntries = 60;
33         this.oACDS.queryMatchSubset = true;
34     
35         // Instantiate first AutoComplete
36         var myInput = document.getElementById('findborrower');
37         var myContainer = document.getElementById('yborrowercontainer');
38         this.oAutoComp = new YAHOO.widget.AutoComplete(myInput,myContainer,this.oACDS);
39         //this.oAutoComp.delimChar = ";";
40         //this.oAutoComp.queryDelay = 1;
41         this.oAutoComp.formatResult = this.fnCustomFormatter;
42 }
43 });
44 //]]>
45 </script><!-- /TMPL_IF -->
46 <div id="header_search">
47 <div id="addbooks_search" class="residentsearch">
48         <p class="tip">Search the catalog and the reservoir:</p>
49         <form name="search" action="addbooks.pl">
50         <input type="text" name="q"  size="40" class="focus" />
51         <input type="submit" value="Search" />
52         </form>
53 </div>
54         <div id="circ_search" class="residentsearch">
55         <p class="tip">Enter patron card number or partial name:</p>
56     <form action="/cgi-bin/koha/circ/circulation.pl" method="post">
57     <!-- TMPL_IF NAME="CircAutocompl" -->
58     <div class="autocomplete">
59             <div id="borrowerautocomplete" class="autocomplete">
60                 <input autocomplete="off" id="findborrower" name="findborrower" class="focus" type="text" />
61                 <div id="yborrowercontainer"></div>
62                 <input id="ysearchsubmit" type="submit" value="Submit" />
63                 <input name="branch" value="<!-- TMPL_VAR name="branch" -->" type="hidden" />
64                 <input name="printer" value="" type="hidden" />
65             </div>
66         </div>
67         <!-- TMPL_ELSE -->
68             <input id="findborrower" name="findborrower" size="40" class="focus" type="text" />
69             <input name="branch" value="<!-- TMPL_VAR name="branch" -->" type="hidden" />
70             <input name="printer" value="" type="hidden" />
71             <input value="Submit" type="submit" />
72         <!-- /TMPL_IF -->
73     </form>
74         </div>  
75                         <ul>
76                         <li><a href="/cgi-bin/koha/catalogue/search.pl#addbooks_search">Cataloguing Search</a></li>
77                         <li><a href="/cgi-bin/koha/circ/circulation.pl#circ_search">Check Out</a></li>
78                         </ul>   
79 </div>
80 <!-- End Cataloging Resident Search Box -->