Bug 17014 - Remove more event attributes from patron templates
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / includes / patron-search.inc
1 [% USE Koha %]
2 [% USE Branches %]
3 [% USE Categories %]
4 <div class="gradient">
5 <h1 id="logo"><a href="/cgi-bin/koha/mainpage.pl">[% LibraryName %]</a></h1><!-- Begin Patrons Resident Search Box -->
6 <div id="header_search">
7     <div id="patron_search" class="residentsearch">
8     <p class="tip">Enter patron card number or partial name:</p>
9     <form action="/cgi-bin/koha/members/member.pl" method="post">
10     <input id="searchmember" data-toggle="tooltip" size="25" class="head-searchbox focus" name="searchmember" type="text" value="[% searchmember %]"/>
11     <input type="hidden" name="quicksearch" value="1" />
12     <span class="filteraction" id="filteraction_off"> <a href="#">[-]</a></span>
13     <span class="filteraction" id="filteraction_on"> <a href="#">[+]</a></span>
14
15     <input value="Search" class="submit" type="submit" />
16
17     <div id="filters">
18         <p><label for="searchfieldstype">Search fields:</label>
19             <select name="searchfieldstype" id="searchfieldstype">
20               [% IF searchfieldstype == "standard" %]
21                 <option selected="selected" value='standard'>Standard</option>
22               [% ELSE %]
23                 <option value='standard'>Standard</option>
24               [% END %]
25               [% IF searchfieldstype == "surname" %]
26                 <option selected="selected" value='surname'>Surname</option>
27               [% ELSE %]
28                 <option value='surname'>Surname</option>
29               [% END %]
30               [% IF searchfieldstype == "email" %]
31                 <option selected="selected" value='email'>Email</option>
32               [% ELSE %]
33                 <option value='email'>Email</option>
34               [% END %]
35               [% IF searchfieldstype == "borrowernumber" %]
36                 <option selected="selected" value='borrowernumber'>Borrower number</option>
37               [% ELSE %]
38                 <option value='borrowernumber'>Borrower number</option>
39               [% END %]
40               [% IF searchfieldstype == "userid" %]
41                 <option selected="selected" value='userid'>Username</option>
42               [% ELSE %]
43                 <option value='userid'>Username</option>
44               [% END %]
45               [% IF searchfieldstype == "phone" %]
46                 <option selected="selected" value='phone'>Phone number</option>
47               [% ELSE %]
48                 <option value='phone'>Phone number</option>
49               [% END %]
50               [% IF searchfieldstype == "address" %]
51                 <option selected="selected" value='address'>Street Address</option>
52               [% ELSE %]
53                 <option value='address'>Street Address</option>
54               [% END %]
55               [% IF searchfieldstype == "dateofbirth" %]
56                 <option selected="selected" value='dateofbirth'>Date of birth</option>
57               [% ELSE %]
58                 <option value='dateofbirth'>Date of birth</option>
59               [% END %]
60               [% IF searchfieldstype == "sort1" %]
61                 <option selected="selected" value='sort1'>Sort field 1</option>
62               [% ELSE %]
63                 <option value='sort1'>Sort field 1</option>
64               [% END %]
65               [% IF searchfieldstype == "sort2" %]
66                 <option selected="selected" value='sort2'>Sort field 2</option>
67               [% ELSE %]
68                 <option value='sort2'>Sort field 2</option>
69               [% END %]
70             </select>
71         </p>
72
73         <p>
74             <label for="searchtype">Search type:</label>
75             <select name="searchtype" id="searchtype">
76               [% IF searchtype == 'start_with' %]
77                   <option selected="selected" value='start_with'>Starts with</option>
78                   <option value='contain'>Contains</option>
79               [% ELSE %]
80                   <option value='start_with'>Starts with</option>
81                   <option selected="selected" value='contain'>Contains</option>
82               [% END %]
83             </select>
84         </p>
85
86         <p>
87             <label for="branchcode">Library: </label>
88             [% SET branches = Branches.all( selected => branchcode_filter ) %]
89             <select name="branchcode_filter" id="branchcode">
90                 [% IF branches.size != 1 %]
91                   <option value="">Any</option>
92                 [% END %]
93                 [% FOREACH b IN branches %]
94                     [% IF b.selected %]
95                         <option value="[% b.branchcode %]" selected="selected">[% b.branchname %]</option>
96                     [% ELSE %]
97                         <option value="[% b.branchcode %]">[% b.branchname %]</option>
98                     [% END %]
99                 [% END %]
100             </select>
101         </p>
102
103         <p>
104             <label for="categorycode">Category: </label>
105             [% SET categories = Categories.all() %]
106             <select name="categorycode_filter" id="categorycode">
107                 <option value="">Any</option>
108                 [% FOREACH category IN categories %]
109                     [% IF category.categorycode == categorycode_filter %]
110                         <option value="[% category.categorycode %]" selected="selected">[% category.description %]</option>
111                     [% ELSE %]
112                         <option value="[% category.categorycode %]">[% category.description %]</option>
113                     [% END %]
114                 [% END %]
115             </select>
116         </p>
117     </div>
118     </form>
119 </div>
120     [% INCLUDE 'patron-search-box.inc' %]
121
122     [% IF ( CAN_user_circulate_circulate_remaining_permissions ) %]
123     <div id="checkin_search" class="residentsearch">
124     <p class="tip">Scan a barcode to check in:</p>
125     <form method="post" action="/cgi-bin/koha/circ/returns.pl" autocomplete="off">
126     <input class="head-searchbox" name="barcode" id="ret_barcode" size="40" accesskey="r" />
127     <input value="Submit" class="submit" type="submit" />
128     </form>
129     </div>
130         <div id="renew_search" class="residentsearch">
131         <p class="tip">Scan a barcode to renew:</p>
132             <form method="post" action="/cgi-bin/koha/circ/renew.pl" autocomplete="off">
133                 <input class="head-searchbox" name="barcode" id="ren_barcode" size="40" />
134                 <input value="Submit" class="submit" type="submit" />
135             </form>
136         </div>
137     [% END %]
138
139     [% IF ( CAN_user_catalogue ) %]
140     <div id="catalog_search" class="residentsearch">
141     <p class="tip">Enter search keywords:</p>
142         <form action="/cgi-bin/koha/catalogue/search.pl"  method="get" id="cat-search-block">
143              [% IF ( Koha.Preference('IntranetCatalogSearchPulldown') ) %][% INCLUDE 'search_indexes.inc' %][% END %]
144              <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" />
145              <input type="submit" name="op" id="opac-submit" value="Submit" class="submit" />
146         </form>
147     </div>[% END %]
148
149     <ul>
150         <li><a class="keep_text" href="#patron_search">Search patrons</a></li>
151         [% IF ( CAN_user_circulate_circulate_remaining_permissions ) %]<li><a class="keep_text" href="#circ_search">Check out</a></li>[% END %]
152         [% IF ( CAN_user_circulate_circulate_remaining_permissions ) %]<li><a class="keep_text" href="#checkin_search">Check in</a></li>[% END %]
153         [% IF ( CAN_user_circulate_circulate_remaining_permissions ) %]<li><a class="keep_text" href="#renew_search">Renew</a></li>[% END %]
154         [% IF ( CAN_user_catalogue ) %]<li><a class="keep_text" href="#catalog_search">Search the catalog</a></li>[% END %]
155     </ul>
156 </div><!-- /header_search -->
157 </div><!-- /gradient -->
158 <script type="text/javascript">//<![CDATA[
159 $(document).ready(function() {
160     $("#filteraction_off, #filteraction_on").on('click', function(e) {
161         e.preventDefault();
162         $('#filters').toggle();
163         $('.filteraction').toggle();
164     });
165     [% IF ( advsearch ) %]$("#filteraction_on").toggle();
166     [% ELSE %]$("#filters").toggle();
167     $("#filteraction_off").toggle();[% END %]
168     [% SET dateformat = Koha.Preference('dateformat') %]
169     $("#searchfieldstype").change(function() {
170       if ( $(this).val() == 'dateofbirth' ) {
171           [% IF dateformat == 'us' %]
172               var MSG_DATE_FORMAT = _("Dates of birth should be entered in the format 'MM/DD/YYYY'");
173           [% ELSIF dateformat == 'iso' %]
174               var MSG_DATE_FORMAT = _("Dates of birth should be entered in the format 'YYYY-MM-DD'");
175           [% ELSIF dateformat == 'metric' %]
176               var MSG_DATE_FORMAT = _("Dates of birth should be entered in the format 'DD/MM/YYYY'");
177           [% ELSIF dateformat == 'dmydot' %]
178               var MSG_DATE_FORMAT = _("Dates of birth should be entered in the format 'DD.MM.YYYY'");
179           [% END %]
180           $('#searchmember').attr("title",MSG_DATE_FORMAT).tooltip('show');
181       } else {
182           $('#searchmember').tooltip('destroy');
183       }
184     });
185 });
186 //]]>
187 </script>
188 <!-- End Patrons Resident Search Box -->