Bug 15211: adding Tools section sidebar to label creator
[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 == "email" %]
26                 <option selected="selected" value='email'>Email</option>
27               [% ELSE %]
28                 <option value='email'>Email</option>
29               [% END %]
30               [% IF searchfieldstype == "borrowernumber" %]
31                 <option selected="selected" value='borrowernumber'>Borrower number</option>
32               [% ELSE %]
33                 <option value='borrowernumber'>Borrower number</option>
34               [% END %]
35               [% IF searchfieldstype == "userid" %]
36                 <option selected="selected" value='userid'>Username</option>
37               [% ELSE %]
38                 <option value='userid'>Username</option>
39               [% END %]
40               [% IF searchfieldstype == "phone" %]
41                 <option selected="selected" value='phone'>Phone number</option>
42               [% ELSE %]
43                 <option value='phone'>Phone number</option>
44               [% END %]
45               [% IF searchfieldstype == "address" %]
46                 <option selected="selected" value='address'>Street Address</option>
47               [% ELSE %]
48                 <option value='address'>Street Address</option>
49               [% END %]
50               [% IF searchfieldstype == "dateofbirth" %]
51                 <option selected="selected" value='dateofbirth'>Date of birth</option>
52               [% ELSE %]
53                 <option value='dateofbirth'>Date of birth</option>
54               [% END %]
55               [% IF searchfieldstype == "sort1" %]
56                 <option selected="selected" value='sort1'>Sort field 1</option>
57               [% ELSE %]
58                 <option value='sort1'>Sort field 1</option>
59               [% END %]
60               [% IF searchfieldstype == "sort2" %]
61                 <option selected="selected" value='sort2'>Sort field 2</option>
62               [% ELSE %]
63                 <option value='sort2'>Sort field 2</option>
64               [% END %]
65             </select>
66         </p>
67
68         <p>
69             <label for="searchtype">Search type:</label>
70             <select name="searchtype" id="searchtype">
71               [% IF searchtype != 'start_with' %]
72                   <option value='start_with'>Starts with</option>
73                   <option selected="selected" value='contain'>Contains</option>
74               [% ELSE %]
75                   <option selected="selected" value='start_with'>Starts with</option>
76                   <option value='contain'>Contains</option>
77               [% END %]
78             </select>
79         </p>
80
81         <p>
82             <label for="branchcode">Library: </label>
83             [% SET branches = Branches.all( selected => branchcode_filter ) %]
84             <select name="branchcode_filter" id="branchcode">
85                 [% IF branches.size != 1 %]
86                   <option value="">Any</option>
87                 [% END %]
88                 [% FOREACH b IN branches %]
89                     [% IF b.selected %]
90                         <option value="[% b.branchcode %]" selected="selected">[% b.branchname %]</option>
91                     [% ELSE %]
92                         <option value="[% b.branchcode %]">[% b.branchname %]</option>
93                     [% END %]
94                 [% END %]
95             </select>
96         </p>
97
98         <p>
99             <label for="categorycode">Category: </label>
100             [% SET categories = Categories.all( selected => categorycode_filter ) %]
101             <select name="categorycode_filter" id="categorycode">
102                 <option value="">Any</option>
103                 [% FOREACH categorie IN categories %]
104                     [% IF ( categorie.selected ) %]
105                         <option value="[% categorie.categorycode %]" selected="selected">[% categorie.description %]</option>
106                     [% ELSE %]
107                         <option value="[% categorie.categorycode %]">[% categorie.description %]</option>
108                     [% END %]
109                 [% END %]
110             </select>
111         </p>
112     </div>
113     </form>
114 </div>
115     [% INCLUDE 'patron-search-box.inc' %]
116
117     [% IF ( CAN_user_circulate ) %]
118     <div id="checkin_search" class="residentsearch">
119     <p class="tip">Scan a barcode to check in:</p>
120     <form method="post" action="/cgi-bin/koha/circ/returns.pl" autocomplete="off">
121     <input class="head-searchbox" name="barcode" id="ret_barcode" size="40" accesskey="r" />
122     <input value="Submit" class="submit" type="submit" />
123     </form>
124     </div>
125     [% END %]
126
127     [% IF ( CAN_user_catalogue ) %]
128     <div id="catalog_search" class="residentsearch">
129     <p class="tip">Enter search keywords:</p>
130         <form action="/cgi-bin/koha/catalogue/search.pl"  method="get" id="cat-search-block">
131              <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" />
132                 <input type="submit" name="op" id="opac-submit" value="Submit" class="submit" />
133         </form>
134     </div>[% END %]
135
136     <ul>
137         <li><a onclick="keep_text(0)" href="#patron_search">Search patrons</a></li>
138         [% IF ( CAN_user_circulate ) %]<li><a onclick="keep_text(1)" href="#circ_search">Check out</a></li>[% END %]
139         [% IF ( CAN_user_circulate ) %]<li><a onclick="keep_text(2)" href="#checkin_search">Check in</a></li>[% END %]
140         [% IF ( CAN_user_catalogue ) %]<li><a onclick="keep_text(3)" href="#catalog_search">Search the catalog</a></li>[% END %]
141     </ul>
142 </div><!-- /header_search -->
143 </div><!-- /gradient -->
144 <script type="text/javascript">//<![CDATA[
145 $(document).ready(function() {
146     $("#filteraction_off, #filteraction_on").on('click', function(e) {
147         e.preventDefault();
148         $('#filters').toggle();
149         $('.filteraction').toggle();
150     });
151     [% IF ( advsearch ) %]$("#filteraction_on").toggle();
152     [% ELSE %]$("#filters").toggle();
153     $("#filteraction_off").toggle();[% END %]
154     [% SET dateformat = Koha.Preference('dateformat') %]
155     $("#searchfieldstype").change(function() {
156       if ( $(this).val() == 'dateofbirth' ) {
157           [% IF dateformat == 'us' %]
158               var MSG_DATE_FORMAT = _("Dates of birth should be entered in the format 'MM/DD/YYYY'");
159           [% ELSIF dateformat == 'iso' %]
160               var MSG_DATE_FORMAT = _("Dates of birth should be entered in the format 'YYYY-MM-DD'");
161           [% ELSIF dateformat == 'metric' %]
162               var MSG_DATE_FORMAT = _("Dates of birth should be entered in the format 'DD/MM/YYYY'");
163           [% ELSIF dateformat == 'dmydot' %]
164               var MSG_DATE_FORMAT = _("Dates of birth should be entered in the format 'DD.MM.YYYY'");
165           [% END %]
166           $('#searchmember').attr("title",MSG_DATE_FORMAT).tooltip('show');
167       } else {
168           $('#searchmember').tooltip('destroy');
169       }
170     });
171 });
172 //]]>
173 </script>
174 <!-- End Patrons Resident Search Box -->