use Koha;
-my $query = new CGI;
+my $query = CGI->new;
my $step = $query->param('step');
my $language = $query->param('language');
template_name => "installer/step" . ( $step ? $step : 1 ) . ".tt",
query => $query,
type => "intranet",
- authnotrequired => 0,
debug => 1,
}
);
my $perl_modules = C4::Installer::PerlModules->new;
$perl_modules->versions_info;
- my $modules = $perl_modules->get_attr('missing_pm');
- if ( scalar(@$modules) ) {
- my @components = ();
- foreach (@$modules) {
+ my $missing_modules = $perl_modules->get_attr('missing_pm');
+ my $upgrade_modules = $perl_modules->get_attr('upgrade_pm');
+ if ( scalar(@$missing_modules) || scalar(@$upgrade_modules) ) {
+ my @missing = ();
+ my @upgrade = ();
+ foreach (@$missing_modules) {
my ( $module, $stats ) = each %$_;
$checkmodule = 0 if $stats->{'required'};
push(
- @components,
+ @missing,
{
name => $module,
- version => $stats->{'min_ver'},
+ min_version => $stats->{'min_ver'},
+ max_version => $stats->{'max_ver'},
require => $stats->{'required'}
}
);
}
- @components = sort { $a->{'name'} cmp $b->{'name'} } @components;
+ foreach (@$upgrade_modules) {
+ my ( $module, $stats ) = each %$_;
+ $checkmodule = 0 if $stats->{'required'};
+ push(
+ @upgrade,
+ {
+ name => $module,
+ min_version => $stats->{'min_ver'},
+ max_version => $stats->{'max_ver'},
+ require => $stats->{'required'}
+ }
+ );
+ }
+ @missing = sort { $a->{'name'} cmp $b->{'name'} } @missing;
+ @upgrade = sort { $a->{'name'} cmp $b->{'name'} } @upgrade;
$template->param(
- missing_modules => \@components,
+ missing_modules => \@missing,
+ upgrade_modules => \@upgrade,
checkmodule => $checkmodule,
op => $op
);
my $op = $query->param('op');
if ( $op && $op eq 'finished' ) {
- #
+ # Remove the HandleError set at the beginning of the installer process
+ C4::Context->dbh->disconnect;
+
# we have finished, just redirect to mainpage.
- #
print $query->redirect("/cgi-bin/koha/mainpage.pl");
exit;
}
elsif ( $op && $op eq 'finish' ) {
$installer->set_version_syspref();
+ my $langchoice = $query->param('fwklanguage');
+ $langchoice = $query->cookie('KohaOpacLanguage') unless ($langchoice);
+ $langchoice =~ s/[^a-zA-Z_-]*//g;
+ $installer->set_languages_syspref($langchoice);
+
# Installation is finished.
# We just deny anybody access to install
# And we redirect people to mainpage.
elsif ( $op && $op eq 'addframeworks' ) {
# 1ST install, 3rd sub-step : insert the SQL files the user has selected
+ my $langchoice = $query->param('fwklanguage');
+ $langchoice = $query->cookie('KohaOpacLanguage') unless ($langchoice);
+ $langchoice =~ s/[^a-zA-Z_-]*//g;
my ( $fwk_language, $list ) =
- $installer->load_sql_in_order( $all_languages,
+ $installer->load_sql_in_order( $langchoice, $all_languages,
$query->multi_param('framework') );
$template->param(
"fwklanguage" => $fwk_language,
close $fh;
if (@report) {
$template->param( update_report =>
- [ map { { line => $_ } } split( /\n/, join( '', @report ) ) ]
+ [ map { { line => $_ =~ s/\t/  /gr } } split( /\n/, join( '', @report ) ) ]
);
$template->param( has_update_succeeds => 1 );
}