View | Details | Raw Unified | Return to bug 30424
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/advsearch.tt (-293 / +316 lines)
Lines 9-28 Link Here
9
</head>
9
</head>
10
10
11
[%- BLOCK language_limit_select -%]
11
[%- BLOCK language_limit_select -%]
12
<select name="limit" id="[% ln_id | html %]">
12
    <select name="limit" id="[% ln_id | html %]">
13
    <option value="">No limit</option>
13
        <option value="">No limit</option>
14
    [% FOREACH ln_loo IN ln_loop %]
14
        [% FOREACH ln_loo IN ln_loop %]
15
        [% IF ( ln_loo.selected or selected == ln_loo.iso639_2_code ) %]
15
            [% IF ( ln_loo.selected or selected == ln_loo.iso639_2_code ) %]
16
            <option value="[% ln_index | html %],rtrn:[% ln_loo.iso639_2_code | html %]" selected="selected">
16
                <option value="[% ln_index | html %],rtrn:[% ln_loo.iso639_2_code | html %]" selected="selected">
17
                [% ln_loo.language_description | html %]
17
                    [% ln_loo.language_description | html %]
18
            </option>
18
                </option>
19
        [% ELSE %]
19
            [% ELSE %]
20
            <option value="[% ln_index | html %],rtrn:[% ln_loo.iso639_2_code | html %]">
20
                <option value="[% ln_index | html %],rtrn:[% ln_loo.iso639_2_code | html %]">
21
                [% ln_loo.language_description | html %]
21
                    [% ln_loo.language_description | html %]
22
            </option>
22
                </option>
23
            [% END %]
23
        [% END %]
24
        [% END %]
24
    [% END %]
25
    </select>
25
</select>
26
[%- END -%]
26
[%- END -%]
27
27
28
<body id="catalog_advsearch" class="catalog">
28
<body id="catalog_advsearch" class="catalog">
Lines 46-346 Link Here
46
    <div class="row">
46
    <div class="row">
47
        <div class="col-md-10 col-md-offset-1 col-lg-8 col-lg-offset-2">
47
        <div class="col-md-10 col-md-offset-1 col-lg-8 col-lg-offset-2">
48
48
49
<form action="search.pl" method="get">
49
            <form action="search.pl" method="get">
50
<div id="advanced-search">
50
                <div id="advanced-search">
51
<input type="hidden" name="advsearch" value="1"/>
51
                    <input type="hidden" name="advsearch" value="1"/>
52
<h1>Advanced search</h1>
52
                    <h1>Advanced search</h1>
53
<p>
53
                    <p>
54
  <a href="/cgi-bin/koha/catalogue/itemsearch.pl">Go to item search</a>
54
                        <a href="/cgi-bin/koha/catalogue/itemsearch.pl">Go to item search</a>
55
  [% IF searchid %]
55
                        [% IF searchid %]
56
      <div id="previous_search_link"></div>
56
                            <div id="previous_search_link"></div>
57
  [% END %]
57
                        [% END %]
58
</p>
58
                    </p>
59
59
60
<!-- SEARCH BUTTONS -->
60
                    <!-- SEARCH BUTTONS -->
61
<div id="toolbar" class="btn-toolbar">
61
                    <div id="toolbar" class="btn-toolbar">
62
    <fieldset class="action" id="submit1">
62
                        <fieldset class="action" id="submit1">
63
        <div class="btn-group">
63
                            <div class="btn-group">
64
            <button class="btn btn-default" type="submit" accesskey="s"><i class="fa fa-search"></i> Search</button>
64
                                <button class="btn btn-default" type="submit" accesskey="s"><i class="fa fa-search"></i> Search</button>
65
        </div>
65
                            </div>
66
        <div class="btn-group">
66
                            <div class="btn-group">
67
        [% IF ( expanded_options ) %]
67
                            [% IF ( expanded_options ) %]
68
            <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>
68
                                <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>
69
        </div>
69
                            </div>
70
        [% ELSE %]
70
                            [% ELSE %]
71
            <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>
71
                                <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>
72
        </div>
72
                            </div>
73
        [% END %]
73
                            [% END %]
74
        <div class="btn-group">
74
                            <div class="btn-group">
75
            <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>
75
                                <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>
76
        </div>
76
                            </div>
77
    </fieldset>
77
                        </fieldset>
78
</div>
78
                    </div>
79
<!-- /SEARCH BUTTONS -->
79
                    <!-- /SEARCH BUTTONS -->
80
80
81
                    [% IF ( outer_servers_loop ) %]
82
                        <!-- DATABASES -->
83
                        <fieldset>
84
                            <legend>Select local databases</legend>
85
                            [% FOREACH local_servers_loo IN local_servers_loop %]
86
                                [% IF ( local_servers_loo.checked ) %]
87
                                    <input type="checkbox" id="[% local_servers_loo.id | html %]" name="[% local_servers_loo.name | html %]" checked="checked" value="[% local_servers_loo.value | html %]" />
88
                                [% ELSE %]
89
                                    <input type="checkbox" id="[% local_servers_loo.id | html %]" name="[% local_servers_loo.name | html %]" value="[% local_servers_loo.value | html %]" />
90
                                [% END %]
91
                                <label for="[% local_servers_loo.id | html %]">
92
                                    <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 %]
93
                                </label>
94
                            [% END %]
95
                        </fieldset>
96
                        <!-- /DATABASES -->
97
                    [% END %]
81
98
82
[% IF ( outer_servers_loop ) %]
99
                    [% IF ( outer_servers_loop ) %]
83
<!-- DATABASES -->
100
                        <!-- REMOTE DATABASES -->
101
                        <fieldset id="databases">
102
                            <legend>Select remote databases</legend>
103
                            [% FOREACH outer_servers_loo IN outer_servers_loop %]
104
                                [% IF ( outer_servers_loo.checked ) %]
105
                                    <input type="checkbox" id="[% outer_servers_loo.id | html %]" name="[% outer_servers_loo.name | html %]" checked="checked" value="[% outer_servers_loo.value | html %]" />
106
                                [% ELSE %]
107
                                    <input type="checkbox" id="[% outer_servers_loo.id | html %]" name="[% outer_servers_loo.name | html %]" value="[% outer_servers_loo.value | html %]" />
108
                                [% END %]
109
                                <label for="[% outer_servers_loo.id | html %]">
110
                                    <img alt="[% outer_servers_loo.id | html %]" src="[% themelang | html %]/images/[% outer_servers_loo.icon | html %]" />[% outer_servers_loo.label | html %]
111
                                </label>
112
                            [% END %]
113
                        </fieldset>
114
                        <!-- /REMOTE DATABASES -->
115
                    [% END %]
84
116
85
<fieldset>
117
                    <!-- BOOLEAN SEARCH OPTIONS -->
86
        <legend>Select local databases</legend>
118
                    <fieldset id="searchterms">
87
                [% FOREACH local_servers_loo IN local_servers_loop %]
119
                        <legend>Search for </legend>
88
[% 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 %]
120
                        [% FOREACH query IN queries %]
89
</fieldset>
121
                            [% IF ( expanded_options ) %]
90
<!-- /DATABASES -->
122
                                [% IF loop.first %]
91
[% END %]
123
                                    <div class="search-term-row" style="text-indent: 4.25em;">
124
                                [% ELSE %]
125
                                    <div class="search-term-row">
126
                                        [% SET opindex = loop.index - 1 %]
127
                                        <select name="op">
128
                                            [% IF operators.$opindex == 'OR' %]
129
                                                <option value="AND">and</option>
130
                                                <option value="OR" selected="selected">or</option>
131
                                                <option value="NOT">not</option>
132
                                            [% ELSIF operators.$opindex == 'NOT' %]
133
                                                <option value="AND">and</option>
134
                                                <option value="OR">or</option>
135
                                                <option value="NOT" selected="selected">not</option>
136
                                            [% ELSE %]
137
                                                <option value="AND" selected="selected">and</option>
138
                                                <option value="OR">or</option>
139
                                                <option value="NOT">not</option>
140
                                            [% END %]
141
                                        </select>
142
                                [% END %]
143
                            [% ELSE %]
144
                                <div>
145
                            [% END %]
92
146
93
[% IF ( outer_servers_loop ) %]
147
                            [% SET preselect = 'ms_' _ indexes.${loop.index}.replace(',','comma') %]
94
<!-- REMOTE DATABASES -->
148
                            [% INCLUDE 'search_indexes.inc' %]
95
<fieldset id="databases">
149
                            <input type="text" size="30" name="q" title="Enter search terms" value="[% query | html %]" />
96
    <legend>Select remote databases</legend>
150
                            [% IF ( expanded_options ) %]
97
                [% FOREACH outer_servers_loo IN outer_servers_loop %]
151
                                [% IF ( loop.last ) %]
98
                [% 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 %]
152
                                    <a href="JavaScript:add_field();" id="ButtonPlus" title="Add another field">[+]</a>
99
<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>
153
                                [% END %]
100
                [% END %]
154
                                [% IF ( loop.first ) %]
101
    </fieldset>
155
                                    <label for="scan">Scan indexes:</label> <input type="checkbox" name="scan" id="scan" value="1" />
102
<!-- /REMOTE DATABASES -->
156
                                [% END %]
103
[% END %]
157
                            [% END %]
158
                            </div>
159
                        [% END %]
104
160
105
<!-- BOOLEAN SEARCH OPTIONS -->
161
                        [% IF Koha.Preference('SearchEngine') == 'Elasticsearch' %]
106
    <fieldset id="searchterms">
162
                            [% IF ( expanded_options ) %]
107
    <legend>Search for </legend>
163
                                <p>
108
    [% FOREACH query IN queries %]
164
                                    [% IF Koha.Preference('ElasticsearchMARCFormat') == 'ARRAY' %]
109
        [% IF ( expanded_options ) %]
165
                                        <label><input type="checkbox" name="whole_record" /> Search entire MARC record</label>
110
        [% IF loop.first %]
166
                                    [% END %]
111
        <div class="search-term-row" style="text-indent: 4.25em;">
167
                                    <span id="weight_search">
112
        [% ELSE %]
168
                                        <label><input type="checkbox" name="weight_search" checked="checked" /> Apply field weights to search</label>
113
        <div class="search-term-row">
169
                                    </span>
114
            [% SET opindex = loop.index - 1 %]
170
                                <p>
115
            <select name="op">
171
                            [% ELSE %]
116
            [% IF operators.$opindex == 'OR' %]
172
                                <input type="hidden" name="weight_search" value="1" />
117
                <option value="AND">and</option>
173
                            [% END %]
118
                <option value="OR" selected="selected">or</option>
174
                        [% END %]
119
                <option value="NOT">not</option>
175
                    </fieldset>
120
            [% ELSIF operators.$opindex == 'NOT' %]
176
                    <!-- /BOOLEAN SEARCH OPTIONS -->
121
                <option value="AND">and</option>
177
                </div>
122
                <option value="OR">or</option>
123
                <option value="NOT" selected="selected">not</option>
124
            [% ELSE %]
125
                <option value="AND" selected="selected">and</option>
126
                <option value="OR">or</option>
127
                <option value="NOT">not</option>
128
            [% END %]
129
            </select>
130
        [% END %]
131
        [% ELSE %]
132
        <div>
133
        [% END %]
134
        [% SET preselect = 'ms_' _ indexes.${loop.index}.replace(',','comma') %]
135
        [% INCLUDE 'search_indexes.inc' %]
136
        <input type="text" size="30" name="q" title="Enter search terms" value="[% query | html %]" />
137
        [% IF ( expanded_options ) %]
138
          [% IF ( loop.last ) %]
139
            <a href="JavaScript:add_field();" id="ButtonPlus" title="Add another field">[+]</a>
140
          [% END %]
141
          [% IF ( loop.first ) %]
142
            <label for="scan">Scan indexes:</label> <input type="checkbox" name="scan" id="scan" value="1" />
143
          [% END %]
144
        [% END %]
145
		</div>
146
    [% END %]
147
    [% IF Koha.Preference('SearchEngine') == 'Elasticsearch' %]
148
        [% IF ( expanded_options ) %]
149
            <p>
150
                [% IF Koha.Preference('ElasticsearchMARCFormat') == 'ARRAY' %]
151
                    <label><input type="checkbox" name="whole_record" /> Search entire MARC record</label>
152
                [% END %]
153
                <span id="weight_search">
154
                    <label><input type="checkbox" name="weight_search" checked="checked" /> Apply field weights to search</label>
155
                </span>
156
            <p>
157
        [% ELSE %]
158
            <input type="hidden" name="weight_search" value="1" />
159
        [% END %]
160
    [% END %]
161
    </fieldset>
162
<!-- /BOOLEAN SEARCH OPTIONS -->
163
178
164
</div>
179
                <!-- MC-TYPE LIMITS -->
165
<!-- MC-TYPE LIMITS -->
180
                <div id="advsearches" class="toptabs">
166
      <div id="advsearches" class="toptabs">
181
                    <ul>
167
      <ul>
182
                        [% FOREACH advsearchloo IN advancedsearchesloop %]
168
      [% FOREACH advsearchloo IN advancedsearchesloop %]
183
                            <li id="advsearch-tab-[% advsearchloo.advanced_search_type | html %]">
169
        <li id="advsearch-tab-[% advsearchloo.advanced_search_type | html %]">
184
                                <a href="#advsearch-[% advsearchloo.advanced_search_type | uri %]">
170
           <a href="#advsearch-[% advsearchloo.advanced_search_type | uri %]">
185
                                    [% IF ( advsearchloo.advanced_search_type == 'itemtypes' ) %]Item type
171
           [% IF ( advsearchloo.advanced_search_type == 'itemtypes' ) %]Item type
186
                                    [% ELSIF ( advsearchloo.advanced_search_type == 'ccode' ) %]Collection
172
           [% ELSIF ( advsearchloo.advanced_search_type == 'ccode' ) %]Collection
187
                                    [% ELSIF ( advsearchloo.advanced_search_type == 'loc' ) %]Shelving location
173
           [% ELSIF ( advsearchloo.advanced_search_type == 'loc' ) %]Shelving location
188
                                    [% ELSE %]Something else
174
           [% ELSE %]Something else
189
                                    [% END %]
175
           [% END %]
190
                                </a>
176
           </a>
191
                            </li>
177
        </li>
192
                        [% END %]
178
      [% END %]
193
                    </ul>
179
      </ul>
180
    [% FOREACH advsearchloo IN advancedsearchesloop %]
181
    <div id="advsearch-[% advsearchloo.advanced_search_type | html %]" class="advsearch">
182
    <h4>Limit to any of the following:</h4>
183
    <table>
184
        <tr>
185
    [% FOREACH itemtypeloo IN advsearchloo.code_loop %]
186
        <td>
187
            [% SET limit_key = 'mc-' _ itemtypeloo.ccl _ "_" _ itemtypeloo.code %]
188
            [% IF limits.$limit_key.defined %]
189
                [% limits.delete( limit_key ) %]
190
                <input type="checkbox" checked="checked" id="[% itemtypeloo.ccl FILTER remove(',') | html %]-[% itemtypeloo.number | html %]" name="limit" value="mc-[% itemtypeloo.ccl | html %]:[% itemtypeloo.code | html %]"/>
191
            [% ELSE %]
192
                <input type="checkbox" id="[% itemtypeloo.ccl FILTER remove(',') | html %]-[% itemtypeloo.number | html %]" name="limit" value="mc-[% itemtypeloo.ccl | html %]:[% itemtypeloo.code | html %]"/>
193
            [% END %]
194
            <label for="[% itemtypeloo.ccl FILTER remove(',') | html %]-[% itemtypeloo.number | html %]">
195
        [% UNLESS ( Koha.Preference('OpacNoItemTypeImages') ) %]
196
            [% IF ( itemtypeloo.imageurl ) %]
197
                <img src="[% itemtypeloo.imageurl | html %]" alt="[% itemtypeloo.description | html %]" />
198
            [% END %]
199
                &nbsp;
200
        [% END %]
201
        [% itemtypeloo.description | html %]
202
            </label>
203
        </td>
204
        [% IF ( loop.last ) %]
205
        </tr>
206
        [% ELSE %]
207
            [% UNLESS ( loop.count % 5 ) %]
208
        </tr>
209
        <tr>
210
            [% END %]
211
        [% END %]
212
    [% END %]
213
    </table>
214
    </div>
215
    [% END %]
216
<!-- /MC-TYPE LIMIT -->
217
[% IF ( expanded_options ) %]
218
<!-- BASIC LIMITS -->
219
 <fieldset id="basiclimits">
220
	<legend>Limits</legend>
221
<fieldset id="pubrange">
222
<!-- PUB / COPY YEAR LIMIT --><!-- FIXME: add publication,copyright,acquisition options -->
223
	<p><label for="limit-yr">Year: </label>
224
        [% SET year_limit_key = 'yr,st-numeric' %]
225
        <input type="text" size="15" name="limit-yr" id="limit-yr" value="[% limits.$year_limit_key.0 | html %]"/>&nbsp;&nbsp;(format: yyyy-yyyy)</p>
226
        [% IF limits.$year_limit_key.defined %]
227
            [% limits.delete(year_limit_key) %]
228
        [% END %]
229
<!-- /PUB / COPY YEAR LIMIT -->
230
</fieldset>
231
<fieldset id="language">
232
<!-- LANGUAGE LIMIT -->
233
    <p>
234
        <label for="language-limit">Language: </label>
235
        [% PROCESS language_limit_select ln_loop=search_languages_loop ln_id='language-limit' ln_index='ln' selected = limits.${'ln,rtrn'}.0 %]
236
        [% limits.delete( 'ln,rtrn' ) %]
237
        <label for="language-original-limit">Language of original: </label>
238
        [% PROCESS language_limit_select ln_loop=search_languages_loop ln_id='language-original-limit' ln_index='language-original' selected = limits.${'language-original,rtrn'}.0 %]
239
        [% limits.delete( 'language-original,rtrn' ) %]
240
    </p>
241
<!-- /LANGUAGE LIMIT -->
242
</fieldset>
243
</fieldset>
244
<!-- /BASIC LIMITS -->
245
[% END %]
246
194
247
[% IF ( UNIMARC ) %]
195
                    [% FOREACH advsearchloo IN advancedsearchesloop %]
248
[% INCLUDE 'subtypes_unimarc.inc' %]
196
                        <div id="advsearch-[% advsearchloo.advanced_search_type | html %]" class="advsearch">
249
[% ELSE %]
197
                            <h4>Limit to any of the following:</h4>
250
[% PROCESS 'subtype_limits.inc' %]
198
                            <table>
251
<!-- SUBTYPE LIMITS -->
199
                                <tr>
252
        <fieldset id="subtype">
200
                                    [% FOREACH itemtypeloo IN advsearchloo.code_loop %]
253
        <legend>Subtype limits</legend><p>
201
                                        <td>
254
        [% PROCESS subtype_dropdowns %]
202
                                            [% SET limit_key = 'mc-' _ itemtypeloo.ccl _ "_" _ itemtypeloo.code %]
255
        <fieldset id="current_subtype_limits"><legend>Current subtype limits</legend>
203
                                            [% IF limits.$limit_key.defined %]
256
        [% FOREACH subtype IN ['aud','fic','bio','ctype','l-format'] %]
204
                                                [% limits.delete( limit_key ) %]
257
            [% FOREACH limit IN limits.$subtype %]
205
                                                <input type="checkbox" checked="checked" id="[% itemtypeloo.ccl FILTER remove(',') | html %]-[% itemtypeloo.number | html %]" name="limit" value="mc-[% itemtypeloo.ccl | html %]:[% itemtypeloo.code | html %]"/>
258
                <span>
206
                                            [% ELSE %]
259
                    <input name="limit" value="[% subtype | html %]:[% limit | html %]" type="hidden">
207
                                                <input type="checkbox" id="[% itemtypeloo.ccl FILTER remove(',') | html %]-[% itemtypeloo.number | html %]" name="limit" value="mc-[% itemtypeloo.ccl | html %]:[% itemtypeloo.code | html %]"/>
260
                    <label for="subtype_limit_[% loop.index() | html %]">[%# PROCESS subtype_limits_description subtype_limit = subtype _':' _ limit #%]</label>
208
                                            [% END %]
261
                    <input type="checkbox" class="toggle_limit" name="subtype_limit_[% loop.index() | html %]" checked="checked">
209
                                            <label for="[% itemtypeloo.ccl FILTER remove(',') | html %]-[% itemtypeloo.number | html %]">
262
                </span>
210
                                                [% UNLESS ( Koha.Preference('OpacNoItemTypeImages') ) %]
263
           [% END %]
211
                                                    [% IF ( itemtypeloo.imageurl ) %]
264
            [% limits.delete( subtype ) %]
212
                                                        <img src="[% itemtypeloo.imageurl | html %]" alt="[% itemtypeloo.description | html %]" />
265
        [% END %]
213
                                                    [% END %]
266
        </fieldset>
214
                                                        &nbsp;
215
                                                [% END %]
216
                                                [% itemtypeloo.description | html %]
217
                                            </label>
218
                                        </td>
219
                                        [% IF ( loop.last ) %]
220
                                            </tr>
221
                                        [% ELSE %]
222
                                            [% UNLESS ( loop.count % 5 ) %]
223
                                                </tr>
224
                                                <tr>
225
                                            [% END %]
226
                                        [% END %]
227
                                    [% END %]
228
                            </table>
229
                        </div>
230
                    [% END %]
231
                </div>
232
                <!-- /MC-TYPE LIMIT -->
267
233
234
                [% IF ( expanded_options ) %]
235
                    <!-- BASIC LIMITS -->
236
                    <fieldset id="basiclimits">
237
                        <legend>Limits</legend>
238
                        <fieldset id="pubrange">
239
                            <!-- PUB / COPY YEAR LIMIT --><!-- FIXME: add publication,copyright,acquisition options -->
240
                            <p>
241
                                <label for="limit-yr">Year: </label>
242
                                [% SET year_limit_key = 'yr,st-numeric' %]
243
                                <input type="text" size="15" name="limit-yr" id="limit-yr" value="[% limits.$year_limit_key.0 | html %]"/>&nbsp;&nbsp;(format: yyyy-yyyy)
244
                                [% IF limits.$year_limit_key.defined %]
245
                                    [% limits.delete(year_limit_key) %]
246
                                [% END %]
247
                            </p>
248
                            <!-- /PUB / COPY YEAR LIMIT -->
249
                        </fieldset>
268
250
269
</fieldset>
251
                        <fieldset id="language">
270
[% END %]
252
                            <!-- LANGUAGE LIMIT -->
253
                            <p>
254
                                <label for="language-limit">Language: </label>
255
                                [% PROCESS language_limit_select ln_loop=search_languages_loop ln_id='language-limit' ln_index='ln' selected = limits.${'ln,rtrn'}.0 %]
256
                                [% limits.delete( 'ln,rtrn' ) %]
257
                                <label for="language-original-limit">Language of original: </label>
258
                                [% PROCESS language_limit_select ln_loop=search_languages_loop ln_id='language-original-limit' ln_index='language-original' selected = limits.${'language-original,rtrn'}.0 %]
259
                                [% limits.delete( 'language-original,rtrn' ) %]
260
                            </p>
261
                            <!-- /LANGUAGE LIMIT -->
262
                        </fieldset>
263
                    </fieldset>
264
                    <!-- /BASIC LIMITS -->
265
                [% END %]
271
266
272
<!-- AVAILABILITY LIMITS -->
267
                [% IF ( UNIMARC ) %]
273
    <fieldset id="availability"><legend>Location and availability</legend>
268
                    [% INCLUDE 'subtypes_unimarc.inc' %]
274
<fieldset id="currently-avail">
269
                [% ELSE %]
275
        [% IF limit_available %]
270
                    [% PROCESS 'subtype_limits.inc' %]
276
            <p><label for="available-items">Only items currently available:</label> <input type="checkbox" id="available-items" name="limit" value="available"  checked="checked" /></p>
271
                    <!-- SUBTYPE LIMITS -->
277
        [% ELSE %]
272
                    <fieldset id="subtype">
278
            <p><label for="available-items">Only items currently available:</label> <input type="checkbox" id="available-items" name="limit" value="available" /></p>
273
                        <legend>Subtype limits</legend><p>
279
        [% END %]
274
                        [% PROCESS subtype_dropdowns %]
280
</fieldset>
275
                        <fieldset id="current_subtype_limits">
276
                            <legend>Current subtype limits</legend>
277
                            [% FOREACH subtype IN ['aud','fic','bio','ctype','l-format'] %]
278
                                [% FOREACH limit IN limits.$subtype %]
279
                                    <span>
280
                                        <input name="limit" value="[% subtype | html %]:[% limit | html %]" type="hidden">
281
                                        <label for="subtype_limit_[% loop.index() | html %]">[%# PROCESS subtype_limits_description subtype_limit = subtype _':' _ limit #%]</label>
282
                                        <input type="checkbox" class="toggle_limit" name="subtype_limit_[% loop.index() | html %]" checked="checked">
283
                                    </span>
284
                                [% END %]
285
                                [% limits.delete( subtype ) %]
286
                            [% END %]
287
                        </fieldset>
288
                    </fieldset>
289
                [% END %]
281
290
282
<fieldset id="select-libs">
291
                <!-- AVAILABILITY LIMITS -->
283
        <p><label for="branchloop">Individual libraries:</label><select name="limit" id="branchloop">
292
                <fieldset id="availability">
284
        <option value="">All libraries</option>
293
                    <legend>Location and availability</legend>
285
        [%# FIXME Should not we filter the libraries displayed? %]
294
                    <fieldset id="currently-avail">
286
        [% PROCESS options_for_libraries prefix => "branch:" libraries => Branches.all( unfiltered => 1, do_not_select_my_library => 1, selected => limits.branch.0 ) %]
295
                        [% IF limit_available %]
287
        [% limits.delete('branch') %]
296
                            <p><label for="available-items">Only items currently available:</label> <input type="checkbox" id="available-items" name="limit" value="available"  checked="checked" /></p>
288
        </select></p>
297
                        [% ELSE %]
289
        [% IF search_groups %]
298
                            <p><label for="available-items">Only items currently available:</label> <input type="checkbox" id="available-items" name="limit" value="available" /></p>
290
            <p>OR</p>
299
                        [% END %]
300
                    </fieldset>
291
301
292
            <p>
302
                    <fieldset id="select-libs">
293
                <label for="categoryloop">Groups of libraries: </label>
303
                        <p>
294
                <select name="limit" id="categoryloop">
304
                            <label for="branchloop">Individual libraries:</label>
295
                    <option value=""> -- none -- </option>
305
                            <select name="limit" id="branchloop">
296
                    [% FOREACH sg IN search_groups %]
306
                                <option value="">All libraries</option>
297
                        [% UNLESS sg.branchcode %]
307
                                [%# FIXME Should not we filter the libraries displayed? %]
298
                            [% IF limits.multibranchlimit.0 == sg.id %]
308
                                [% PROCESS options_for_libraries prefix => "branch:" libraries => Branches.all( unfiltered => 1, do_not_select_my_library => 1, selected => limits.branch.0 ) %]
299
                                <option selected="selected" value="multibranchlimit:[% sg.id | html %]">[% sg.title | html %]</option>
309
                                [% limits.delete('branch') %]
300
                            [% ELSE %]
310
                            </select>
301
                                <option value="multibranchlimit:[% sg.id | html %]">[% sg.title | html %]</option>
311
                        </p>
302
                            [% END %]
312
                        [% IF search_groups %]
313
                            <p>OR</p>
314
                            <p>
315
                                <label for="categoryloop">Groups of libraries: </label>
316
                                <select name="limit" id="categoryloop">
317
                                    <option value=""> -- none -- </option>
318
                                    [% FOREACH sg IN search_groups %]
319
                                        [% UNLESS sg.branchcode %]
320
                                            [% IF limits.multibranchlimit.0 == sg.id %]
321
                                                <option selected="selected" value="multibranchlimit:[% sg.id | html %]">[% sg.title | html %]</option>
322
                                            [% ELSE %]
323
                                                <option value="multibranchlimit:[% sg.id | html %]">[% sg.title | html %]</option>
324
                                            [% END %]
325
                                        [% END %]
326
                                    [% END %]
327
                                    [% limits.delete('multibranchlimit') %]
328
                                </select>
329
                            </p>
303
                        [% END %]
330
                        [% END %]
304
                    [% END %]
331
                    </fieldset>
305
                    [% limits.delete('multibranchlimit') %]
332
                </fieldset>
306
                </select>
333
                <!-- /AVAILABILITY LIMITS -->
307
            </p>
308
    [% END %]
309
</fieldset>
310
    </fieldset>
311
<!-- /AVAILABILITY LIMITS -->
312
334
313
<!-- OTHER LIMITS (facets, etc.) -->
335
                <!-- OTHER LIMITS (facets, etc.) -->
314
[% IF limits.size %]
336
                [% IF limits.size %]
315
<fieldset id=""><legend>Other limits</legend>
337
                    <fieldset id="">
316
    <p>
338
                        <legend>Other limits</legend>
317
    [% FOREACH key IN limits.keys %]
339
                        <p>
318
        [% FOREACH limit IN limits.$key %]
340
                            [% FOREACH key IN limits.keys %]
319
            <span>
341
                                [% FOREACH limit IN limits.$key %]
320
                <input type="hidden" name="limit" value="[% key | html %]:[% limit | html %]">
342
                                    <span>
321
                <label for="other_[% key _ loop.index() | html %]">[% key | html %]:[% limit | html %]</label>
343
                                        <input type="hidden" name="limit" value="[% key | html %]:[% limit | html %]">
322
                <input type="checkbox" class="toggle_limit" name="other_[% key _ loop.index() | html %]" checked="checked">
344
                                        <label for="other_[% key _ loop.index() | html %]">[% key | html %]:[% limit | html %]</label>
323
            </span>
345
                                        <input type="checkbox" class="toggle_limit" name="other_[% key _ loop.index() | html %]" checked="checked">
324
        [% END %]
346
                                    </span>
325
    [% END %]
347
                                [% END %]
326
    </p>
348
                            [% END %]
327
</fieldset>
349
                        </p>
328
[% END %]
350
                    </fieldset>
329
<!-- /OTHER LIMITS (facets, etc.) -->
351
                [% END %]
352
                <!-- /OTHER LIMITS (facets, etc.) -->
330
353
331
<!-- RANK LIMITS -->
354
                <!-- RANK LIMITS -->
332
<fieldset id="sortby"><legend>Sorting</legend>
355
                <fieldset id="sortby">
333
    <p>
356
                    <legend>Sorting</legend>
334
    <label for="sort_by">Sort by: </label><select id="sort_by" name="sort_by">
357
                    <p>
335
  [% INCLUDE 'resort_form.inc' sort_by = sort %]
358
                        <label for="sort_by">Sort by: </label>
336
    </select>
359
                        <select id="sort_by" name="sort_by">
337
        </p>
360
                            [% INCLUDE 'resort_form.inc' sort_by = sort %]
338
</fieldset>
361
                        </select>
339
</div>
362
                    </p>
340
<!-- /RANK LIMITS -->
363
                </fieldset>
341
</form>
364
                <!-- /RANK LIMITS -->
342
</div>
365
            </form>
343
</div>
366
        </div>
367
    </div>
344
368
345
[% MACRO jsinclude BLOCK %]
369
[% MACRO jsinclude BLOCK %]
346
    [% Asset.js("lib/hc-sticky.js") | $raw %]
370
    [% Asset.js("lib/hc-sticky.js") | $raw %]
347
- 

Return to bug 30424