From 1436d3bfa9effa37f2ab9f28aa1571016b33cad8 Mon Sep 17 00:00:00 2001 From: Alex Buckley Date: Sat, 25 Aug 2018 19:17:08 +1200 Subject: [PATCH] Bug 21265 - Added onboardingstep6 to the end of onboarding tool. This step is to add values/enable HEA. --- installer/onboarding.pl | 37 ++++++++++++++++++++-- .../prog/en/modules/onboarding/onboardingstep5.tt | 14 -------- 2 files changed, 34 insertions(+), 17 deletions(-) diff --git a/installer/onboarding.pl b/installer/onboarding.pl index ceee2e4..b04840a 100755 --- a/installer/onboarding.pl +++ b/installer/onboarding.pl @@ -31,6 +31,7 @@ use Koha::Patrons; use Koha::Patron::Categories; use Koha::ItemTypes; use Koha::IssuingRules; +use Locale::Country; #Setting variables my $input = new CGI; @@ -271,14 +272,44 @@ if ( $step == 5 ) { } $step++ if Koha::IssuingRules->count; + +} if ($step == 6) { + if ( $op eq 'add_usage_data_sysprefs') { + my $usagestats = $input->param('usagestats'); + my $usagestatscountry = $input->param('usagestatscountry'); + my $usagestatslibraryname = $input->param('usagestatslibraryname'); + my $usagestatscountrytype = $input->param('usagestatscountrytype'); + my $usagestatslibraryurl = $input->param('usagestatslibraryurl'); + + my %statsprefvalues = ( + "UsageStats" => $usagestats, + "UsageStatsCountry" => $usagestatscountry, + "UsageStatsLibraryName" => $usagestatslibraryname, + "UsageStatsCountryType" => $usagestatscountrytype, + "UsageStatsLibraryURL" => $usagestatslibraryurl, + ); + + #Loop through the HEA syspref key value pairs + while(my($pref, $value) = each %statsprefvalues ) { + C4::Context->set_preference( $pref, $value ); + } + unless ($@) { + push @messages, { code => 'success_on_insert_circ_rule'}; + } + else { + push @messages, { code => 'error_on_insert_circ_rule' }; + } + $step++; + warn $op; + } } my $libraries = Koha::Libraries->search( {}, { order_by => ['branchcode'] }, ); $template_params->{libraries} = $libraries; -if ( $step > 5 ) { - $template_params->{all_done} = 1; # If step 5 is complete, we are done! - $step = 5; +if ( $step > 6 ) { + $template_params->{all_done} = 1; # If step 6 is complete, we are done! + $step = 6; } #Getting the appropriate template to display to the user diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep5.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep5.tt index d6eb24e..94fda9f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep5.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep5.tt @@ -1,10 +1,6 @@ [% INCLUDE 'doc-head-open.inc' %] Koha › Web installer › - [% IF all_done %] - Complete - [% ELSE %] Create circulation rule - [% END %] [% INCLUDE 'installer-doc-head-close.inc' %] [% INCLUDE 'validator-strings.inc' %] @@ -18,15 +14,6 @@

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

[% INCLUDE 'onboarding_messages.inc' %] @@ -131,7 +118,6 @@ - [% END %]
-- 2.1.4