Bug 22023: Further improve responsive layout handling of staff client menu bar
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / catalogue / advsearch.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE Branches %]
4 [% SET footerjs = 1 %]
5 [% INCLUDE 'doc-head-open.inc' %]
6 <title>Koha &rsaquo; Catalog &rsaquo; Advanced search</title>
7 [% INCLUDE 'doc-head-close.inc' %]
8 </head>
9
10 <body id="catalog_advsearch" class="catalog">
11 [% INCLUDE 'header.inc' %]
12 [% INCLUDE 'adv-search.inc' %]
13 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; Advanced search</div>
14
15 <div class="main container-fluid">
16     <div class="row">
17         <div class="col-md-10 col-md-offset-1 col-lg-8 col-lg-offset-2">
18
19 <form action="search.pl" method="get">
20 <div id="advanced-search">
21 <input type="hidden" name="advsearch" value="1"/>
22 <h1>Advanced search</h1>
23 <p>
24   <a href="/cgi-bin/koha/catalogue/itemsearch.pl">Go to item search</a>
25 </p>
26
27 <!-- SEARCH BUTTONS -->
28 <div id="toolbar" class="btn-toolbar">
29     <fieldset class="action" id="submit1">
30         <div class="btn-group">
31             <button class="btn btn-default" type="submit" accesskey="s"><i class="fa fa-search"></i> Search</button>
32         </div>
33         <div class="btn-group">
34         [% IF ( expanded_options ) %]
35             <a href="/cgi-bin/koha/catalogue/search.pl?expanded_options=0" class="btn btn-sm btn-link"><i class="fa fa-search-minus"></i> Fewer options</a>
36         </div>
37         [% ELSE %]
38             <a href="/cgi-bin/koha/catalogue/search.pl?expanded_options=1" class="btn btn-sm btn-link"><i class="fa fa-search-plus"></i> More options</a>
39         </div>
40         [% END %]
41         <div class="btn-group">
42             <a href="/cgi-bin/koha/catalogue/search.pl?do=Clear&expanded_options=[% expanded_options | uri %]" class="btn btn-sm btn-link"><i class="fa fa-trash"></i> Clear fields</a>
43         </div>
44     </fieldset>
45 </div>
46 <!-- /SEARCH BUTTONS -->
47
48
49 [% IF ( outer_servers_loop ) %]
50 <!-- DATABASES -->
51
52 <fieldset>
53         <legend>Select local databases</legend>
54                 [% FOREACH local_servers_loo IN local_servers_loop %]
55 [% IF ( local_servers_loo.checked ) %]<input type="checkbox" id="[% local_servers_loo.id | html %]" name="[% local_servers_loo.name | html %]" checked="checked" value="[% local_servers_loo.value | html %]" />[% ELSE %]<input type="checkbox" id="[% local_servers_loo.id | html %]" name="[% local_servers_loo.name | html %]" value="[% local_servers_loo.value | html %]" />[% END %]<label for="[% local_servers_loo.id | html %]"><img width="16" height="16" alt="[% local_servers_loo.id | html %]" src="[% themelang | html %]/img/[% local_servers_loo.icon | html %]" /> [% local_servers_loo.label | html %]</label>[% END %]
56 </fieldset>
57 <!-- /DATABASES -->
58 [% END %]
59
60 [% IF ( outer_servers_loop ) %]
61 <!-- REMOTE DATABASES -->
62 <fieldset id="databases">
63     <legend>Select remote databases</legend>
64                 [% FOREACH outer_servers_loo IN outer_servers_loop %]
65                 [% IF ( outer_servers_loo.checked ) %]<input type="checkbox" id="[% outer_servers_loo.id | html %]" name="[% outer_servers_loo.name | html %]" checked="checked" value="[% outer_servers_loo.value | html %]" />[% ELSE %]<input type="checkbox" id="[% outer_servers_loo.id | html %]" name="[% outer_servers_loo.name | html %]" value="[% outer_servers_loo.value | html %]" />[% END %]
66 <label for="[% outer_servers_loo.id | html %]"><img alt="[% outer_servers_loo.id | html %]" src="[% themelang | html %]/images/[% outer_servers_loo.icon | html %]" />[% outer_servers_loo.label | html %]</label>
67                 [% END %]
68     </fieldset>
69 <!-- /REMOTE DATABASES -->
70 [% END %]
71
72 <!-- BOOLEAN SEARCH OPTIONS -->
73     <fieldset id="searchterms">
74     <legend>Search for </legend>
75     [% FOREACH search_box IN search_boxes_loop %]
76         [% IF ( search_boxes_label ) %]<div style="text-indent: 4.5em;">[% ELSE %]<div>[% END %]
77                         [% IF ( expanded_options ) %]
78             [% IF ( search_box.boolean ) %]
79                 <select name="op">
80                     <option value="and" selected="selected">and</option>
81                     <option value="or">or</option>
82                     <option value="not">not</option>
83                 </select>
84             [% END %] 
85                         [% END %]
86                         [% INCLUDE 'search_indexes.inc' %]
87                         <input type="text" size="30" name="q" title="Enter search terms" value="" />
88             [% IF ( expanded_options ) %]
89                 [% IF ( search_box.add_field ) %]
90                     <a href="JavaScript:add_field();" id="ButtonPlus" title="Add another field">[+]</a>
91                                 [% END %]
92               [% IF ( search_box.scan_index ) %]
93                 <label for="scan">Scan indexes:</label> <input type="checkbox" name="scan" id="scan" value="1" />
94               [% END %]
95             [% END %]
96                 </div>
97     [% END %]
98     </fieldset>
99 <!-- /BOOLEAN SEARCH OPTIONS -->
100
101 </div>
102 <!-- MC-TYPE LIMITS -->
103       <div id="advsearches" class="toptabs">
104       <ul>
105       [% FOREACH advsearchloo IN advancedsearchesloop %]
106         <li id="advsearch-tab-[% advsearchloo.advanced_search_type | html %]">
107            <a href="#advsearch-[% advsearchloo.advanced_search_type | uri %]">
108            [% IF ( advsearchloo.advanced_search_type == 'itemtypes' ) %]Item type
109            [% ELSIF ( advsearchloo.advanced_search_type == 'ccode' ) %]Collection
110            [% ELSIF ( advsearchloo.advanced_search_type == 'loc' ) %]Shelving location
111            [% ELSE %]Something else
112            [% END %]
113            </a>
114         </li>
115       [% END %]
116       </ul>
117     [% FOREACH advsearchloo IN advancedsearchesloop %]
118     <div id="advsearch-[% advsearchloo.advanced_search_type | html %]" class="advsearch">
119     <h4>Limit to any of the following:</h4>
120     <table>
121         <tr>
122     [% FOREACH itemtypeloo IN advsearchloo.code_loop %]
123         <td><input type="checkbox" id="[% itemtypeloo.ccl FILTER remove(',') | html %]-[% itemtypeloo.number | html %]" name="limit" value="mc-[% itemtypeloo.ccl | html %]:[% itemtypeloo.code | html %]"/><label for="[% itemtypeloo.ccl FILTER remove(',') | html %]-[% itemtypeloo.number | html %]">[% UNLESS ( noItemTypeImages ) %][% IF ( itemtypeloo.imageurl ) %]<img src="[% itemtypeloo.imageurl | html %]" alt="[% itemtypeloo.description | html %]" />[% END %]&nbsp;[% END %]
124         [% itemtypeloo.description | html %]</label></td>
125         [% IF ( loop.last ) %]</tr>[% ELSE %][% UNLESS ( loop.count % 5 ) %]</tr><tr>[% END %][% END %]
126     [% END %]
127     </table>
128     </div>
129     [% END %]
130 <!-- /MC-TYPE LIMIT -->
131 [% IF ( expanded_options ) %]
132 <!-- BASIC LIMITS -->
133  <fieldset id="basiclimits">
134         <legend>Limits</legend>
135 <fieldset id="pubrange">
136 <!-- PUB / COPY YEAR LIMIT --><!-- FIXME: add publication,copyright,acquisition options -->
137         <p><label for="limit-yr">Year: </label>
138                 <input type="text" size="15" name="limit-yr" id="limit-yr" value=""/>&nbsp;&nbsp;(format: yyyy-yyyy)</p>
139 <!-- /PUB / COPY YEAR LIMIT -->
140 </fieldset>
141 <fieldset id="language">
142 <!-- LANGUAGE LIMIT -->
143                 <p><label for="language-limit">Language: </label>                                        
144                 <select name="limit" id="language-limit">
145         <option value="">No limit</option>
146                 [% FOREACH search_languages_loo IN search_languages_loop %]
147                 [% IF ( search_languages_loo.selected ) %]
148                 <option value="ln,rtrn:[% search_languages_loo.iso639_2_code | html %]" selected="selected">[% search_languages_loo.language_description | html %]</option>
149                 [% ELSE %]
150                 <option value="ln,rtrn:[% search_languages_loo.iso639_2_code | html %]">[% search_languages_loo.language_description | html %]</option>
151                 [% END %]
152                 
153                 [% END %]
154                 </select></p><!-- <a href="">Show all languages</a>-->
155 <!-- /LANGUAGE LIMIT -->
156 </fieldset>
157 </fieldset>
158 <!-- /BASIC LIMITS -->
159 [% END %]
160
161
162 [% IF ( UNIMARC ) %]
163 [% INCLUDE 'subtypes_unimarc.inc' %]
164 [% ELSE %]
165 <!-- SUBTYPE LIMITS -->
166         <fieldset id="subtype">
167         <legend>Subtype limits</legend><p>
168         
169         <select name="limit" class="subtype">
170             <option value="" selected="selected" class="menuheader">Any audience</option>
171                         <option value="aud:a">Preschool</option>
172                         <option value="aud:b">Primary</option>
173                         <option value="aud:c">Pre-adolescent</option>
174                         <option value="aud:d">Adolescent</option>
175                         <option value="aud:e">Adult</option>
176                         <option value="aud:f">Specialized</option>
177                         <option value="aud:g">General</option>
178                         <option value="aud:j">Juvenile</option>
179         </select>
180         
181         <select name="limit" class="subtype">
182             <option value="" selected="selected" class="menuheader">Any content</option>
183             <option value="fic:1" >Fiction</option>
184             <option value="fic:0" >Non-fiction</option>
185             <option value="bio:b" >Biography</option>
186             <option value="mus:j" >Musical recording</option>
187             <option value="mus:i" >Non-musical recording</option>
188         </select>
189
190         
191         <select name="limit" class="subtype">
192             <option value="" selected="selected" class="menuheader">Any format</option>
193             <option value="l-format:ta" >Regular print</option>
194             <option value="l-format:tb" >Large print</option>
195             <option value="l-format:fk" >Braille</option>
196             <option value="" >-----------</option>
197             <option value="l-format:sd" >CD audio</option>
198             <option value="l-format:ss" >Cassette recording</option>
199             <option value="l-format:vf" >VHS tape / Videocassette</option>
200             <option value="l-format:vd" >DVD video / Videodisc</option>
201             <option value="l-format:co" >CD software</option>
202             <option value="l-format:cr" >Website</option>
203         </select>
204         
205         <select name="limit" class="subtype">
206             <option value="" >Additional content types</option>
207             <option value="ctype:a" >Abstracts / Summaries</option>
208             <option value="ctype:b" >Bibliographies</option>
209             <option value="ctype:c" >Catalogs</option>
210             <option value="ctype:d" >Dictionaries</option>
211             <option value="ctype:e" >Encyclopedias </option>
212             <option value="ctype:f" >Handbooks</option>
213             <option value="ctype:g" >Legal articles</option>
214             <option value="ctype:i" >Indexes</option>
215             <option value="ctype:j" >Patent document</option>
216             <option value="ctype:k" >Discographies</option>
217             <option value="ctype:l" >Legislation</option>
218             <option value="ctype:m" >Theses</option>
219             <option value="ctype:n" >Surveys</option>
220             <option value="ctype:o" >Reviews</option>
221             <option value="ctype:p" >Programmed texts</option>
222             <option value="ctype:q" >Filmographies</option>
223             <option value="ctype:r" >Directories</option>
224             <option value="ctype:s" >Statistics</option>
225             <option value="ctype:t" >Technical reports</option>
226             <option value="ctype:v" >Legal cases and case notes</option>
227             <option value="ctype:w" >Law reports and digests</option>
228             <option value="ctype:z" >Treaties </option>
229         </select>
230        </p>
231
232 </fieldset>
233 [% END %]
234
235 <!-- AVAILABILITY LIMITS -->
236     <fieldset id="availability"><legend>Location and availability</legend>
237 <fieldset id="currently-avail">
238         <p><label for="available-items">Only items currently available:</label> <input type="checkbox" id="available-items" name="limit" value="available" /></p>
239 </fieldset>
240
241 <fieldset id="select-libs">
242         <p><label for="branchloop">Individual libraries:</label><select name="limit" id="branchloop">
243         <option value="">All libraries</option>
244         [%# FIXME Should not we filter the libraries displayed? %]
245         [% PROCESS options_for_libraries prefix => "branch:" libraries => Branches.all( selected => selected_branchcode, unfiltered => 1 ) %]
246         </select></p>
247     <!-- <input type="hidden" name="limit" value="branch: MAIN" /> -->
248         [% IF search_groups %]
249             <p>OR</p> <!-- should addjs to grey out group pulldown if a library is selected. -->
250
251             <p>
252                 <label for="categoryloop">Groups of libraries: </label>
253                 <select name="multibranchlimit" id="categoryloop">
254                     <option value=""> -- none -- </option>
255                     [% FOREACH sg IN search_groups %]
256                         [% UNLESS sg.branchcode %]
257                             <option value="[% sg.id | html %]">[% sg.title | html %]</option>
258                         [% END %]
259                     [% END %]
260                 </select>
261             </p>
262     [% END %]
263 </fieldset>
264     </fieldset>
265 <!-- /AVAILABILITY LIMITS -->
266
267 <!-- RANK LIMITS -->
268 <fieldset id="sortby"><legend>Sorting</legend>
269     <p>
270     <label for="sort_by">Sort by: </label><select id="sort_by" name="sort_by">
271   [% INCLUDE 'resort_form.inc' %]
272     </select>
273         </p>
274 </fieldset>
275 </div>
276 <!-- /RANK LIMITS -->
277 </form>
278 </div>
279 </div>
280
281 [% MACRO jsinclude BLOCK %]
282     [% Asset.js("lib/hc-sticky.js") | $raw %]
283     <script type="text/JavaScript">
284         /**
285          *  Function add_field();
286          *  This function allows to display a new field to search.
287          */
288         function add_field() {
289             var ButtonPlus = document.getElementById("ButtonPlus");
290             var line = ButtonPlus.parentNode;
291             var dad  = line.parentNode;
292             dad.appendChild(line.cloneNode(true));
293             line.removeChild(ButtonPlus);
294         }
295         var Sticky;
296         $(document).ready(function() {
297             $("input[name=q]:eq(0)").focus();
298             $('#advsearches').tabs();
299             Sticky = $("#toolbar");
300             Sticky.hcSticky({
301                 stickTo: ".main",
302                 stickyClass: "floating"
303             });
304             $("#branchloop").on("change",function(){
305                 if( this.value != ""){
306                     document.getElementById("categoryloop").disabled=true;
307                 } else {
308                     document.getElementById("categoryloop").disabled=false;
309                 }
310             });
311         });
312     </script>
313 [% END %]
314
315 [% INCLUDE 'intranet-bottom.inc' %]