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

(-)a/Koha/SearchEngine/Elasticsearch.pm (-1 lines)
Lines 256-262 sub reset_elasticsearch_mappings { Link Here
256
            my $field_type = $data->{type};
256
            my $field_type = $data->{type};
257
            my $field_label = $data->{label};
257
            my $field_label = $data->{label};
258
            my $field_mandatory = $data->{mandatory};
258
            my $field_mandatory = $data->{mandatory};
259
            warn $field_mandatory;
260
            my $mappings = $data->{mappings};
259
            my $mappings = $data->{mappings};
261
            my $search_field = Koha::SearchFields->find_or_create({ name => $field_name, label => $field_label, type => $field_type, mandatory => $field_mandatory }, { key => 'name' });
260
            my $search_field = Koha::SearchFields->find_or_create({ name => $field_name, label => $field_label, type => $field_type, mandatory => $field_mandatory }, { key => 'name' });
262
            for my $mapping ( @$mappings ) {
261
            for my $mapping ( @$mappings ) {
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/searchengine/elasticsearch/mappings.tt (-40 / +42 lines)
Lines 157-202 a.add, a.delete { Link Here
157
                      <td><input type="text" name="search_field_label" value="[% search_field.label | html %]" [% is_readonly %]/>
157
                      <td><input type="text" name="search_field_label" value="[% search_field.label | html %]" [% is_readonly %]/>
158
                      <td>
158
                      <td>
159
                        [% IF is_readonly %]
159
                        [% IF is_readonly %]
160
                            <input type="text" name="search_field_type" value="[% search_field.type FILTER ucfirst | html %]" [% is_readonly %] />
160
                            <input type="hidden" name="search_field_type" value="[% search_field.type | html %]" />
161
                            <select name="search_field_type" disabled>
161
                        [% ELSE %]
162
                        [% ELSE %]
162
                        <select name="search_field_type">
163
                            <select name="search_field_type">
163
                          <option value=""></option>
164
                              <option value=""></option>
164
                          [% IF search_field.type == "string" %]
165
                              [% IF search_field.type == "string" %]
165
                            <option value="string" selected="selected">String</option>
166
                                <option value="string" selected="selected">String</option>
166
                          [% ELSE %]
167
                              [% ELSE %]
167
                            <option value="string">String</option>
168
                                <option value="string">String</option>
168
                          [% END %]
169
                              [% END %]
169
                          [% IF search_field.type == "date" %]
170
                              [% IF search_field.type == "date" %]
170
                            <option value="date" selected="selected">Date</option>
171
                                <option value="date" selected="selected">Date</option>
171
                          [% ELSE %]
172
                              [% ELSE %]
172
                            <option value="date">Date</option>
173
                                <option value="date">Date</option>
173
                          [% END %]
174
                              [% END %]
174
                          [% IF search_field.type == "number" %]
175
                              [% IF search_field.type == "number" %]
175
                            <option value="number" selected="selected">Number</option>
176
                                <option value="number" selected="selected">Number</option>
176
                          [% ELSE %]
177
                              [% ELSE %]
177
                            <option value="number">Number</option>
178
                                <option value="number">Number</option>
178
                          [% END %]
179
                              [% END %]
179
                          [% IF search_field.type == "boolean" %]
180
                              [% IF search_field.type == "boolean" %]
180
                            <option value="boolean" selected="selected">Boolean</option>
181
                                <option value="boolean" selected="selected">Boolean</option>
181
                          [% ELSE %]
182
                              [% ELSE %]
182
                            <option value="boolean">Boolean</option>
183
                                <option value="boolean">Boolean</option>
183
                          [% END %]
184
                              [% END %]
184
                          [% IF search_field.type == "sum" %]
185
                              [% IF search_field.type == "sum" %]
185
                            <option value="sum" selected="selected">Sum</option>
186
                                <option value="sum" selected="selected">Sum</option>
186
                          [% ELSE %]
187
                              [% ELSE %]
187
                            <option value="sum">Sum</option>
188
                                <option value="sum">Sum</option>
188
                          [% END %]
189
                              [% END %]
189
                          [% IF search_field.type == "isbn" %]
190
                              [% IF search_field.type == "isbn" %]
190
                            <option value="isbn" selected="selected">ISBN</option>
191
                                <option value="isbn" selected="selected">ISBN</option>
191
                          [% ELSE %]
192
                              [% ELSE %]
192
                            <option value="isbn">ISBN</option>
193
                                <option value="isbn">ISBN</option>
193
                          [% END %]
194
                              [% END %]
194
                          [% IF search_field.type == "stdno" %]
195
                              [% IF search_field.type == "stdno" %]
195
                            <option value="stdno" selected="selected">Std. Number</option>
196
                                <option value="stdno" selected="selected">Std. Number</option>
196
                          [% ELSE %]
197
                              [% ELSE %]
197
                            <option value="stdno">Std. Number</option>
198
                                <option value="stdno">Std. Number</option>
198
                          [% END %]
199
                              [% END %]
199
                        </select>
200
                            </select>
201
                        [% END %]
200
                      </td>
202
                      </td>
201
                    </tr>
203
                    </tr>
202
                  [% END %]
204
                  [% END %]
Lines 292-297 a.add, a.delete { Link Here
292
                                  <td><a class="btn btn-default btn-xs delete" style="cursor: pointer;"><i class="fa fa-trash"></i> Delete</a></td>
294
                                  <td><a class="btn btn-default btn-xs delete" style="cursor: pointer;"><i class="fa fa-trash"></i> Delete</a></td>
293
                              </tr>
295
                              </tr>
294
                            [% END %]
296
                            [% END %]
297
                        [% END %]
295
                      </tbody>
298
                      </tbody>
296
                      <tfoot>
299
                      <tfoot>
297
                        <tr class="nodrag nodrop">
300
                        <tr class="nodrag nodrop">
298
- 

Return to bug 19482