Tweaking display of search button in resident search form to address an issue describ...
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / includes / checkin-search.inc
1
2 <h1 id="logo"><a href="/cgi-bin/koha/mainpage.pl"><!-- TMPL_VAR NAME="LibraryName" --></a></h1><!-- Begin Checkin Resident Search Box -->
3 <!-- TMPL_IF NAME="CircAutocompl" --><!-- TMPL_IF NAME="CAN_user_circulate" --><script type="text/javascript">
4 //<![CDATA[
5 YAHOO.util.Event.onContentReady("header_search", function() {
6     new function() {
7         // Define a custom formatter function
8         this.fnCustomFormatter = function(oResultItem, sQuery) {
9             var name        = oResultItem[0];
10             var cardnumber  = oResultItem[1];
11             var address     = oResultItem[2];
12             var city        = oResultItem[3];
13             var zip         = oResultItem[4];
14             var aMarkup = [
15                 "<div class=\"sample-result\">",
16                 name,
17                 " (",
18                 cardnumber,
19                 ")<small> -- ",
20                 address,
21                 ", ",
22                 city,
23                 "</small>",
24                 "</div>"];
25             return (aMarkup.join(""));
26         };
27
28         // Instantiate one XHR DataSource and define schema as an array:
29         //     ["Record Delimiter",
30         //     "Field Delimiter"]
31         this.oACDS = new YAHOO.widget.DS_XHR("/cgi-bin/koha/circ/ysearch.pl", ["\n", "\t"]);
32         this.oACDS.responseType = YAHOO.widget.DS_XHR.TYPE_FLAT;
33         this.oACDS.maxCacheEntries = 60;
34         this.oACDS.queryMatchSubset = true;
35     
36         // Instantiate first AutoComplete
37         var myInput = document.getElementById('findborrower');
38         var myContainer = document.getElementById('yborrowercontainer');
39         this.oAutoComp = new YAHOO.widget.AutoComplete(myInput,myContainer,this.oACDS);
40         //this.oAutoComp.delimChar = ";";
41         //this.oAutoComp.queryDelay = 1;
42         this.oAutoComp.formatResult = this.fnCustomFormatter;
43 }
44 });    
45 //]]>
46 </script><!-- /TMPL_IF --><!-- /TMPL_IF -->
47
48 <div id="header_search">
49 <!-- TMPL_IF NAME="CAN_user_circulate" -->
50 <div id="circ_search" class="residentsearch">
51     <p class="tip">Enter patron card number or partial name:</p>
52     <form action="/cgi-bin/koha/circ/circulation.pl" method="post">
53     <!-- TMPL_IF NAME="CircAutocompl" -->
54     <div class="autocomplete">
55             <div id="borrowerautocomplete" class="autocomplete">
56                 <input autocomplete="off" id="findborrower" name="findborrower" type="text" />
57                 <div id="yborrowercontainer"></div>
58                 <input id="ysearchsubmit" type="submit" class="submit" value="Submit" />
59                 <input name="branch" value="<!-- TMPL_VAR name="branch" -->" type="hidden" />
60                 <input name="printer" value="" type="hidden" />
61             </div>
62         </div>
63         <!-- TMPL_ELSE -->
64             <input id="findborrower" name="findborrower" size="40" type="text" />
65             <input name="branch" value="<!-- TMPL_VAR name="branch" -->" type="hidden" />
66             <input name="printer" value="" type="hidden" />
67             <input value="Submit" class="submit" type="submit" />
68         <!-- /TMPL_IF -->
69     </form>
70 </div>  
71 <!-- /TMPL_IF -->
72 <!-- TMPL_IF NAME="CAN_user_circulate" -->
73 <div id="checkin_search" class="residentsearch">
74     <p class="tip">Scan a barcode to check in:</p>
75     <form method="post" action="/cgi-bin/koha/circ/returns.pl">
76         <input name="barcode" id="ret_barcode" size="40" maxlength="14" />
77         <input value="Submit" class="submit" type="submit" />
78     </form>
79 </div>
80 <!-- /TMPL_IF -->
81 <!-- TMPL_IF NAME="CAN_user_catalogue" -->
82 <div id="catalog_search" class="residentsearch">
83     <p class="tip">Enter search keywords:</p>
84     <form action="/cgi-bin/koha/catalogue/search.pl"  method="get" id="cat-search-block">
85         <input type="text" name="q" id="search-form" size="40" />
86         <input type="submit" class="submit" value="Submit"/>
87     </form>
88 </div>
89 <!-- /TMPL_IF -->
90 <ul>
91     <!-- TMPL_IF NAME="CAN_user_circulate" --><li><a href="/cgi-bin/koha/circ/circulation.pl#circ_search">Check Out</a></li><!-- /TMPL_IF -->
92     <!-- TMPL_IF NAME="CAN_user_circulate" --><li class="tabs-selected"><a href="/cgi-bin/koha/circ/returns.pl#checkin_search">Check In</a></li><!-- /TMPL_IF -->
93     <!-- TMPL_IF NAME="CAN_user_catalogue" --><li><a href="/cgi-bin/koha/catalogue/search.pl#catalog_search">Search the Catalog</a></li><!-- /TMPL_IF -->
94 </ul>   
95
96 </div>
97
98 <!-- End Checkin Resident Search Box -->