Bug 29271: Fix cash register report results
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / includes / patron-search.inc
1 [% USE Koha %]
2 [% USE Branches %]
3 [% USE Categories %]
4 [% USE raw %]
5 [% PROCESS 'html_helpers.inc' %]
6 [% PROCESS 'patronfields.inc' %]
7 <div class="gradient">
8 <h1 id="logo"><a href="/cgi-bin/koha/mainpage.pl">[% LibraryName | html %]</a></h1><!-- Begin Patrons Resident Search Box -->
9 <div id="header_search">
10     <div id="patron_search" class="residentsearch">
11     <form action="/cgi-bin/koha/members/member.pl" method="post">
12         <label class="tip" for="searchmember">Enter patron card number or partial name:</label>
13     <div class="autocomplete">
14         <input id="searchmember" data-toggle="tooltip" size="25" class="head-searchbox focus" name="searchmember" type="text" value="[% searchmember | html %]" autocomplete="off" />
15         <input type="hidden" name="quicksearch" value="1" />
16         <span class="filteraction" id="filteraction_off"> <a href="#">[-]</a></span>
17         <span class="filteraction" id="filteraction_on"> <a href="#">[+]</a></span>
18         <input value="Search" class="submit" type="submit" />
19     </div>
20
21
22
23     <div id="filters">
24         <p><label for="searchfieldstype">Search fields:</label>
25             <select name="searchfieldstype" id="searchfieldstype">
26               [% pref_fields = Koha.Preference('DefaultPatronSearchFields').split(',') %]
27               [% default_fields = [ 'standard', 'surname', 'cardnumber', 'email', 'borrowernumber', 'userid', 'phone', 'address', 'dateofbirth', 'sort1', 'sort2' ] %]
28               [% search_options = default_fields.merge(pref_fields).unique %]
29               [% FOREACH s_o IN search_options %]
30                   [% display_name = PROCESS patron_fields name=s_o %]
31                   [% NEXT IF !display_name.length %]
32                   [% IF searchfieldstype == s_o %]
33                       <option selected="selected" value="[% s_o | html %]">[% display_name | $raw %]</option>
34                   [% ELSE %]
35                       <option value="[% s_o | html %]">[% display_name | $raw %]</option>
36                   [% END %]
37               [% END %]
38             </select>
39         </p>
40         <p>
41             <label for="searchtype">Search type:</label>
42             <select name="searchtype" id="searchtype">
43               [% IF searchtype == 'start_with' %]
44                   <option selected="selected" value='start_with'>Starts with</option>
45                   <option value='contain'>Contains</option>
46               [% ELSE %]
47                   <option value='start_with'>Starts with</option>
48                   <option selected="selected" value='contain'>Contains</option>
49               [% END %]
50             </select>
51         </p>
52
53         <p>
54             <label for="branchcode">Library: </label>
55             [% SET branches = Branches.all( selected => branchcode_filter, only_from_group => 1 ) %]
56             <select name="branchcode_filter" id="branchcode">
57                 [% IF branches.size != 1 %]
58                   <option value="">Any</option>
59                 [% END %]
60                 [% PROCESS options_for_libraries libraries => branches %]
61             </select>
62         </p>
63
64         <p>
65             <label for="categorycode">Category: </label>
66             [% SET categories = Categories.all() %]
67             <select name="categorycode_filter" id="categorycode">
68                 <option value="">Any</option>
69                 [% FOREACH category IN categories %]
70                     [% IF category.categorycode == categorycode_filter %]
71                         <option value="[% category.categorycode | html %]" selected="selected">[% category.description | html %]</option>
72                     [% ELSE %]
73                         <option value="[% category.categorycode | html %]">[% category.description | html %]</option>
74                     [% END %]
75                 [% END %]
76             </select>
77         </p>
78     </div>
79     </form>
80 </div>
81     [% INCLUDE 'patron-search-box.inc' %]
82
83     [% IF ( CAN_user_circulate_circulate_remaining_permissions ) %]
84     <div id="checkin_search" class="residentsearch">
85     <form method="post" action="/cgi-bin/koha/circ/returns.pl" autocomplete="off">
86         <label class="tip" for="ret_barcode">Scan a barcode to check in:</label>
87     <input class="head-searchbox" name="barcode" id="ret_barcode" size="40" accesskey="r" type="text" />
88     <input value="Submit" class="submit" type="submit" />
89     </form>
90     </div>
91         <div id="renew_search" class="residentsearch">
92             <form method="post" action="/cgi-bin/koha/circ/renew.pl" autocomplete="off">
93                 <label class="tip" for="ren_barcode">Scan a barcode to renew:</label>
94                 <input class="head-searchbox" name="barcode" id="ren_barcode" size="40" type="text" />
95                 <input value="Submit" class="submit" type="submit" />
96             </form>
97         </div>
98     [% END %]
99
100     [% INCLUDE 'catalogue-search-box.inc' %]
101
102     <ul>
103         <li><a class="keep_text" href="#patron_search">Search patrons</a></li>
104         [% IF ( CAN_user_circulate_circulate_remaining_permissions ) %]<li><a class="keep_text" href="#circ_search">Check out</a></li>[% END %]
105         [% IF ( CAN_user_circulate_circulate_remaining_permissions ) %]<li><a class="keep_text" href="#checkin_search">Check in</a></li>[% END %]
106         [% IF ( CAN_user_circulate_circulate_remaining_permissions ) %]<li><a class="keep_text" href="#renew_search">Renew</a></li>[% END %]
107         [% IF ( CAN_user_catalogue ) %]<li><a class="keep_text" href="#catalog_search">Search the catalog</a></li>[% END %]
108     </ul>
109 </div><!-- /header_search -->
110 </div><!-- /gradient -->
111 <!-- End Patrons Resident Search Box -->