Bugzilla – Attachment 158859 Details for
Bug 35044
Additional fields: Allow for repeatable fields
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35044: Admin: New additional fields 'repeatable' field
Bug-35044-Admin-New-additional-fields-repeatable-f.patch (text/plain), 5.03 KB, created by
Pedro Amorim
on 2023-11-13 10:10:10 UTC
(
hide
)
Description:
Bug 35044: Admin: New additional fields 'repeatable' field
Filename:
MIME Type:
Creator:
Pedro Amorim
Created:
2023-11-13 10:10:10 UTC
Size:
5.03 KB
patch
obsolete
>From b5668f83c2cb42b1ed89f960dcd709a5c0f800d5 Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@ptfs-europe.com> >Date: Fri, 13 Oct 2023 10:00:22 +0000 >Subject: [PATCH] Bug 35044: Admin: New additional fields 'repeatable' field > >There is now a new 'repeatable' checkbox when configuring >(adding or editing) an additional field for a specific table. >It is also displayed in a column in the additional fields panel >for a given tablename. > >MARC fields are not allowed to be repeatable. >--- > admin/additional-fields.pl | 5 ++++- > .../prog/en/modules/admin/additional-fields.tt | 18 ++++++++++++++++++ > 2 files changed, 22 insertions(+), 1 deletion(-) > >diff --git a/admin/additional-fields.pl b/admin/additional-fields.pl >index 35dd1a97b1..5efcfc7a77 100755 >--- a/admin/additional-fields.pl >+++ b/admin/additional-fields.pl >@@ -53,6 +53,7 @@ if ( $op eq 'add' ) { > my $marcfield = $input->param('marcfield') // q{}; > my $marcfield_mode = $input->param('marcfield_mode') // 'get'; > my $searchable = $input->param('searchable') ? 1 : 0; >+ my $repeatable = $input->param('repeatable') ? 1 : 0; > if ( $field_id and $name ) { > my $updated = 0; > my $set_fields = { >@@ -60,6 +61,7 @@ if ( $op eq 'add' ) { > marcfield => $marcfield, > marcfield_mode => $marcfield_mode, > searchable => $searchable, >+ repeatable => $repeatable, > }; > $set_fields->{authorised_value_category} = $authorised_value_category if $authorised_value_category; > >@@ -80,6 +82,7 @@ if ( $op eq 'add' ) { > marcfield => $marcfield, > marcfield_mode => $marcfield_mode, > searchable => $searchable, >+ repeatable => $repeatable, > }; > $set_fields->{authorised_value_category} = $authorised_value_category if $authorised_value_category; > >@@ -137,4 +140,4 @@ $template->param( > messages => \@messages, > ); > >-output_html_with_http_headers $input, $cookie, $template->output; >+output_html_with_http_headers $input, $cookie, $template->output; >\ No newline at end of file >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/additional-fields.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/additional-fields.tt >index a569c43fc8..23a939e1f7 100755 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/additional-fields.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/additional-fields.tt >@@ -155,6 +155,7 @@ > [% IF show_searchable %] > <th>Searchable</th> > [% END %] >+ <th>Repeatable</th> > <th class="noExport">Actions</th> > </tr> > </thead> >@@ -177,6 +178,9 @@ > [% IF field.searchable %]Yes[% ELSE %]No[% END %] > </td> > [% END %] >+ <td> >+ [% IF field.repeatable %]Yes[% ELSE %]No[% END %] >+ </td> > <td class="actions"> > <a class="btn btn-default btn-xs" href="?op=add_form&field_id=[% field.id | html %]"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit</a> > <a class="confirmdelete btn btn-default btn-xs" href="?op=delete&field_id=[% field.id | uri %]&tablename=[% tablename | uri %]"><i class="fa fa-trash-can"></i> Delete</a> >@@ -210,6 +214,14 @@ > [% PROCESS options_for_authorised_value_categories authorised_value_categories = AuthorisedValues.GetCategories({selected => field.authorised_value_category}) %] > </select> > </li> >+ <li> >+ <label for="repeatable">Repeatable: </label> >+ [% IF field.repeatable %] >+ <input type="checkbox" name="repeatable" id="repeatable" checked="checked" /> >+ [% ELSE %] >+ <input type="checkbox" name="repeatable" id="repeatable" /> >+ [% END %] >+ </li> > [% IF show_marcfield %] > <li> > <label for="marcfield">MARC field: </label> >@@ -297,6 +309,12 @@ > alert(_("You cannot select an authorised value category and a MARC field") ); > return false; > } >+ } $("#repeatable").prop('checked') == true >+ if ( $("#marcfield").length && $("#repeatable").length) { >+ if ( $("#marcfield").val().length > 0 && $("#repeatable").prop('checked') == true ) { >+ alert(_("You cannot set a MARC field as repeatable") ); >+ return false; >+ } > } > return true; > }); >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 35044
:
157324
|
157325
|
157326
|
157327
|
157328
|
157329
|
157330
|
157331
|
157332
|
157333
|
157334
|
158113
|
158498
|
158499
|
158500
|
158501
|
158502
|
158503
|
158504
|
158505
|
158506
|
158507
|
158508
|
158857
|
158858
|
158859
|
158860
|
158861
|
158862
|
158863
|
158864
|
158865
|
158866
|
158867
|
158868
|
159268
|
160177
|
160178
|
160179
|
160180
|
160181
|
160182
|
160183
|
160184
|
160185
|
160186
|
160187
|
160188
|
160189
|
164162
|
164163
|
164164
|
164165
|
164166
|
164167
|
164168
|
164169
|
164170
|
164171
|
164172
|
164173
|
164174
|
167690
|
168537
|
168538
|
168539
|
168540
|
168541
|
168542
|
168543
|
168544
|
168545
|
168546
|
168547
|
168548
|
169545
|
169546
|
169547
|
169603
|
169604
|
169605
|
169606
|
169607
|
169643
|
169644
|
169645
|
169646
|
169647
|
169648
|
169649
|
169650
|
169651
|
169652
|
169653
|
169654
|
169655
|
169656
|
169657
|
169658
|
169659
|
169660
|
169661
|
169662
|
169663
|
169664
|
169665
|
169666
|
169667
|
169668
|
169669
|
169670
|
169671
|
169672
|
169673
|
169674
|
169675
|
169676
|
169677
|
169678
|
169679
|
169680
|
169681
|
169682
|
169683
|
169684
|
169697
|
170501