@@ -, +, @@ installation --- admin/currency.pl | 6 ++ installer/onboarding.pl | 33 ++++++++- .../prog/en/modules/onboarding/onboardingstep6.tt | 79 ++++++++++++++++++++++ 3 files changed, 116 insertions(+), 2 deletions(-) create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep6.tt --- a/admin/currency.pl +++ a/admin/currency.pl @@ -58,6 +58,7 @@ if ( $op eq 'add_form' ) { my $rate = $input->param('rate'); my $active = $input->param('active'); my $is_a_modif = $input->param('is_a_modif'); + my $step = $input->param('step'); if ($is_a_modif) { my $currency = Koha::Acquisition::Currencies->find($currency_code); @@ -89,6 +90,11 @@ if ( $op eq 'add_form' ) { } $searchfield = q||; $op = 'list'; + + if ( $step ) { + print $input->redirect("/cgi-bin/koha/installer/onboarding.pl"); + } + } elsif ( $op eq 'delete_confirm' ) { my $currency = Koha::Acquisition::Currencies->find($currency_code); --- a/installer/onboarding.pl +++ a/installer/onboarding.pl @@ -284,9 +284,38 @@ $template_params->{group_types} = [ }, ]; -if ( $step > 5 ) { - $template_params->{all_done} = 1; # If step 5 is complete, we are done! +my $cur = Koha::Acquisition::Currencies->get_active; + +if ( $step > 5 && $cur ) { + $template_params->{all_done} = 1; # If step 5 is completei and currency exists, we are done! $step = 5; +} elsif ($step > 5 && !$cur) { + $step =6; + my $currency_code = $input->param('currency_code'); + my $symbol = $input->param('symbol'); + my $isocode = $input->param('isocode'); + my $rate = $input->param('rate'); + my $active = $input->param('active'); + 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, + } + ); + 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) { + $template_params->{all_done} = 1; # If currency exists then we are done! + $step = 5; + } } #Getting the appropriate template to display to the user --- a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep6.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep6.tt @@ -0,0 +1,79 @@ +[% INCLUDE 'doc-head-open.inc' %] +Koha › Web installer › + [% IF all_done %] + Complete + [% ELSE %] + Define a currency + [% END %] + +[% INCLUDE 'installer-doc-head-close.inc' %] +[% INCLUDE 'validator-strings.inc' %] +[% INCLUDE 'installer-strings.inc' %] + + + + +
+
+
+

Koha

+ + [% IF all_done %] + +

Web installer › Complete

+ [% INCLUDE 'onboarding_messages.inc' %] +

Congratulations you have finished and are ready to use Koha

+ Start using Koha + + [% ELSE %] + +

Web installer › Define a currency

+ + [% INCLUDE 'onboarding_messages.inc' %] + +
+ + +
+ + New currency + +
    +
  1. + [% IF currency %] + Currency: + + [% currency.currency %] + [% ELSE %] + + Required + [% END %] +
  2. +
  3. + + Required +
  4. +
  5. + + Required +
  6. +
  7. + + +
  8. + +
+
+

+ To create another currency, go to: + Administration › Currencies and exchange rates +

+
+ +
+
+ [% END %] +
+
+ +[% INCLUDE 'intranet-bottom.inc' %] --