Bugzilla – Attachment 169668 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: Update: Order baskets
Bug-35044-Update-Order-baskets.patch (text/plain), 4.25 KB, created by
Julian Maurice
on 2024-07-26 07:53:02 UTC
(
hide
)
Description:
Bug 35044: Update: Order baskets
Filename:
MIME Type:
Creator:
Julian Maurice
Created:
2024-07-26 07:53:02 UTC
Size:
4.25 KB
patch
obsolete
>From c3fe5b3fb74f48f216582f3bc48374a964eff35a Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@ptfs-europe.com> >Date: Mon, 16 Oct 2023 09:32:44 +0000 >Subject: [PATCH] Bug 35044: Update: Order baskets > >Test plan, k-t-d: > >Preparation: Create additional fields for table 'aqbasket': >2 text fields, one repeatable, one not-repeatable >2 AV fields, one repeatable, one not-repeatable > >1) Add a new basket, visit: >/cgi-bin/koha/acqui/basketheader.pl?booksellerid=1&op=add_form >2) Fill in name and all additional fields, click the '+New' and 'Clear' > links, hit 'Save' >3) Notice the basket screen shows repeated fields separated by comma. >4) Notice that only non-null additional fields labels are shown. >5) Edit the basket. Notice all fields are shown as expected. > >Additional testing: > >Having a repeatable field with multiple instances, go back to the >additional fields configuration and make the additional field >non-repeatable again. Edit the basket again. Notice the multiple text >instances are still shown, but the '+New' link no longer shows. >You're able to remove existing multiple instances, but unable to add new >ones, this is because the field is no longer repeatable. > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> >--- > acqui/basket.pl | 5 ++--- > acqui/basketheader.pl | 19 +++++++++---------- > .../prog/en/modules/acqui/basketheader.tt | 1 + > 3 files changed, 12 insertions(+), 13 deletions(-) > >diff --git a/acqui/basket.pl b/acqui/basket.pl >index 38a555ef52..1a6ef3ca47 100755 >--- a/acqui/basket.pl >+++ b/acqui/basket.pl >@@ -442,9 +442,8 @@ if ( $op eq 'list' ) { > duplinbatch => $duplinbatch, > csv_profiles => Koha::CsvProfiles->search({ type => 'sql', used_for => 'export_basket' }), > available_additional_fields => Koha::AdditionalFields->search( { tablename => 'aqbasket' } ), >- additional_field_values => { map { >- $_->field->name => $_->value >- } Koha::Acquisition::Baskets->find($basketno)->additional_field_values->as_list }, >+ additional_field_values => >+ Koha::Acquisition::Baskets->find($basketno)->get_additional_field_values_for_template, > ); > } > >diff --git a/acqui/basketheader.pl b/acqui/basketheader.pl >index 70a424941f..96a7e95e26 100755 >--- a/acqui/basketheader.pl >+++ b/acqui/basketheader.pl >@@ -96,11 +96,8 @@ if ( $op eq 'add_form' ) { > } > } > $template->param( is_an_edit => 1); >- $template->param( >- additional_field_values => { map { >- $_->field->id => $_->value >- } Koha::Acquisition::Baskets->find($basketno)->additional_field_values->as_list }, >- ); >+ $template->param( additional_field_values => >+ Koha::Acquisition::Baskets->find($basketno)->get_additional_field_values_for_template ); > } else { > #new basket > my $basket; >@@ -168,11 +165,13 @@ if ( $op eq 'add_form' ) { > my @additional_fields; > my $basket_fields = Koha::AdditionalFields->search({ tablename => 'aqbasket' }); > while ( my $field = $basket_fields->next ) { >- my $value = $input->param('additional_field_' . $field->id); >- push @additional_fields, { >- id => $field->id, >- value => $value, >- }; >+ my @field_values = $input->param( 'additional_field_' . $field->id ); >+ foreach my $value (@field_values) { >+ push @additional_fields, { >+ id => $field->id, >+ value => $value, >+ } if $value; >+ } > } > Koha::Acquisition::Baskets->find($basketno)->set_additional_fields(\@additional_fields); > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basketheader.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basketheader.tt >index c502ee391f..e85fffa822 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basketheader.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basketheader.tt >@@ -164,6 +164,7 @@ > [% MACRO jsinclude BLOCK %] > [% Asset.js("js/acquisitions-menu.js") | $raw %] > [% Asset.js("js/acq.js") | $raw %] >+ [% Asset.js("js/additional-fields-entry.js") | $raw %] > [% INCLUDE 'select2.inc' %] > <script> > >-- >2.39.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