Bug 23697: Add autocompletion search in patron module
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / includes / patron-search.inc
1 [% USE Koha %]
2 [% USE Branches %]
3 [% USE Categories %]
4 [% PROCESS 'html_helpers.inc' %]
5 <div class="gradient">
6 <h1 id="logo"><a href="/cgi-bin/koha/mainpage.pl">[% LibraryName | html %]</a></h1><!-- Begin Patrons Resident Search Box -->
7 <div id="header_search">
8     <div id="patron_search" class="residentsearch">
9     <p class="tip">Enter patron card number or partial name:</p>
10     <form action="/cgi-bin/koha/members/member.pl" method="post">
11     <div class="autocomplete">
12         <input id="searchmember" data-toggle="tooltip" size="25" class="head-searchbox focus" name="searchmember" type="text" value="[% searchmember | html %]" autocomplete="off" />
13         <input type="hidden" name="quicksearch" value="1" />
14         <span class="filteraction" id="filteraction_off"> <a href="#">[-]</a></span>
15         <span class="filteraction" id="filteraction_on"> <a href="#">[+]</a></span>
16         <input value="Search" class="submit" type="submit" />
17     </div>
18
19
20     <div id="filters">
21         <p><label for="searchfieldstype">Search fields:</label>
22             <select name="searchfieldstype" id="searchfieldstype">
23               [% IF searchfieldstype == "standard" %]
24                 <option selected="selected" value='standard'>Standard</option>
25               [% ELSE %]
26                 <option value='standard'>Standard</option>
27               [% END %]
28               [% IF searchfieldstype == "surname" %]
29                 <option selected="selected" value='surname'>Surname</option>
30               [% ELSE %]
31                 <option value='surname'>Surname</option>
32               [% END %]
33               [% IF searchfieldstype == "email" %]
34                 <option selected="selected" value='email'>Email</option>
35               [% ELSE %]
36                 <option value='email'>Email</option>
37               [% END %]
38               [% IF searchfieldstype == "borrowernumber" %]
39                 <option selected="selected" value='borrowernumber'>Borrower number</option>
40               [% ELSE %]
41                 <option value='borrowernumber'>Borrower number</option>
42               [% END %]
43               [% IF searchfieldstype == "userid" %]
44                 <option selected="selected" value='userid'>Username</option>
45               [% ELSE %]
46                 <option value='userid'>Username</option>
47               [% END %]
48               [% IF searchfieldstype == "phone" %]
49                 <option selected="selected" value='phone'>Phone number</option>
50               [% ELSE %]
51                 <option value='phone'>Phone number</option>
52               [% END %]
53               [% IF searchfieldstype == "address" %]
54                 <option selected="selected" value='address'>Street address</option>
55               [% ELSE %]
56                 <option value='address'>Street address</option>
57               [% END %]
58               [% IF searchfieldstype == "dateofbirth" %]
59                 <option selected="selected" value='dateofbirth'>Date of birth</option>
60               [% ELSE %]
61                 <option value='dateofbirth'>Date of birth</option>
62               [% END %]
63               [% IF searchfieldstype == "sort1" %]
64                 <option selected="selected" value='sort1'>Sort field 1</option>
65               [% ELSE %]
66                 <option value='sort1'>Sort field 1</option>
67               [% END %]
68               [% IF searchfieldstype == "sort2" %]
69                 <option selected="selected" value='sort2'>Sort field 2</option>
70               [% ELSE %]
71                 <option value='sort2'>Sort field 2</option>
72               [% END %]
73             </select>
74         </p>
75
76         <p>
77             <label for="searchtype">Search type:</label>
78             <select name="searchtype" id="searchtype">
79               [% IF searchtype == 'start_with' %]
80                   <option selected="selected" value='start_with'>Starts with</option>
81                   <option value='contain'>Contains</option>
82               [% ELSE %]
83                   <option value='start_with'>Starts with</option>
84                   <option selected="selected" value='contain'>Contains</option>
85               [% END %]
86             </select>
87         </p>
88
89         <p>
90             <label for="branchcode">Library: </label>
91             [% SET branches = Branches.all( selected => branchcode_filter, only_from_group => 1 ) %]
92             <select name="branchcode_filter" id="branchcode">
93                 [% IF branches.size != 1 %]
94                   <option value="">Any</option>
95                 [% END %]
96                 [% PROCESS options_for_libraries libraries => branches %]
97             </select>
98         </p>
99
100         <p>
101             <label for="categorycode">Category: </label>
102             [% SET categories = Categories.all() %]
103             <select name="categorycode_filter" id="categorycode">
104                 <option value="">Any</option>
105                 [% FOREACH category IN categories %]
106                     [% IF category.categorycode == categorycode_filter %]
107                         <option value="[% category.categorycode | html %]" selected="selected">[% category.description | html %]</option>
108                     [% ELSE %]
109                         <option value="[% category.categorycode | html %]">[% category.description | html %]</option>
110                     [% END %]
111                 [% END %]
112             </select>
113         </p>
114     </div>
115     </form>
116 </div>
117     [% INCLUDE 'patron-search-box.inc' %]
118
119     [% IF ( CAN_user_circulate_circulate_remaining_permissions ) %]
120     <div id="checkin_search" class="residentsearch">
121     <p class="tip">Scan a barcode to check in:</p>
122     <form method="post" action="/cgi-bin/koha/circ/returns.pl" autocomplete="off">
123     <input class="head-searchbox" name="barcode" id="ret_barcode" size="40" accesskey="r" type="text" />
124     <input value="Submit" class="submit" type="submit" />
125     </form>
126     </div>
127         <div id="renew_search" class="residentsearch">
128         <p class="tip">Scan a barcode to renew:</p>
129             <form method="post" action="/cgi-bin/koha/circ/renew.pl" autocomplete="off">
130                 <input class="head-searchbox" name="barcode" id="ren_barcode" size="40" type="text" />
131                 <input value="Submit" class="submit" type="submit" />
132             </form>
133         </div>
134     [% END %]
135
136     [% IF ( CAN_user_catalogue ) %]
137     <div id="catalog_search" class="residentsearch">
138     <p class="tip">Enter search keywords:</p>
139         <form action="/cgi-bin/koha/catalogue/search.pl"  method="get" id="cat-search-block">
140              [% IF ( Koha.Preference('IntranetCatalogSearchPulldown') ) %][% INCLUDE 'search_indexes.inc' %][% END %]
141              <input type="text" name="q" id="search-form" size="40" value="" title="Enter the terms you wish to search for." class="head-searchbox form-text" />
142              <input type="submit" name="op" id="opac-submit" value="Submit" class="submit" />
143         </form>
144     </div>[% END %]
145
146     <ul>
147         <li><a class="keep_text" href="#patron_search">Search patrons</a></li>
148         [% IF ( CAN_user_circulate_circulate_remaining_permissions ) %]<li><a class="keep_text" href="#circ_search">Check out</a></li>[% END %]
149         [% IF ( CAN_user_circulate_circulate_remaining_permissions ) %]<li><a class="keep_text" href="#checkin_search">Check in</a></li>[% END %]
150         [% IF ( CAN_user_circulate_circulate_remaining_permissions ) %]<li><a class="keep_text" href="#renew_search">Renew</a></li>[% END %]
151         [% IF ( CAN_user_catalogue ) %]<li><a class="keep_text" href="#catalog_search">Search the catalog</a></li>[% END %]
152     </ul>
153 </div><!-- /header_search -->
154 </div><!-- /gradient -->
155 <!-- End Patrons Resident Search Box -->