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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/searchengine/elasticsearch/mappings.tt (-325 / +335 lines)
Lines 115-467 a.add, a.delete { Link Here
115
    </div>
115
    </div>
116
116
117
    <form id="es_mappings" method="post">
117
    <form id="es_mappings" method="post">
118
        <div id="tabs" class="toptabs ui-tabs" style="clear:both">
118
        <div id="tabs" class="toptabs">
119
            <ul>
119
            <ul class="nav nav-tabs" role="tablist">
120
                <li><a href="#search_fields">Search fields</a></li>
120
                <li role="presentation" class="active">
121
                    <a href="#search_fields" data-tab="search_fields" aria-controls="search_fields" role="tab" data-toggle="tab" >Search fields</a>
122
                </li>
121
                [% FOREACH index IN indexes %]
123
                [% FOREACH index IN indexes %]
122
                    [% SWITCH index.index_name %]
124
                    [% SWITCH index.index_name %]
123
                        [% CASE 'biblios' %]<li><a href="#mapping_biblios">Bibliographic records</a></li>
125
                        [% CASE 'biblios' %]
124
                        [% CASE 'authorities' %]<li><a href="#mapping_authorities">Authorities</a></li>
126
                            <li role="presentation">
127
                                <a href="#mapping_biblios" data-tab="mapping_biblios" aria-controls="mapping_biblios" role="tab" data-toggle="tab">Bibliographic records</a>
128
                            </li>
129
                        [% CASE 'authorities' %]
130
                            <li role="presentation">
131
                                <a href="#mapping_authorities" data-tab="mapping_authorities" aria-controls="mapping_authorities" role="tab" data-toggle="tab">Authorities</a>
132
                            </li>
125
                    [% END %]
133
                    [% END %]
126
                [% END %]
134
                [% END %]
127
            </ul>
135
            </ul>
128
            <div id="search_fields" class="ui-tabs-panel">
136
            <div class="tab-content">
129
              <table class="search_fields" id="search_fields_table">
137
                <div id="search_fields" role="tabpanel" class="tab-pane active">
130
                <thead>
138
                    <table class="search_fields" id="search_fields_table">
131
                  <tr>
139
                        <thead>
132
                    <th>Name</th>
140
                        <tr>
133
                    <th>Aliases</th>
141
                            <th>Name</th>
134
                    <th>Label</th>
142
                            <th>Aliases</th>
135
                    <th>Type</th>
143
                            <th>Label</th>
136
                    <th>Weight</th>
144
                            <th>Type</th>
137
                    <th colspan="2">Searchable</th>
145
                            <th>Weight</th>
138
                  </tr>
146
                            <th colspan="2">Searchable</th>
139
                  <tr>
140
                    <th colspan="5" class="NoSort">&nbsp;</th>
141
                    <th class="NoSort">Staff interface</th>
142
                    <th class="NoSort">OPAC</th>
143
                  </tr>
144
                </thead>
145
                <tbody>
146
                  [% FOREACH search_field IN all_search_fields %]
147
                    <tr>
148
                      <td data-order="[% search_field.name | html %]">
149
                        [% IF search_field.mandatory %]
150
                            <input type="text" name="search_field_name" value="[% search_field.name | html %]" readonly />
151
                        [% ELSE %]
152
                            <input type="text" name="search_field_name" value="[% search_field.name | html %]" />
153
                        [% END %]
154
                      </td>
155
                      <td>
156
                          [% search_field.aliases.join(', ') | html %]
157
                      </td>
158
                      <td data-order="[% search_field.label | html %]">
159
                        [% IF search_field.mandatory %]
160
                            <input type="text" name="search_field_label" value="[% search_field.label | html %]" readonly />
161
                        [% ELSE %]
162
                            <input type="text" name="search_field_label" value="[% search_field.label | html %]" />
163
                        [% END %]
164
                      </td>
165
                      <td data-order="[% search_field.type | html %]">
166
                        [% IF search_field.mandatory %]
167
                            <input type="hidden" name="search_field_type" value="[% search_field.type | html %]" />
168
                            <select name="search_field_type" disabled>
169
                        [% ELSE %]
170
                            <select name="search_field_type">
171
                        [% END %]
172
                              <option value=""></option>
173
                              [% IF search_field.type == "string" %]
174
                                <option value="string" selected="selected">String</option>
175
                              [% ELSE %]
176
                                <option value="string">String</option>
177
                              [% END %]
178
                              [% IF search_field.type == "date" %]
179
                                <option value="date" selected="selected">Date</option>
180
                              [% ELSE %]
181
                                <option value="date">Date</option>
182
                              [% END %]
183
                              [% IF search_field.type == "year" %]
184
                                <option value="year" selected="selected">Year</option>
185
                              [% ELSE %]
186
                                <option value="year">Year</option>
187
                              [% END %]
188
                              [% IF search_field.type == "number" %]
189
                                <option value="number" selected="selected">Number</option>
190
                              [% ELSE %]
191
                                <option value="number">Number</option>
192
                              [% END %]
193
                              [% IF search_field.type == "boolean" %]
194
                                <option value="boolean" selected="selected">Boolean</option>
195
                              [% ELSE %]
196
                                <option value="boolean">Boolean</option>
197
                              [% END %]
198
                              [% IF search_field.type == "sum" %]
199
                                <option value="sum" selected="selected">Sum</option>
200
                              [% ELSE %]
201
                                <option value="sum">Sum</option>
202
                              [% END %]
203
                              [% IF search_field.type == "isbn" %]
204
                                <option value="isbn" selected="selected">ISBN</option>
205
                              [% ELSE %]
206
                                <option value="isbn">ISBN</option>
207
                              [% END %]
208
                              [% IF search_field.type == "stdno" %]
209
                                <option value="stdno" selected="selected">Std. Number</option>
210
                              [% ELSE %]
211
                                <option value="stdno">Std. Number</option>
212
                              [% END %]
213
                            </select>
214
                      </td>
215
                        <td data-order="[% search_field.weight | html %]">
216
                            [% IF search_field.mapped_biblios %]
217
                                <input type="text" inputmode="decimal" pattern="[0-9\.]*" name="search_field_weight" value="[% search_field.weight | html %]" />
218
                            [% ELSE %]
219
                                <input type="text" name="search_field_weight" value="">
220
                            [% END %]
221
                        </td>
222
                      <td>
223
                        <select name="search_field_staff_client">
224
                          [% IF search_field.staff_client %]
225
                            <option value="1" selected="selected">Yes</option>
226
                            <option value="0">No</option>
227
                          [% ELSE %]
228
                            <option value="1">Yes</option>
229
                            <option value="0" selected="selected">No</option>
230
                          [% END %]
231
                        </select>
232
                      </td>
233
                      <td>
234
                        <select name="search_field_opac">
235
                          [% IF search_field.opac %]
236
                            <option value="1" selected="selected">Yes</option>
237
                            <option value="0">No</option>
238
                          [% ELSE %]
239
                            <option value="1">Yes</option>
240
                            <option value="0" selected="selected">No</option>
241
                          [% END %]
242
                        </select>
243
                      </td>
244
                    </tr>
245
                  [% END %]
246
                </tbody>
247
              </table>
248
            </div>
249
            [% FOREACH index IN indexes %]
250
                <div id="mapping_[% index.index_name | html %]" class="ui-tabs-panel">
251
                    <table class="mappings" data-index_name="[% index.index_name | html %]" data-ordering="false" id="mapping_[% index.index_name | html %]_table">
252
                      <thead>
253
                        <tr class="nodrag nodrop">
254
                          <th>Search field</th>
255
                          <th>Sortable</th>
256
                          <th>Facetable</th>
257
                          <th>Suggestible</th>
258
                          <th>Searchable</th>
259
                          <th>Mapping</th>
260
                          <th>&nbsp;</th>
261
                        </tr>
147
                        </tr>
262
                      </thead>
148
                        <tr>
263
                      <tbody>
149
                            <th colspan="5" class="NoSort">&nbsp;</th>
264
                        [% FOREACH mapping IN index.mappings %]
150
                            <th class="NoSort">Staff interface</th>
265
                            [% IF mapping.search_field_mandatory && mapping.search_field_label != loop.next.search_field_label && mapping.search_field_label != loop.prev.search_field_label %]
151
                            <th class="NoSort">OPAC</th>
266
                              <tr>
152
                        </tr>
267
                                <td>
153
                        </thead>
268
                                  <input type="hidden" name="mapping_index_name" value="[% index.index_name | html %]" />
154
                        <tbody>
269
                                  <input type="hidden" name="mapping_search_field_name" value="[% mapping.search_field_name | html %]">
155
                        [% FOREACH search_field IN all_search_fields %]
270
                                  [% mapping.search_field_label | html %]
156
                            <tr>
271
                                </td>
157
                            <td data-order="[% search_field.name | html %]">
272
                                <td>
158
                                [% IF search_field.mandatory %]
273
                                  [% IF mapping.sort == 0 %]
159
                                    <input type="text" name="search_field_name" value="[% search_field.name | html %]" readonly />
274
                                      <input type="hidden" name="mapping_sort" value="0" readonly />No
160
                                [% ELSE %]
275
                                  [% ELSE %]
161
                                    <input type="text" name="search_field_name" value="[% search_field.name | html %]" />
276
                                      <input type="hidden" name="mapping_sort" value="1" readonly />Yes
162
                                [% END %]
277
                                  [% END %]
163
                            </td>
278
                                </td>
164
                            <td>
279
                                <td>
165
                                [% search_field.aliases.join(', ') | html %]
280
                                  <input type="hidden" name="mapping_facet" value="[% mapping.facet | html %]" readonly />[% IF mapping.facet == 1 %]Yes[% ELSE %]No[% END %]
166
                            </td>
281
                                </td>
167
                            <td data-order="[% search_field.label | html %]">
282
                                <td>
168
                                [% IF search_field.mandatory %]
283
                                  <input type="hidden" name="mapping_suggestible" value="[% mapping.suggestible | html %]" readonly />[% IF mapping.suggestible == 1 %]Yes[% ELSE %]No[% END %]
169
                                    <input type="text" name="search_field_label" value="[% search_field.label | html %]" readonly />
284
                                </td>
170
                                [% ELSE %]
285
                                <td>
171
                                    <input type="text" name="search_field_label" value="[% search_field.label | html %]" />
286
                                  <input type="hidden" name="mapping_search" value="[% mapping.search | html %]" readonly />[% IF mapping.search == 1 %]Yes[% ELSE %]No[% END %]
172
                                [% END %]
287
                                </td>
173
                            </td>
288
                                <td>
174
                            <td data-order="[% search_field.type | html %]">
289
                                    <input name="mapping_marc_field" type="text" value="[% mapping.marc_field | html %]" />
175
                                [% IF search_field.mandatory %]
290
                                </td>
176
                                    <input type="hidden" name="search_field_type" value="[% search_field.type | html %]" />
291
                                <td>&nbsp;</td>
177
                                    <select name="search_field_type" disabled>
292
                              </tr>
178
                                [% ELSE %]
293
                            [% ELSE %]
179
                                    <select name="search_field_type">
294
                              <tr>
180
                                [% END %]
295
                                <td>
181
                                    <option value=""></option>
296
                                  <input type="hidden" name="mapping_index_name" value="[% index.index_name | html %]" />
182
                                    [% IF search_field.type == "string" %]
297
                                  <input type="hidden" name="mapping_search_field_name" value="[% mapping.search_field_name | html %]">
183
                                        <option value="string" selected="selected">String</option>
298
                                  [% mapping.search_field_label | html %]
184
                                    [% ELSE %]
185
                                        <option value="string">String</option>
186
                                    [% END %]
187
                                    [% IF search_field.type == "date" %]
188
                                        <option value="date" selected="selected">Date</option>
189
                                    [% ELSE %]
190
                                        <option value="date">Date</option>
191
                                    [% END %]
192
                                    [% IF search_field.type == "year" %]
193
                                        <option value="year" selected="selected">Year</option>
194
                                    [% ELSE %]
195
                                        <option value="year">Year</option>
196
                                    [% END %]
197
                                    [% IF search_field.type == "number" %]
198
                                        <option value="number" selected="selected">Number</option>
199
                                    [% ELSE %]
200
                                        <option value="number">Number</option>
201
                                    [% END %]
202
                                    [% IF search_field.type == "boolean" %]
203
                                        <option value="boolean" selected="selected">Boolean</option>
204
                                    [% ELSE %]
205
                                        <option value="boolean">Boolean</option>
206
                                    [% END %]
207
                                    [% IF search_field.type == "sum" %]
208
                                        <option value="sum" selected="selected">Sum</option>
209
                                    [% ELSE %]
210
                                        <option value="sum">Sum</option>
211
                                    [% END %]
212
                                    [% IF search_field.type == "isbn" %]
213
                                        <option value="isbn" selected="selected">ISBN</option>
214
                                    [% ELSE %]
215
                                        <option value="isbn">ISBN</option>
216
                                    [% END %]
217
                                    [% IF search_field.type == "stdno" %]
218
                                        <option value="stdno" selected="selected">Std. Number</option>
219
                                    [% ELSE %]
220
                                        <option value="stdno">Std. Number</option>
221
                                    [% END %]
222
                                    </select>
223
                            </td>
224
                                <td data-order="[% search_field.weight | html %]">
225
                                    [% IF search_field.mapped_biblios %]
226
                                        <input type="text" inputmode="decimal" pattern="[0-9\.]*" name="search_field_weight" value="[% search_field.weight | html %]" />
227
                                    [% ELSE %]
228
                                        <input type="text" name="search_field_weight" value="">
229
                                    [% END %]
299
                                </td>
230
                                </td>
300
                                <td>
231
                            <td>
301
                                  <select name="mapping_sort">
232
                                <select name="search_field_staff_client">
233
                                [% IF search_field.staff_client %]
234
                                    <option value="1" selected="selected">Yes</option>
235
                                    <option value="0">No</option>
236
                                [% ELSE %]
237
                                    <option value="1">Yes</option>
238
                                    <option value="0" selected="selected">No</option>
239
                                [% END %]
240
                                </select>
241
                            </td>
242
                            <td>
243
                                <select name="search_field_opac">
244
                                [% IF search_field.opac %]
245
                                    <option value="1" selected="selected">Yes</option>
246
                                    <option value="0">No</option>
247
                                [% ELSE %]
248
                                    <option value="1">Yes</option>
249
                                    <option value="0" selected="selected">No</option>
250
                                [% END %]
251
                                </select>
252
                            </td>
253
                            </tr>
254
                        [% END %]
255
                        </tbody>
256
                    </table>
257
                </div>
258
                [% FOREACH index IN indexes %]
259
                    <div id="mapping_[% index.index_name | html %]" role="tabpanel" class="tab-pane">
260
                        <table class="mappings" data-index_name="[% index.index_name | html %]" data-ordering="false" id="mapping_[% index.index_name | html %]_table">
261
                        <thead>
262
                            <tr class="nodrag nodrop">
263
                            <th>Search field</th>
264
                            <th>Sortable</th>
265
                            <th>Facetable</th>
266
                            <th>Suggestible</th>
267
                            <th>Searchable</th>
268
                            <th>Mapping</th>
269
                            <th>&nbsp;</th>
270
                            </tr>
271
                        </thead>
272
                        <tbody>
273
                            [% FOREACH mapping IN index.mappings %]
274
                                [% IF mapping.search_field_mandatory && mapping.search_field_label != loop.next.search_field_label && mapping.search_field_label != loop.prev.search_field_label %]
275
                                <tr>
276
                                    <td>
277
                                    <input type="hidden" name="mapping_index_name" value="[% index.index_name | html %]" />
278
                                    <input type="hidden" name="mapping_search_field_name" value="[% mapping.search_field_name | html %]">
279
                                    [% mapping.search_field_label | html %]
280
                                    </td>
281
                                    <td>
302
                                    [% IF mapping.sort == 0 %]
282
                                    [% IF mapping.sort == 0 %]
303
                                      <option value="0" selected="selected">No</option>
283
                                        <input type="hidden" name="mapping_sort" value="0" readonly />No
304
                                      <option value="1">Yes</option>
305
                                    [% ELSE %]
284
                                    [% ELSE %]
306
                                      <option value="0">No</option>
285
                                        <input type="hidden" name="mapping_sort" value="1" readonly />Yes
307
                                      <option value="1" selected="selected">Yes</option>
308
                                    [% END %]
286
                                    [% END %]
309
                                  </select>
287
                                    </td>
310
                                </td>
288
                                    <td>
311
                                <td>
289
                                    <input type="hidden" name="mapping_facet" value="[% mapping.facet | html %]" readonly />[% IF mapping.facet == 1 %]Yes[% ELSE %]No[% END %]
312
                                  [% IF mapping.is_facetable %]
290
                                    </td>
313
                                    <select name="mapping_facet">
291
                                    <td>
314
                                      [% IF mapping.facet %]
292
                                    <input type="hidden" name="mapping_suggestible" value="[% mapping.suggestible | html %]" readonly />[% IF mapping.suggestible == 1 %]Yes[% ELSE %]No[% END %]
315
                                        <option value="0">No</option>
293
                                    </td>
316
                                        <option value="1" selected="selected">Yes</option>
294
                                    <td>
317
                                      [% ELSE %]
295
                                    <input type="hidden" name="mapping_search" value="[% mapping.search | html %]" readonly />[% IF mapping.search == 1 %]Yes[% ELSE %]No[% END %]
296
                                    </td>
297
                                    <td>
298
                                        <input name="mapping_marc_field" type="text" value="[% mapping.marc_field | html %]" />
299
                                    </td>
300
                                    <td>&nbsp;</td>
301
                                </tr>
302
                                [% ELSE %]
303
                                <tr>
304
                                    <td>
305
                                    <input type="hidden" name="mapping_index_name" value="[% index.index_name | html %]" />
306
                                    <input type="hidden" name="mapping_search_field_name" value="[% mapping.search_field_name | html %]">
307
                                    [% mapping.search_field_label | html %]
308
                                    </td>
309
                                    <td>
310
                                    <select name="mapping_sort">
311
                                        [% IF mapping.sort == 0 %]
318
                                        <option value="0" selected="selected">No</option>
312
                                        <option value="0" selected="selected">No</option>
319
                                        <option value="1">Yes</option>
313
                                        <option value="1">Yes</option>
320
                                      [% END %]
314
                                        [% ELSE %]
315
                                        <option value="0">No</option>
316
                                        <option value="1" selected="selected">Yes</option>
317
                                        [% END %]
321
                                    </select>
318
                                    </select>
322
                                  [% ELSE %]
319
                                    </td>
323
                                    <input type="hidden" name="mapping_facet" value="0" />
320
                                    <td>
324
                                    No
321
                                    [% IF mapping.is_facetable %]
325
                                  [% END %]
322
                                        <select name="mapping_facet">
326
                                </td>
323
                                        [% IF mapping.facet %]
327
                                <td>
324
                                            <option value="0">No</option>
328
                                  <select name="mapping_suggestible">
325
                                            <option value="1" selected="selected">Yes</option>
329
                                    [% IF mapping.suggestible %]
326
                                        [% ELSE %]
330
                                      <option value="0">No</option>
327
                                            <option value="0" selected="selected">No</option>
331
                                      <option value="1" selected="selected">Yes</option>
328
                                            <option value="1">Yes</option>
329
                                        [% END %]
330
                                        </select>
332
                                    [% ELSE %]
331
                                    [% ELSE %]
333
                                      <option value="0" selected="selected">No</option>
332
                                        <input type="hidden" name="mapping_facet" value="0" />
334
                                      <option value="1">Yes</option>
333
                                        No
335
                                    [% END %]
334
                                    [% END %]
336
                                  </select>
335
                                    </td>
337
                                </td>
336
                                    <td>
338
                                <td>
337
                                    <select name="mapping_suggestible">
339
                                  <select name="mapping_search">
338
                                        [% IF mapping.suggestible %]
340
                                    [% IF mapping.search %]
339
                                        <option value="0">No</option>
341
                                      <option value="0">No</option>
340
                                        <option value="1" selected="selected">Yes</option>
342
                                      <option value="1" selected="selected">Yes</option>
341
                                        [% ELSE %]
342
                                        <option value="0" selected="selected">No</option>
343
                                        <option value="1">Yes</option>
344
                                        [% END %]
345
                                    </select>
346
                                    </td>
347
                                    <td>
348
                                    <select name="mapping_search">
349
                                        [% IF mapping.search %]
350
                                        <option value="0">No</option>
351
                                        <option value="1" selected="selected">Yes</option>
352
                                        [% ELSE %]
353
                                        <option value="0" selected="selected">No</option>
354
                                        <option value="1">Yes</option>
355
                                        [% END %]
356
                                    </select>
357
                                    </td>
358
                                    <td>
359
                                        <input name="mapping_marc_field" type="text" value="[% mapping.marc_field | html %]" />
360
                                    </td>
361
                                    [% IF mapping.search_field_mandatory %]
362
                                        <td><a class="btn btn-default btn-xs delete mandatory" data-field_name="[% mapping.search_field_name | html %]" style="cursor: pointer;"><i class="fa fa-trash"></i> Delete</a></td>
343
                                    [% ELSE %]
363
                                    [% ELSE %]
344
                                      <option value="0" selected="selected">No</option>
364
                                        <td><a class="btn btn-default btn-xs delete" style="cursor: pointer;"><i class="fa fa-trash"></i> Delete</a></td>
345
                                      <option value="1">Yes</option>
346
                                    [% END %]
365
                                    [% END %]
347
                                  </select>
366
                                </tr>
348
                                </td>
349
                                <td>
350
                                    <input name="mapping_marc_field" type="text" value="[% mapping.marc_field | html %]" />
351
                                </td>
352
                                [% IF mapping.search_field_mandatory %]
353
                                    <td><a class="btn btn-default btn-xs delete mandatory" data-field_name="[% mapping.search_field_name | html %]" style="cursor: pointer;"><i class="fa fa-trash"></i> Delete</a></td>
354
                                [% ELSE %]
355
                                    <td><a class="btn btn-default btn-xs delete" style="cursor: pointer;"><i class="fa fa-trash"></i> Delete</a></td>
356
                                [% END %]
367
                                [% END %]
357
                              </tr>
358
                            [% END %]
368
                            [% END %]
359
                        [% END %]
369
                        </tbody>
360
                      </tbody>
370
                        <tfoot>
361
                      <tfoot>
371
                            <tr class="nodrag nodrop">
362
                        <tr class="nodrag nodrop">
372
                            <td>
363
                          <td>
373
                                <input data-id="mapping_index_name" type="hidden" value="[% index.index_name | html %]" />
364
                            <input data-id="mapping_index_name" type="hidden" value="[% index.index_name | html %]" />
374
                                <select data-id="mapping_search_field_name">
365
                            <select data-id="mapping_search_field_name">
375
                                [% FOREACH f IN all_search_fields %]
366
                             [% FOREACH f IN all_search_fields %]
376
                                <option value="[% f.name | html %]">[% f.name | html %]</option>
367
                               <option value="[% f.name | html %]">[% f.name | html %]</option>
377
                                [% END %]
368
                             [% END %]
378
                                </select>
369
                            </select>
379
                            </td>
370
                          </td>
380
                            <td>
371
                          <td>
381
                                <select data-id="mapping_sort">
372
                            <select data-id="mapping_sort">
382
                                <option value="undef">Undef</option>
373
                              <option value="undef">Undef</option>
383
                                <option value="0">0</option>
374
                              <option value="0">0</option>
384
                                <option value="1">1</option>
375
                              <option value="1">1</option>
385
                                </select>
376
                            </select>
386
                            </td>
377
                          </td>
387
                            <td>
378
                          <td>
388
                                <select data-id="mapping_facet">
379
                            <select data-id="mapping_facet">
389
                                [% IF mapping.facet %]
380
                              [% IF mapping.facet %]
390
                                    <option value="0">No</option>
381
                                <option value="0">No</option>
391
                                    <option value="1" selected="selected">Yes</option>
382
                                <option value="1" selected="selected">Yes</option>
392
                                [% ELSE %]
383
                              [% ELSE %]
393
                                    <option value="0" selected="selected">No</option>
384
                                <option value="0" selected="selected">No</option>
394
                                    <option value="1">Yes</option>
385
                                <option value="1">Yes</option>
395
                                [% END %]
386
                              [% END %]
396
                                </select>
387
                            </select>
397
                            </td>
388
                          </td>
398
                            <td>
389
                          <td>
399
                                <select data-id="mapping_suggestible">
390
                            <select data-id="mapping_suggestible">
400
                                [% IF mapping.suggestible %]
391
                              [% IF mapping.suggestible %]
401
                                    <option value="0">No</option>
392
                                <option value="0">No</option>
402
                                    <option value="1" selected="selected">Yes</option>
393
                                <option value="1" selected="selected">Yes</option>
403
                                [% ELSE %]
394
                              [% ELSE %]
404
                                    <option value="0" selected="selected">No</option>
395
                                <option value="0" selected="selected">No</option>
405
                                    <option value="1">Yes</option>
396
                                <option value="1">Yes</option>
406
                                [% END %]
397
                              [% END %]
407
                                </select>
398
                            </select>
408
                            </td>
399
                          </td>
409
                            <td>
400
                          <td>
410
                                <select data-id="mapping_search">
401
                            <select data-id="mapping_search">
411
                                [% IF mapping.search %]
402
                              [% IF mapping.search %]
412
                                    <option value="0">No</option>
403
                                <option value="0">No</option>
413
                                    <option value="1" selected="selected">Yes</option>
404
                                <option value="1" selected="selected">Yes</option>
414
                                [% ELSE %]
405
                              [% ELSE %]
415
                                    <option value="0" selected="selected">No</option>
406
                                <option value="0" selected="selected">No</option>
416
                                    <option value="1">Yes</option>
407
                                <option value="1">Yes</option>
417
                                [% END %]
408
                              [% END %]
418
                                </select>
409
                            </select>
419
                            </td>
410
                          </td>
420
                            <td><input data-id="mapping_marc_field" type="text" /></td>
411
                          <td><input data-id="mapping_marc_field" type="text" /></td>
421
                            <td><a class="btn btn-default btn-xs add"><i class="fa fa-plus"></i> Add</a></td>
412
                          <td><a class="btn btn-default btn-xs add"><i class="fa fa-plus"></i> Add</a></td>
422
                            </tr>
413
                        </tr>
423
                        </tfoot>
414
                      </tfoot>
424
                        </table>
415
                    </table>
416
425
417
                    [% IF index.index_name == 'biblios' %]
426
                        [% IF index.index_name == 'biblios' %]
418
                        <h3>Facet order</h3>
427
                            <h3>Facet order</h3>
419
                        <div id="facet_[% index.index_name | html %]" class="ui-tabs-panel">
428
                            <div id="facet_[% index.index_name | html %]" class="ui-tabs-panel">
420
                            <table>
429
                                <table>
421
                                <thead>
430
                                    <thead>
422
                                    <tr>
423
                                        <th>Search field</th>
424
                                        <th>Label</th>
425
                                        <th>Display</th>
426
                                    </tr>
427
                                </thead>
428
                                <tbody>
429
                                    [% FOREACH f IN facetable_fields %]
430
                                        <tr>
431
                                        <tr>
431
                                            <td>
432
                                            <th>Search field</th>
432
                                                [% f.name | html %]
433
                                            <th>Label</th>
433
                                            </td>
434
                                            <th>Display</th>
434
                                            <td>
435
                                                [% SWITCH f.name %]
436
                                                [% CASE 'author' %]Authors
437
                                                [% CASE 'itype' %]Item types
438
                                                [% CASE 'location' %]Locations
439
                                                [% CASE 'su-geo' %]Places
440
                                                [% CASE 'title-series' %]Series
441
                                                [% CASE 'subject' %]Topics
442
                                                [% CASE 'ccode' %]Collections
443
                                                [% CASE 'holdingbranch' %]Holding libraries
444
                                                [% CASE 'homebranch' %]Home libraries
445
                                                [% CASE 'ln' %]Language
446
                                                [% CASE %][% f | html %]
447
                                                [% END %]
448
                                            </td>
449
                                            <td>
450
                                                [% IF f.facet_order %]
451
                                                    <input type="checkbox" name="display_facet" value="[% f.name | html %]" checked="checked" />
452
                                                [% ELSE %]
453
                                                    <input type="checkbox" name="display_facet" value="[% f.name | html %]" />
454
                                                [% END %]
455
                                            </td>
456
                                        </tr>
435
                                        </tr>
457
                                    [% END %]
436
                                    </thead>
458
                                </tbody>
437
                                    <tbody>
459
                            </table>
438
                                        [% FOREACH f IN facetable_fields %]
460
                        </div>
439
                                            <tr>
461
                    [% END %]
440
                                                <td>
462
                </div>
441
                                                    [% f.name | html %]
463
            [% END %]
442
                                                </td>
464
        </div>
443
                                                <td>
444
                                                    [% SWITCH f.name %]
445
                                                    [% CASE 'author' %]Authors
446
                                                    [% CASE 'itype' %]Item types
447
                                                    [% CASE 'location' %]Locations
448
                                                    [% CASE 'su-geo' %]Places
449
                                                    [% CASE 'title-series' %]Series
450
                                                    [% CASE 'subject' %]Topics
451
                                                    [% CASE 'ccode' %]Collections
452
                                                    [% CASE 'holdingbranch' %]Holding libraries
453
                                                    [% CASE 'homebranch' %]Home libraries
454
                                                    [% CASE 'ln' %]Language
455
                                                    [% CASE %][% f | html %]
456
                                                    [% END %]
457
                                                </td>
458
                                                <td>
459
                                                    [% IF f.facet_order %]
460
                                                        <input type="checkbox" name="display_facet" value="[% f.name | html %]" checked="checked" />
461
                                                    [% ELSE %]
462
                                                        <input type="checkbox" name="display_facet" value="[% f.name | html %]" />
463
                                                    [% END %]
464
                                                </td>
465
                                            </tr>
466
                                        [% END %]
467
                                    </tbody>
468
                                </table>
469
                            </div>
470
                        [% END %]
471
                    </div>
472
                [% END %]
473
            </div> <!-- /.tab-content -->
474
        </div> <!-- /#tabs -->
465
        <fieldset class="action">
475
        <fieldset class="action">
466
            <button class="btn btn-default" type="submit" name="op" value="edit"><i class="fa fa-hdd-o" aria-hidden="true"></i> Save</button>
476
            <button class="btn btn-default" type="submit" name="op" value="edit"><i class="fa fa-hdd-o" aria-hidden="true"></i> Save</button>
467
            <button class="btn btn-default" type="submit" name="op" value="reset_confirm"><i class="fa fa-refresh" aria-hidden="true"></i> Reset mappings</button>
477
            <button class="btn btn-default" type="submit" name="op" value="reset_confirm"><i class="fa fa-refresh" aria-hidden="true"></i> Reset mappings</button>
(-)a/koha-tmpl/intranet-tmpl/prog/js/elasticsearch-mappings.js (-6 / +4 lines)
Lines 21-27 function clone_line(line) { Link Here
21
}
21
}
22
22
23
function tableInit( oldtabid, newtabid ) {
23
function tableInit( oldtabid, newtabid ) {
24
25
    if ( oldtabid ){
24
    if ( oldtabid ){
26
        var oldTableId = $("#" + oldtabid + "_table");
25
        var oldTableId = $("#" + oldtabid + "_table");
27
        oldTableId.DataTable().destroy();
26
        oldTableId.DataTable().destroy();
Lines 42-51 $(document).ready(function () { Link Here
42
41
43
    tableInit( "", "search_fields");
42
    tableInit( "", "search_fields");
44
43
45
    $("#tabs").tabs({
44
    $("a[data-toggle='tab']").on("shown.bs.tab", function (e) {
46
        activate: function( event, ui ){
45
        var oldtabid = $(e.relatedTarget).data("tab");
47
            tableInit( ui.oldPanel.attr('id'), ui.newPanel.attr('id') );
46
        var newtabid = $(e.target).data("tab");
48
        },
47
        tableInit( oldtabid, newtabid );
49
    });
48
    });
50
49
51
    $('.delete').click(function () {
50
    $('.delete').click(function () {
52
- 

Return to bug 30000