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

(-)a/admin/additional-fields.pl (+3 lines)
Lines 53-58 if ( $op eq 'add' ) { Link Here
53
    my $marcfield = $input->param('marcfield') // q{};
53
    my $marcfield = $input->param('marcfield') // q{};
54
    my $marcfield_mode = $input->param('marcfield_mode') // 'get';
54
    my $marcfield_mode = $input->param('marcfield_mode') // 'get';
55
    my $searchable = $input->param('searchable') ? 1 : 0;
55
    my $searchable = $input->param('searchable') ? 1 : 0;
56
    my $repeatable = $input->param('repeatable') ? 1 : 0;
56
    if ( $field_id and $name ) {
57
    if ( $field_id and $name ) {
57
        my $updated = 0;
58
        my $updated = 0;
58
        eval {
59
        eval {
Lines 63-68 if ( $op eq 'add' ) { Link Here
63
                marcfield => $marcfield,
64
                marcfield => $marcfield,
64
                marcfield_mode => $marcfield_mode,
65
                marcfield_mode => $marcfield_mode,
65
                searchable => $searchable,
66
                searchable => $searchable,
67
                repeatable => $repeatable,
66
            });
68
            });
67
            $updated = $af->store ? 1 : 0;
69
            $updated = $af->store ? 1 : 0;
68
        };
70
        };
Lines 80-85 if ( $op eq 'add' ) { Link Here
80
                marcfield => $marcfield,
82
                marcfield => $marcfield,
81
                marcfield_mode => $marcfield_mode,
83
                marcfield_mode => $marcfield_mode,
82
                searchable => $searchable,
84
                searchable => $searchable,
85
                repeatable => $repeatable,
83
            });
86
            });
84
            $inserted = $af->store ? 1 : 0;
87
            $inserted = $af->store ? 1 : 0;
85
        };
88
        };
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/additional-fields.tt (-1 / +18 lines)
Lines 155-160 Link Here
155
                            [% IF show_searchable %]
155
                            [% IF show_searchable %]
156
                                <th>Searchable</th>
156
                                <th>Searchable</th>
157
                            [% END %]
157
                            [% END %]
158
                            <th>Repeatable</th>
158
                            <th class="noExport">Actions</th>
159
                            <th class="noExport">Actions</th>
159
                        </tr>
160
                        </tr>
160
                    </thead>
161
                    </thead>
Lines 177-182 Link Here
177
                                        [% IF field.searchable %]Yes[% ELSE %]No[% END %]
178
                                        [% IF field.searchable %]Yes[% ELSE %]No[% END %]
178
                                    </td>
179
                                    </td>
179
                                [% END %]
180
                                [% END %]
181
                                    <td>
182
                                        [% IF field.repeatable %]Yes[% ELSE %]No[% END %]
183
                                    </td>
180
                                <td class="actions">
184
                                <td class="actions">
181
                                    <a class="btn btn-default btn-xs" href="?op=add_form&amp;field_id=[% field.id | html %]"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit</a>
185
                                    <a class="btn btn-default btn-xs" href="?op=add_form&amp;field_id=[% field.id | html %]"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit</a>
182
                                    <a class="confirmdelete btn btn-default btn-xs" href="?op=delete&amp;field_id=[% field.id | uri %]&amp;tablename=[% tablename | uri %]"><i class="fa fa-trash-can"></i> Delete</a>
186
                                    <a class="confirmdelete btn btn-default btn-xs" href="?op=delete&amp;field_id=[% field.id | uri %]&amp;tablename=[% tablename | uri %]"><i class="fa fa-trash-can"></i> Delete</a>
Lines 210-215 Link Here
210
                            [% PROCESS options_for_authorised_value_categories authorised_value_categories = AuthorisedValues.GetCategories({selected => field.authorised_value_category}) %]
214
                            [% PROCESS options_for_authorised_value_categories authorised_value_categories = AuthorisedValues.GetCategories({selected => field.authorised_value_category}) %]
211
                        </select>
215
                        </select>
212
                    </li>
216
                    </li>
217
                    <li>
218
                        <label for="repeatable">Repeatable: </label>
219
                        [% IF field.repeatable %]
220
                            <input type="checkbox" name="repeatable" id="repeatable" checked="checked" />
221
                        [% ELSE %]
222
                            <input type="checkbox" name="repeatable" id="repeatable" />
223
                        [% END %]
224
                    </li>
213
                    [% IF show_marcfield %]
225
                    [% IF show_marcfield %]
214
                        <li>
226
                        <li>
215
                            <label for="marcfield">MARC field: </label>
227
                            <label for="marcfield">MARC field: </label>
Lines 297-302 Link Here
297
                        alert(_("You cannot select an authorised value category and a MARC field") );
309
                        alert(_("You cannot select an authorised value category and a MARC field") );
298
                        return false;
310
                        return false;
299
                    }
311
                    }
312
                } $("#repeatable").prop('checked') == true
313
                if ( $("#marcfield").length && $("#repeatable").length) {
314
                    if ( $("#marcfield").val().length > 0 && $("#repeatable").prop('checked') == true ) {
315
                        alert(_("You cannot set a MARC field as repeatable") );
316
                        return false;
317
                    }
300
                }
318
                }
301
                return true;
319
                return true;
302
            });
320
            });
303
- 

Return to bug 35044