@@ -, +, @@ 1 Create a library 2 Create patron category 3 Set minPasswordLength 4 Create Koha administrator 5 Create item type 6 Define currency (see step 3!) 7 Circulation rule/Complete --- admin/currency.pl | 4 + installer/onboarding.pl | 44 +++++- .../prog/en/modules/onboarding/onboardingstep6.tt | 164 ++++++--------------- 3 files changed, 91 insertions(+), 121 deletions(-) --- a/admin/currency.pl +++ a/admin/currency.pl @@ -59,6 +59,7 @@ if ( $op eq 'add_form' ) { 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 $step = $input->param('step'); if ($is_a_modif) { my $currency = Koha::Acquisition::Currencies->find($currency_code); @@ -92,6 +93,9 @@ 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 @@ -253,8 +253,44 @@ if ( $step == 5 ) { $step++ if Koha::ItemTypes->count; } +#Create currency if it doesn't exist +my $cur = Koha::Acquisition::Currencies->get_active; +if ( $step == 6 && !$cur ) { + 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 $p_sep_by_space = $input->param('p_sep_by_space'); + my $is_a_modif = $input->param('is_a_modif'); + + 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' }; + } + } + $cur = Koha::Acquisition::Currencies->get_active; + if ($cur) { + $step++; + } +} elsif ( $step == 6 && $cur ){ + $step++; +} + #Create circulation rule -if ( $step == 6 ) { +if ( $step == 7 ) { if ( $op eq 'add_validate_circ_rule' ) { @@ -324,9 +360,9 @@ $template_params->{libraries} = $libraries; my $minPasswordLength = C4::Context->preference('minPasswordLength'); $template_params->{minPasswordLength} = $minPasswordLength; -if ( $step > 6 ) { - $template_params->{all_done} = 1; # If step 5 is complete, we are done! - $step = 6; +if ( $step > 7 ) { + $template_params->{all_done} = 1; # If step 7 is complete, we are done! + $step = 7; } #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 @@ -1,11 +1,5 @@ [% INCLUDE 'doc-head-open.inc' %] -Koha › Web installer › - [% IF all_done %] - Complete - [% ELSE %] - Create circulation rule - [% END %] - +Koha › Web installer › Define a currency [% INCLUDE 'installer-doc-head-close.inc' %] @@ -14,119 +8,55 @@

Koha

+

Web installer › Define a currency

- [% 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 › Create a new circulation rule

- - [% INCLUDE 'onboarding_messages.inc' %] - -
-
- - -
    -
  1. - - - Required -
  2. -
  3. - - - Required -
  4. - -
  5. - - - Required -
  6. -
  7. - - - Required -
  8. - -
  9. - - - Required -
  10. -
  11. - - -
  12. -
  13. - - - Required -
  14. - -
  15. - - - Required -
  16. - -
  17. - - -
  18. -
-

- To create circulation rule, go to: - Administration › Circulation and fine rules -

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

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

+
- - [% END %] +
+
--