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