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