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