Bugzilla – Attachment 64767 Details for
Bug 18888
Include the definition of currency in onboarding tool
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18888 - Currency defined in new onboardingstep6.tt after installation
Bug-18888---Currency-defined-in-new-onboardingstep.patch (text/plain), 8.77 KB, created by
Alex Buckley
on 2017-07-03 00:20:46 UTC
(
hide
)
Description:
Bug 18888 - Currency defined in new onboardingstep6.tt after installation
Filename:
MIME Type:
Creator:
Alex Buckley
Created:
2017-07-03 00:20:46 UTC
Size:
8.77 KB
patch
obsolete
>From 3566ac372242616c4623cbd95cc6adedfcf40c55 Mon Sep 17 00:00:00 2001 >From: Alex Buckley <alexbuckley@catalyst.net.nz> >Date: Sun, 2 Jul 2017 13:02:31 +0000 >Subject: [PATCH] Bug 18888 - Currency defined in new onboardingstep6.tt after > installation > >Test plan: >1. Restart memcached and drop and recreate your database > >2. Go through the Koha web installer making sure to install all data >except the currencies > >3. Run through the onboarding tool noticing that after creating the >circulation rule the complete page appears and you can click to log into >Koha with the superlibrarian user you have created in the onboarding >tool > >4. Apply patch > >5. Repeat step 1, and 2 > >6. Run through the onboarding tool and notice that after creating the >circulation rule, a screen appears for you to define a currency > >7. Write in the currency name and symbol (notice: you cannot edit the >exchange rate of 1) and submit the form > >8. Notice the complete screen appears and you can log in with the >superlibrarian account created in the onboarding tool > >9. Go to Administration->Currencies and exchange rates and notice that >the currency you created in the onboarding tool is displayed as active > >10. Repeat step 1 > >11. Go through the Koha web installer making sure to install all data >including currencies > >12. Run through the onboarding tool and notice that after creating the >circulation rule then the complete screen appears and click to log into >Koha with your superlibrarian account > >13. Run qa tool and all tests should be successful > >14. Sign off >Sponsored-by: Catalyst IT >--- > 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 > >diff --git a/admin/currency.pl b/admin/currency.pl >index 1c5ec3e..f7e3e0e 100755 >--- a/admin/currency.pl >+++ b/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); > >diff --git a/installer/onboarding.pl b/installer/onboarding.pl >index 8b032c9..f0808d9 100755 >--- a/installer/onboarding.pl >+++ b/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 >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep6.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep6.tt >new file mode 100644 >index 0000000..6195540 >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep6.tt >@@ -0,0 +1,79 @@ >+[% INCLUDE 'doc-head-open.inc' %] >+<title>Koha › Web installer › >+ [% IF all_done %] >+ Complete >+ [% ELSE %] >+ Define a currency >+ [% END %] >+</title> >+[% INCLUDE 'installer-doc-head-close.inc' %] >+[% INCLUDE 'validator-strings.inc' %] >+[% INCLUDE 'installer-strings.inc' %] >+<script type="text/javascript" src="[% interface %]/[% theme %]/js/onboarding.js"></script> >+</head> >+ >+<body id="installer" class="installer"> >+ <div class="container-fluid"> >+ <div class="row"> >+ <div id="onboarding-step5" class="installer-main col-sm-8 col-sm-offset-2 col-md-8 col-md-offset-2"> >+ <h1 id="logo"><a href="#">Koha</a></h1> >+ >+ [% IF all_done %] >+ >+ <h2>Web installer › Complete</h2> >+ [% INCLUDE 'onboarding_messages.inc' %] >+ <h3>Congratulations you have finished and are ready to use Koha</h3> >+ <a class="btn btn-success" href="/cgi-bin/koha/mainpage.pl">Start using Koha</a> >+ >+ [% ELSE %] >+ >+ <h2>Web installer › Define a currency </h2> >+ >+ [% INCLUDE 'onboarding_messages.inc' %] >+ >+ <form name="createcurrency" id="createcurrency" method="post" action="onboarding.pl"> >+ <input type="hidden" name="step" value="6"/> >+ <input type="hidden" name="op" value="add_validate_currency" /> >+ <fieldset class="rows"> >+ <legend> >+ New currency >+ </legend> >+ <ol> >+ <li> >+ [% IF currency %] >+ <span class="label">Currency: </span> >+ <input type="hidden" name="is_a_modif" value="1" /> >+ <input type="hidden" name="currency_code" id="currency" value="[% currency.currency %]" />[% currency.currency %] >+ [% ELSE %] >+ <label for="currency_code" class="required">Currency: </label> >+ <input type="text" name="currency_code" id="currency_code" size="50" maxlength="50" required="required" class="requ ired" /> <span class="required">Required</span> >+ [% END %] >+ </li> >+ <li> >+ <label for="rate" class="required">Rate: </label> >+ <input type="text" name="rate" id="rate" size="10" maxlength="10" value=1 readonly /> <span class="required">Required</span> >+ </li> >+ <li> >+ <label for="symbol" class="required">Symbol: </label> >+ <input type="text" name="symbol" id="symbol" size="5" maxlength="5" value="[% currency.symbol %]" required="required" class="required" /> <span class="required">Required</span> >+ </li> >+ <li> >+ <label for="isocode">ISO code: </label> >+ <input type="text" name="isocode" id="isocode" size="5" maxlength="5" value="[% currency.isocode %]" /> >+ </li> >+ <input type="hidden" id="active" name="active" value="1"/> >+ </ol> >+ </fieldset> >+ <p> >+ To create another currency, go to: >+ <span class="breadcrumbs">Administration › Currencies and exchange rates </span> >+ </p> >+ <fieldset class="action"> >+ <input type="submit" class="btn btn-primary" value="Submit" /> >+ </fieldset> >+ </form> >+ [% END %] >+ </div> <!-- / #onboarding-step6 --> >+ </div> <!-- / .row --> >+ >+[% INCLUDE 'intranet-bottom.inc' %] >-- >2.1.4
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 18888
:
64767
|
64771
|
86709
|
86710
|
87574
|
87687
|
87691
|
87692