3 [% PROCESS 'patronfields.inc' %]
4 [% IF CAN_user_borrowers_edit_borrowers %]
5 <div id="patron_search" class="residentsearch">
6 <form method="post" action="/cgi-bin/koha/members/member.pl">
7 <input type="hidden" name="quicksearch" value="1" />
9 <span class="form-title">
10 <label class="control-label">Search patrons</label>
13 <span class="form-content">
14 [% IF ( Koha.Preference('RetainPatronsSearchTerms') ) %]
15 <input name="searchmember" id="searchmember" class="head-searchbox form-control" type="text" placeholder="Enter patron card number or partial name" size="25" value="[% searchmember | html %]"/>
17 <input name="searchmember" id="searchmember" class="head-searchbox form-control" type="text" placeholder="Enter patron card number or partial name" size="25"/>
20 <button type="button" class="form-extra-content-toggle"><i class="fa fa-sliders"></i></button>
23 <button type="submit"><i class="fa fa-arrow-right"></i></button>
25 <div class="form-extra-content">
27 <label for="searchfieldstype" class="control-label">Search fields</label>
28 <select name="searchfieldstype" id="searchfieldstype" class="form-control">
29 [% SET standard = Koha.Preference('DefaultPatronSearchFields') || 'firstname,middle_name,surname,othernames,cardnumber,userid' %]
30 [% default_fields = [ standard, 'surname', 'cardnumber', 'email', 'borrowernumber', 'userid', 'phone', 'address', 'dateofbirth', 'sort1', 'sort2' ] %]
31 [% search_options = default_fields.merge(standard.split(',')).unique %]
32 [% FOREACH s_o IN search_options %]
33 [% display_name = PROCESS patron_fields name=s_o %]
34 [% NEXT IF !display_name.length %]
35 [% IF searchfieldstype == s_o %]
36 <option value="[% s_o | html %]">[% display_name | $raw %]</option>
38 <option value="[% s_o | html %]">[% display_name | $raw %]</option>
45 <label for="searchtype" class="control-label">Search type</label>
46 <select name="searchtype" id="searchtype" class="form-control">
47 [% IF searchtype == 'start_with' %]
48 <option value='start_with'>Starts with</option>
49 <option value='contain'>Contains</option>
51 <option value='start_with'>Starts with</option>
52 <option value='contain'>Contains</option>
58 [% SET branches = Branches.all( selected => branchcode_filter, only_from_group => 1 ) %]
59 <label for="branchcode" class="control-label">Library</label>
60 <select name="branchcode_filter" id="branchcode" class="form-control">
61 [% IF branches.size != 1 %]
62 <option value="">Any</option>
64 [% PROCESS options_for_libraries libraries => branches %]
69 [% SET categories = Categories.all() %]
70 <label for="categorycode" class="control-label">Category</label>
71 <select name="categorycode_filter" id="categorycode" class="form-control">
72 <option value="">Any</option>
73 [% FOREACH category IN categories %]
74 [% IF category.categorycode == categorycode_filter %]
75 <option value="[% category.categorycode | html %]" selected="selected">[% category.description | html %]</option>
77 <option value="[% category.categorycode | html %]">[% category.description | html %]</option>