Merge branch 'bootstrap-opac'
[koha.git] / koha-tmpl / opac-tmpl / bootstrap / en / modules / opac-advsearch.tt
1 [% USE Koha %]
2 [% INCLUDE 'doc-head-open.inc' %]
3 [% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %]
4     catalog › Advanced search
5 [% INCLUDE 'doc-head-close.inc' %]
6 [% BLOCK cssinclude %][% END %]
7 </head>
8 <body id="advsearch" class="scrollto">
9 [% INCLUDE 'masthead.inc' %]
10 <form action="/cgi-bin/koha/opac-search.pl" method="get">
11     <div class="main">
12         <ul class="breadcrumb">
13             <li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">&rsaquo;</span></li>
14             <li><a href="#">Advanced search</a></li>
15         </ul>
16
17         <div class="container-fluid">
18             <div class="row-fluid">
19                 <div class="span12">
20                     <!-- BOOLEAN SEARCH OPTIONS -->
21                     <div id="booleansearch" class="maincontent">
22                         <fieldset>
23                             <legend>Search for:</legend>
24                             [% FOREACH search_box IN search_boxes_loop %]
25                                 <p>
26                                     [% IF ( expanded_options ) %]
27                                         [% IF ( search_box.boolean ) %]
28                                             <select name="op">
29                                                 <option value="and" selected="selected">and</option>
30                                                 <option value="or">or</option>
31                                                 <option value="not">not</option>
32                                             </select>
33                                         [% END %]
34                                     [% ELSE %]
35                                         <label for="search-field_[% loop.index %]">
36                                             [% IF loop.index == 0 %]
37                                                 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
38                                             [% ELSE %]
39                                                 and
40                                             [% END %]
41                                         </label>
42                                     [% END %]
43                                     [% IF ( expanded_options ) %][% left_content %][% END %]
44                                     <select name="idx" id="search-field_[% loop.index %]">
45                                         <option value="kw">Keyword</option>
46                                         <option value="su,wrdl">Subject</option>
47                                         [% IF ( expanded_options ) %]
48                                             <option value="su,phr">&nbsp;&nbsp;&nbsp;&nbsp; Subject phrase</option>
49                                             <option value="su-br">&nbsp;&nbsp;&nbsp;&nbsp; Subject and broader terms</option>
50                                             <option value="su-na">&nbsp;&nbsp;&nbsp;&nbsp; Subject and narrower terms</option>
51                                             <option value="su-rl">&nbsp;&nbsp;&nbsp;&nbsp; Subject and related terms</option>
52                                         [% END %]
53                                         <option value="ti">Title</option>
54                                         [% IF ( expanded_options ) %]
55                                             <option value="ti,phr">&nbsp;&nbsp;&nbsp;&nbsp; Title phrase</option>
56                                             <option value="se,wrdl">Series title</option>
57                                             [% IF ( numbersphr) %]
58                                                 <option value="callnum,phr">Call number</option>
59                                             [% ELSE %]
60                                                 <option value="callnum">Call number</option>
61                                             [% END %]
62                                             <option value="location">Shelving location</option>
63                                         [% END %]
64                                         <option value="au,wrdl">Author</option>
65                                         [% IF ( expanded_options ) %]
66                                             <option value="au,phr">&nbsp;&nbsp;&nbsp;&nbsp; Author phrase</option>
67                                             <option value="cpn,wrdl">&nbsp;&nbsp;&nbsp;&nbsp; Corporate name</option>
68                                             <option value="cfn,wrdl">&nbsp;&nbsp;&nbsp;&nbsp; Conference name</option>
69                                             <option value="cfn,phr">&nbsp;&nbsp;&nbsp;&nbsp; Conference name phrase</option>
70                                             <option value="pn,wrdl">&nbsp;&nbsp;&nbsp;&nbsp; Personal name</option>
71                                             <option value="pn,phr">&nbsp;&nbsp;&nbsp;&nbsp; Personal name phrase</option>
72                                         [% END %]
73                                         [% IF ( expanded_options ) %]
74                                             <option value="nt">Notes/Comments</option>
75                                             [% IF (marcflavour != 'UNIMARC') %]
76                                                 <option value="curriculum">Curriculum</option>
77                                             [% END %]
78                                         [% END %]
79                                         <option value="pb,wrdl">Publisher</option>
80                                         <option value="pl,wrdl">Publisher location</option>
81                                         [% IF ( expanded_options ) %]
82                                             [% IF ( numbersphr) %]
83                                                 <option value="sn,phr">Standard number</option>
84                                             [% ELSE %]
85                                                 <option value="sn">Standard number</option>
86                                             [% END %]
87                                             <option value="sn">Standard number</option>
88                                             <option value="nb">&nbsp;&nbsp;&nbsp;&nbsp; ISBN</option>
89                                             <option value="ns">&nbsp;&nbsp;&nbsp;&nbsp; ISSN</option>
90                                             [% IF ( numbersphr) %]
91                                                 <option value="lcn,phr">&nbsp;&nbsp;&nbsp;&nbsp; Call number</option>
92                                             [% ELSE %]
93                                                 <option value="lcn">&nbsp;&nbsp;&nbsp;&nbsp; Call number</option>
94                                             [% END %]
95                                         [% ELSE %]
96                                             <option value="nb">ISBN</option>
97                                         [% END %]
98                                         <option value="bc">Barcode</option>
99                                     </select>
100                                     <input type="text" size="30" name="q" title="Enter search terms" value="" />
101                                     [% IF ( expanded_options ) %]
102                                         [% IF ( !loop.first ) %]
103                                             <a class="ButtonPlus" name="ButtonPlus" title="Add another field" href="#">[+]</a>
104                                             <a class="ButtonLess" title="Remove field" href="#">[-]</a>
105                                         [% END %]
106                                     [% END %]
107                                 </p>
108                             [% END # FOREACH search_box %]
109                         </fieldset>
110                     </div> <!-- /BOOLEAN SEARCH OPTIONS -->
111                 </div> <!-- / .span12 -->
112             </div> <!-- / .row-fluid -->
113         </div> <!-- / .container-fluid -->
114     </div> <!-- / .main -->
115                     <div class="text-center">
116                         <!-- SEARCH BUTTONS -->
117                         [% PROCESS searchbuttons %]
118                         <!-- /SEARCH BUTTONS -->
119                     </div>
120
121     <div class="main">
122         <div class="container-fluid">
123             <div class="row-fluid">
124                 <div class="span12">
125                     <div id="advsearches" class="toptabs">
126                         <ul>
127                             [% FOREACH advsearchloo IN advancedsearchesloop %]
128                                 <li id="advsearch-tab-[% advsearchloo.advanced_search_type %]">
129                                 <a href="#advsearch-[% advsearchloo.advanced_search_type %]">
130                                [% IF ( advsearchloo.advanced_search_type == 'itemtypes' ) %]Item type
131                                [% ELSIF ( advsearchloo.advanced_search_type == 'ccode' ) %]Collection
132                                [% ELSIF ( advsearchloo.advanced_search_type == 'loc' ) %]Shelving location
133                                [% ELSE %]Something else
134                                [% END %]
135                                </a></li>
136                             [% END %]
137                         </ul>
138
139                         [% FOREACH advsearchloo IN advancedsearchesloop %]
140                             <div id="advsearch-[% advsearchloo.advanced_search_type %]" class="advsearch">
141                                 <fieldset>
142                                     <legend>Limit to any of the following:</legend>
143                                     <div class="row-fluid">
144                                         [% FOREACH itemtypeloo IN advsearchloo.code_loop %]
145                                             <div class="span3"><input type="checkbox" id="[% itemtypeloo.ccl FILTER remove(',') %]-[% itemtypeloo.number %]" name="limit" value="mc-[% itemtypeloo.ccl %]:[% itemtypeloo.code %]"/><label for="[% itemtypeloo.ccl FILTER remove(',') %]-[% itemtypeloo.number %]">[% UNLESS ( noItemTypeImages ) %][% IF ( itemtypeloo.imageurl ) %]<img src="[% itemtypeloo.imageurl %]" alt="[% itemtypeloo.description %]" />[% END %]&nbsp;[% END %]
146                                             [% itemtypeloo.description %]</label></div>
147                                             [% IF ( loop.last ) %]</div>[% ELSE %][% UNLESS ( loop.count % 4 ) %]</div><div class="row-fluid">[% END %][% END %]
148                                         [% END %]
149                                 </fieldset>
150                             </div> <!-- / #advsearch-[% advsearchloo.advanced_search_type %] -->
151                         [% END # / FOREACH advancedsearchesloop %]
152                     </div> <!-- / #advsearches -->
153                 </div> <!-- / .span12 -->
154
155                 <div class="row-fluid">
156                     <div class="span3">
157                         <div id="pubrange">
158                             <!-- PUB RANGE OPTION -->
159                             <fieldset>
160                                 <legend>Publication date range</legend>
161                                 <label for="limit-yr">Date range:</label>
162                                 <input type="text" size="30" id="limit-yr" name="limit-yr" title="Enter search terms" value="" />
163                                 <p>For example:  1999-2001.  You could also use "-1987" for everything published in and before 1987 or "2008-" for everything published in 2008 and after.</p>
164                             </fieldset>
165                             <!-- /PUB RANGE OPTION -->
166                         </div>
167                     </div>
168
169                     <div class="span3">
170                         <div id="langfilter">
171                             <fieldset>
172                                 <legend>Language</legend>
173                                 <!-- LANGUAGE LIMIT -->
174                                 <p>
175                                     <label for="language-limit">Language: </label>
176                                     <select id="language-limit" name="limit">
177                                         <option value="">No limit</option>
178                                             [% FOREACH search_languages_loo IN search_languages_loop %]
179                                                 [% IF ( search_languages_loo.selected ) %]
180                                                     <option value="ln,rtrn:[% search_languages_loo.iso639_2_code %]" selected="selected">[% search_languages_loo.language_description %]</option>
181                                                 [% ELSE %]
182                                                     <option value="ln,rtrn:[% search_languages_loo.iso639_2_code %]">[% search_languages_loo.language_description %]</option>
183                                                 [% END %]
184                                             [% END %]
185                                     </select>
186                                 </p>
187                                 <!-- /LANGUAGE LIMIT -->
188                             </fieldset>
189                         </div> <!-- / #langfilter -->
190                     </div> <!-- / .span3 -->
191
192                     [% UNLESS ( singleBranchMode ) %]
193                         <div class="span3">
194                             <!-- AVAILABILITY LIMITS -->
195                             <div id="location">
196                                 <fieldset>
197                                     <legend>Location and availability: </legend>
198                                     <label for="branchloop">Library:</label>
199                                     <select name="limit" id="branchloop">
200                                     <option value="">All libraries</option>
201                                     [% FOREACH BranchesLoo IN BranchesLoop %]
202                                         [% IF ( BranchesLoo.selected ) %]
203                                             <option value="branch:[% BranchesLoo.value %]" selected="selected">[% BranchesLoo.branchname %]</option>
204                                         [% ELSE %]
205                                             <option value="branch:[% BranchesLoo.value %]">[% BranchesLoo.branchname %]</option>
206                                         [% END %]
207                                     [% END %]
208                                     </select>
209                                     [% IF ( searchdomainloop ) %]
210                                         <p>OR</p>
211                                         <label for="categoryloop">Groups of libraries</label>
212                                         <select name="multibranchlimit" id="categoryloop">
213                                             <option value=""> -- none -- </option>
214                                             [% FOREACH searchdomainloo IN searchdomainloop %]
215                                                 <option value="[% searchdomainloo.categorycode %]">[% searchdomainloo.categoryname %]</option>
216                                             [% END %]
217                                         </select>
218                                     [% END %]
219                                     <div style="margin-top:.4em">
220                                         <label for="available-items"><input type="checkbox" id="available-items" name="limit" value="available" /> Only items currently available for loan or reference</label>
221                                     </div>
222                                 </fieldset>
223                             </div> <!-- / #location -->
224                             <!-- /AVAILABILITY LIMITS -->
225                         </div> <!-- / .span3 -->
226                     [% END # / UNLESS singleBranchMode %]
227
228                     <div class="span3">
229                     <!-- RANK LIMITS -->
230                         <div id="sortby">
231                             <fieldset>
232                                 <legend>Sorting: </legend>
233                                 <label for="sort_by">Sort by:</label>
234                                 <select id="sort_by" name="sort_by">
235                                     [% INCLUDE 'resort_form.inc' %]
236                                 </select>
237                             </fieldset>
238                         </div>
239                     <!-- RANK LIMITS -->
240                     </div> <!-- / .span3 -->
241                 </div> <!-- / .row-fluid -->
242
243                 [% IF ( expanded_options ) %]
244                     <div class="row-fluid">
245                         [% IF ( usmarc ) %]
246                             <!-- SUBTYPE LIMITS -->
247                                 <div id="subtypes">
248                                     <div class="span3">
249                                         <fieldset>
250                                             <legend>Audience</legend>
251                                             <select name="limit" class="subtype">
252                                             <option value="" selected="selected" class="menuheader">Any audience</option>
253                                                 <option value="aud:a">Preschool</option>
254                                                 <option value="aud:b">Primary</option>
255                                                 <option value="aud:c">Pre-adolescent</option>
256                                                 <option value="aud:d">Adolescent</option>
257                                                 <option value="aud:e">Adult</option>
258                                                 <option value="aud:f">Specialized</option>
259                                                 <option value="aud:g">General</option>
260                                                 <option value="aud:j">Juvenile</option>
261                                             </select>
262                                         </fieldset>
263                                     </div> <!-- / .span3 -->
264
265                                     <div class="span3">
266                                         <fieldset>
267                                             <legend>Content</legend>
268                                             <select name="limit" class="subtype">
269                                                 <option value="" selected="selected" class="menuheader">Any content</option>
270                                                 <option value="fic:1">Fiction</option>
271                                                 <option value="fic:0">Non fiction</option>
272                                                 <option value="bio:b">Biography</option>
273                                                 <option value="mus:j">Musical recording</option>
274                                                 <option value="mus:i">Non-musical recording</option>
275                                             </select>
276                                         </fieldset>
277                                     </div>
278
279                                     <div class="span3">
280                                         <fieldset>
281                                             <legend>Format</legend>
282                                             <select name="limit" class="subtype">
283                                                 <option value="" selected="selected" class="menuheader">Any format</option>
284                                                 <option value="l-format:ta">Regular print</option>
285                                                 <option value="l-format:tb">Large print</option>
286                                                 <option value="l-format:fk">Braille</option>
287                                                 <option value="">-----------</option>
288                                                 <option value="l-format:sd">CD audio</option>
289                                                 <option value="l-format:ss">Cassette recording</option>
290                                                 <option value="l-format:vf">VHS tape / Videocassette</option>
291                                                 <option value="l-format:vd">DVD video / Videodisc</option>
292                                                 <option value="l-format:co">CD software</option>
293                                                 <option value="l-format:cr">Website</option>
294                                             </select>
295                                         </fieldset>
296                                     </div> <!-- / .span3 -->
297
298                                     <div class="span3">
299                                         <fieldset>
300                                             <legend>Additional content types for books/printed materials</legend>
301                                             <select name="limit" class="subtype">
302                                                 <option value="">Any</option>
303                                                 <option value="ctype:a">Abstracts/summaries</option>
304                                                 <option value="ctype:b">Bibliographies</option>
305                                                 <option value="ctype:c">Catalogs</option>
306                                                 <option value="ctype:d">Dictionaries</option>
307                                                 <option value="ctype:e">Encyclopedias </option>
308                                                 <option value="ctype:f">Handbooks</option>
309                                                 <option value="ctype:g">Legal articles</option>
310                                                 <option value="ctype:i">Indexes</option>
311                                                 <option value="ctype:j">Patent document</option>
312                                                 <option value="ctype:k">Discographies</option>
313                                                 <option value="ctype:l">Legislation</option>
314                                                 <option value="ctype:m">Theses</option>
315                                                 <option value="ctype:n">Surveys</option>
316                                                 <option value="ctype:o">Reviews</option>
317                                                 <option value="ctype:p">Programmed texts</option>
318                                                 <option value="ctype:q">Filmographies</option>
319                                                 <option value="ctype:r">Directories</option>
320                                                 <option value="ctype:s">Statistics</option>
321                                                 <option value="ctype:t">Technical reports</option>
322                                                 <option value="ctype:v">Legal cases and case notes</option>
323                                                 <option value="ctype:w">Law reports and digests</option>
324                                                 <option value="ctype:z">Treaties </option>
325                                             </select>
326                                         </fieldset>
327                                     </div> <!-- / .span3 -->
328                                 </div> <!-- / #subtypes -->
329                             [% END # / IF usmarc %]
330
331                             [% IF ( UNIMARC ) %]
332                                 <div id="subtypes_unimarc">
333                                     <!-- SUBTYPE LIMITS -->
334                                     [% INCLUDE 'subtypes_unimarc.inc' %]
335                                 </div>
336                             [% END %]
337                         </div> <!-- / .span4 -->
338                     </div> <!-- / .row-fluid -->
339                 [% END # / IF expanded_options %]
340             </div> <!-- / .row-fluid -->
341         </div> <!-- / .container-fluid -->
342     </div> <!-- / .main -->
343
344         <div class="container-fluid">
345             <div class="row-fluid">
346                 <div class="span12">
347                     <div class="text-center">
348                         <!-- SEARCH BUTTONS -->
349                         [% PROCESS searchbuttons %]
350                         <!-- /SEARCH BUTTONS -->
351                     </div>
352                 </div> <!-- / .span12 -->
353             </div> <!-- / .row-fluid -->
354         </div> <!-- / .container-fluid -->
355 </form>
356
357 [% INCLUDE 'opac-bottom.inc' %]
358 [% BLOCK searchbuttons %]
359     <p>
360         <input class="btn btn-success" type="submit" accesskey="s" name="do" title="Search" value="Search" />
361         [% IF ( expanded_options ) %]
362             <a href="/cgi-bin/koha/opac-search.pl?expanded_options=0">[Fewer options]</a>
363         [% ELSE %]
364             <a href="/cgi-bin/koha/opac-search.pl?expanded_options=1">[More options]</a>
365         [% END %]
366         <a href="/cgi-bin/koha/opac-search.pl?do=Clear">[New search]</a>
367     </p>
368 [% END %]
369
370 [% BLOCK jsinclude %]
371 <script type="text/javascript">//<![CDATA[
372     $(document).ready(function() {
373         $('#advsearches').tabs();
374     });
375     /* This function allows to display a new field to search.
376     */
377     $(document).on("click", '.ButtonPlus', function(e) {
378         e.preventDefault();
379         $('.ButtonLess').show();
380         var thisLine = $(this).parent();
381         var newLine = thisLine.clone();
382         newLine.find('input').val('');
383         thisLine.after(newLine);
384     });
385
386     $(document).on("click", '.ButtonLess', function(e) {
387         e.preventDefault();
388         if($(this).parent().siblings().length <= 3 ) {
389            $('.ButtonLess').hide();
390         }
391         $(this).parent().remove();
392     });
393     //]]>
394 </script>
395 [% END %]