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

(-)a/admin/additional-fields.pl (-1 / +4 lines)
Lines 53-58 if ( $op eq 'cud-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
        my $set_fields = {
59
        my $set_fields = {
Lines 60-65 if ( $op eq 'cud-add' ) { Link Here
60
            marcfield      => $marcfield,
61
            marcfield      => $marcfield,
61
            marcfield_mode => $marcfield_mode,
62
            marcfield_mode => $marcfield_mode,
62
            searchable     => $searchable,
63
            searchable     => $searchable,
64
            repeatable     => $repeatable,
63
        };
65
        };
64
        $set_fields->{authorised_value_category} = $authorised_value_category if $authorised_value_category;
66
        $set_fields->{authorised_value_category} = $authorised_value_category if $authorised_value_category;
65
67
Lines 80-85 if ( $op eq 'cud-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
        $set_fields->{authorised_value_category} = $authorised_value_category if $authorised_value_category;
87
        $set_fields->{authorised_value_category} = $authorised_value_category if $authorised_value_category;
85
88
Lines 137-140 $template->param( Link Here
137
    messages => \@messages,
140
    messages => \@messages,
138
);
141
);
139
142
140
output_html_with_http_headers $input, $cookie, $template->output;
143
output_html_with_http_headers $input, $cookie, $template->output;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/additional-fields.tt (-1 / +18 lines)
Lines 156-161 Link Here
156
                            [% IF show_searchable %]
156
                            [% IF show_searchable %]
157
                                <th>Searchable</th>
157
                                <th>Searchable</th>
158
                            [% END %]
158
                            [% END %]
159
                            <th>Repeatable</th>
159
                            <th class="noExport">Actions</th>
160
                            <th class="noExport">Actions</th>
160
                        </tr>
161
                        </tr>
161
                    </thead>
162
                    </thead>
Lines 178-183 Link Here
178
                                        [% IF field.searchable %]Yes[% ELSE %]No[% END %]
179
                                        [% IF field.searchable %]Yes[% ELSE %]No[% END %]
179
                                    </td>
180
                                    </td>
180
                                [% END %]
181
                                [% END %]
182
                                    <td>
183
                                        [% IF field.repeatable %]Yes[% ELSE %]No[% END %]
184
                                    </td>
181
                                <td class="actions">
185
                                <td class="actions">
182
                                    <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>
186
                                    <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>
183
                                    <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>
187
                                    <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 212-217 Link Here
212
                            [% PROCESS options_for_authorised_value_categories authorised_value_categories = AuthorisedValues.GetCategories({selected => field.authorised_value_category}) %]
216
                            [% PROCESS options_for_authorised_value_categories authorised_value_categories = AuthorisedValues.GetCategories({selected => field.authorised_value_category}) %]
213
                        </select>
217
                        </select>
214
                    </li>
218
                    </li>
219
                    <li>
220
                        <label for="repeatable">Repeatable: </label>
221
                        [% IF field.repeatable %]
222
                            <input type="checkbox" name="repeatable" id="repeatable" checked="checked" />
223
                        [% ELSE %]
224
                            <input type="checkbox" name="repeatable" id="repeatable" />
225
                        [% END %]
226
                    </li>
215
                    [% IF show_marcfield %]
227
                    [% IF show_marcfield %]
216
                        <li>
228
                        <li>
217
                            <label for="marcfield">MARC field: </label>
229
                            <label for="marcfield">MARC field: </label>
Lines 299-304 Link Here
299
                        alert(_("You cannot select an authorised value category and a MARC field") );
311
                        alert(_("You cannot select an authorised value category and a MARC field") );
300
                        return false;
312
                        return false;
301
                    }
313
                    }
314
                } $("#repeatable").prop('checked') == true
315
                if ( $("#marcfield").length && $("#repeatable").length) {
316
                    if ( $("#marcfield").val().length > 0 && $("#repeatable").prop('checked') == true ) {
317
                        alert(_("You cannot set a MARC field as repeatable") );
318
                        return false;
319
                    }
302
                }
320
                }
303
                return true;
321
                return true;
304
            });
322
            });
305
- 

Return to bug 35044