From 63ac88067e4a5f60f698f4ad32209933c190ed0d Mon Sep 17 00:00:00 2001 From: Hayley Mapley Date: Mon, 18 Mar 2019 01:05:38 +0000 Subject: [PATCH] Bug 18888: (follow-up) Updated Currency onboarding step to match DB Between the time that this patch was originally created and now, a field has been added to the currency table which allows the user to specify whether the currency should appear with a space between the symbol and value. This patch updates the onboarding tool to accommodate that option, as well as cleans up some issues with script tags and duplicate entries to the DB. Test plan: 1) Drop and recreate your database, then restart_all 2) Go through the web installer and install all data except the currencies 3) Go through the onboarding tool and note that when you get to the currency page that there is no option for setting there to be a space between symbol and value 4) Apply the patch, and repeat step 1 and 2 5) Go through the onboarding tool again and this time note that on the currency page there is an option to set there to be a space between symbol and value - check this box. 6) Continue on to Koha 7) Apply a fine to a patron, log in as that patron, and verify that the currency is displayed with a space between the symbol and the value in the OPAC 8) Also verify that there is only one currency (the one you created) in the currency table in your database Note: This patch may fail the QA tools due to Asset not working with the installer. Sponsored-by: Catalyst IT --- installer/onboarding.pl | 28 +++++++++++-------- .../prog/en/modules/onboarding/onboardingstep6.tt | 32 +++++++++++++--------- 2 files changed, 35 insertions(+), 25 deletions(-) diff --git a/installer/onboarding.pl b/installer/onboarding.pl index 5ee26064fc..68396491ed 100755 --- a/installer/onboarding.pl +++ b/installer/onboarding.pl @@ -305,20 +305,24 @@ if ( $step > 5 && $cur ) { my $isocode = $input->param('isocode'); my $rate = $input->param('rate'); my $active = $input->param('active'); + my $p_sep_by_space = $input->param('p_sep_by_space'); my $is_a_modif = $input->param('is_a_modif'); - my $currency = Koha::Acquisition::Currency->new( - { currency => $currency_code, - symbol => $symbol, - isocode => $isocode, - rate => $rate, - active => $active, + if ($currency_code) { + my $currency = Koha::Acquisition::Currency->new( + { currency => $currency_code, + symbol => $symbol, + isocode => $isocode, + rate => $rate, + active => $active, + p_sep_by_space => $p_sep_by_space, + } + ); + eval { $currency->store; }; + if ($@) { + push @messages, { type => 'error', code => 'error_on_insert' }; + } else { + push @messages, { type => 'message', code => 'success_on_insert' }; } - ); - eval { $currency->store; }; - if ($@) { - push @messages, { type => 'error', code => 'error_on_insert' }; - } else { - push @messages, { type => 'message', code => 'success_on_insert' }; } $cur = Koha::Acquisition::Currencies->get_active; if ($cur) { diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep6.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep6.tt index 61955404ca..495f15c13b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep6.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep6.tt @@ -7,9 +7,6 @@ [% END %] [% INCLUDE 'installer-doc-head-close.inc' %] -[% INCLUDE 'validator-strings.inc' %] -[% INCLUDE 'installer-strings.inc' %] - @@ -43,23 +40,27 @@ [% IF currency %] Currency: - [% currency.currency %] + [% currency.currency | html %] [% ELSE %] - Required + Required [% END %]
  • - - Required + + Required
  • - - Required + + Required
  • - - + + +
  • +
  • + +
  • @@ -75,5 +76,10 @@ [% END %] - -[% INCLUDE 'intranet-bottom.inc' %] + +[% MACRO jsinclude BLOCK %] + [% INCLUDE 'validator-strings.inc' %] + [% INCLUDE 'installer-strings.inc' %] + +[% END %] +[% INCLUDE 'installer-intranet-bottom.inc' %] -- 2.11.0