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 / +41 lines)
Lines 143-188 a.add, a.delete { Link Here
143
                      <td><input type="text" name="search_field_label" value="[% search_field.label %]" [% is_readonly %]/>
143
                      <td><input type="text" name="search_field_label" value="[% search_field.label %]" [% is_readonly %]/>
144
                      <td>
144
                      <td>
145
                        [% IF is_readonly %]
145
                        [% IF is_readonly %]
146
                            <input type="text" name="search_field_type" value="[% search_field.type FILTER ucfirst%]" [% is_readonly %] />
146
                            <input type="hidden" name="search_field_type" value="[% search_field.type %]" />
147
                            <select name="search_field_type" disabled>
147
                        [% ELSE %]
148
                        [% ELSE %]
148
                        <select name="search_field_type">
149
                            <select name="search_field_type">
149
                          <option value=""></option>
150
                        [% END %]
150
                          [% IF search_field.type == "string" %]
151
                              <option value=""></option>
151
                            <option value="string" selected="selected">String</option>
152
                              [% IF search_field.type == "string" %]
152
                          [% ELSE %]
153
                                <option value="string" selected="selected">String</option>
153
                            <option value="string">String</option>
154
                              [% ELSE %]
154
                          [% END %]
155
                                <option value="string">String</option>
155
                          [% IF search_field.type == "date" %]
156
                              [% END %]
156
                            <option value="date" selected="selected">Date</option>
157
                              [% IF search_field.type == "date" %]
157
                          [% ELSE %]
158
                                <option value="date" selected="selected">Date</option>
158
                            <option value="date">Date</option>
159
                              [% ELSE %]
159
                          [% END %]
160
                                <option value="date">Date</option>
160
                          [% IF search_field.type == "number" %]
161
                              [% END %]
161
                            <option value="number" selected="selected">Number</option>
162
                              [% IF search_field.type == "number" %]
162
                          [% ELSE %]
163
                                <option value="number" selected="selected">Number</option>
163
                            <option value="number">Number</option>
164
                              [% ELSE %]
164
                          [% END %]
165
                                <option value="number">Number</option>
165
                          [% IF search_field.type == "boolean" %]
166
                              [% END %]
166
                            <option value="boolean" selected="selected">Boolean</option>
167
                              [% IF search_field.type == "boolean" %]
167
                          [% ELSE %]
168
                                <option value="boolean" selected="selected">Boolean</option>
168
                            <option value="boolean">Boolean</option>
169
                              [% ELSE %]
169
                          [% END %]
170
                                <option value="boolean">Boolean</option>
170
                          [% IF search_field.type == "sum" %]
171
                              [% END %]
171
                            <option value="sum" selected="selected">Sum</option>
172
                              [% IF search_field.type == "sum" %]
172
                          [% ELSE %]
173
                                <option value="sum" selected="selected">Sum</option>
173
                            <option value="sum">Sum</option>
174
                              [% ELSE %]
174
                          [% END %]
175
                                <option value="sum">Sum</option>
175
                          [% IF search_field.type == "isbn" %]
176
                              [% END %]
176
                            <option value="isbn" selected="selected">ISBN</option>
177
                              [% IF search_field.type == "isbn" %]
177
                          [% ELSE %]
178
                                <option value="isbn" selected="selected">ISBN</option>
178
                            <option value="isbn">ISBN</option>
179
                              [% ELSE %]
179
                          [% END %]
180
                                <option value="isbn">ISBN</option>
180
                          [% IF search_field.type == "stdno" %]
181
                              [% END %]
181
                            <option value="stdno" selected="selected">Std. Number</option>
182
                              [% IF search_field.type == "stdno" %]
182
                          [% ELSE %]
183
                                <option value="stdno" selected="selected">Std. Number</option>
183
                            <option value="stdno">Std. Number</option>
184
                              [% ELSE %]
184
                          [% END %]
185
                                <option value="stdno">Std. Number</option>
185
                        </select>
186
                              [% END %]
187
                            </select>
186
                      </td>
188
                      </td>
187
                    </tr>
189
                    </tr>
188
                  [% END %]
190
                  [% END %]
189
- 

Return to bug 19482