my $warning = "Database update needed, redirecting to %s. Database is $version and Koha is $kohaversion";
if ( $type ne 'opac' ) {
warn sprintf( $warning, 'Installer' );
- print $query->redirect("/cgi-bin/koha/installer/install.pl?step=3");
+ print $query->redirect("/cgi-bin/koha/installer/install.pl?step=1&op=updatestructure");
} else {
warn sprintf( "OPAC: " . $warning, 'maintenance' );
print $query->redirect("/cgi-bin/koha/maintenance.pl");
);
if ( $step && $step == 1 ) {
- #First Step
+ #First Step (for both fresh installations and upgrades)
#Checking ALL perl Modules and services needed are installed.
#Whenever there is an error, adding a report to the page
+ my $op = $query->param('op') || 'noop';
$template->param( language => 1 );
$template->param( 'checkmodule' => 1 ); # we start with the assumption that there are no problems and set this to 0 if there are
);
}
@components = sort {$a->{'name'} cmp $b->{'name'}} @components;
- $template->param( missing_modules => \@components, checkmodule => $checkmodule );
+ $template->param( missing_modules => \@components, checkmodule => $checkmodule, op => $op );
}
}
elsif ( $step && $step == 2 ) {
#
#Do updatedatabase And report
- if ( ! defined $ENV{PERL5LIB} ) {
- my $find = "C4/Context.pm";
- my $path = $INC{$find};
- $path =~ s/\Q$find\E//;
- $ENV{PERL5LIB} = "$path:$path/installer";
- warn "# plack? inserted PERL5LIB $ENV{PERL5LIB}\n";
- }
+ if ( ! defined $ENV{PERL5LIB} ) {
+ my $find = "C4/Context.pm";
+ my $path = $INC{$find};
+ $path =~ s/\Q$find\E//;
+ $ENV{PERL5LIB} = "$path:$path/installer";
+ warn "# plack? inserted PERL5LIB $ENV{PERL5LIB}\n";
+ }
my $now = POSIX::strftime( "%Y-%m-%dT%H:%M:%S", localtime() );
my $logdir = C4::Context->config('logdir');
</form>
[% END %]
[% IF ( language ) %]
- [% UNLESS ( checkmodule ) %]
+ [% IF ( checkmodule ) %]
+ <p>All required Perl modules appear to be installed.<br />
+ [% ELSE %]
[% IF ( missing_modules ) %]
<p>Some Perl modules are missing. Modules in red <b>must</b> be installed before you may continue.<br />
<ul>
[% END %]
<form name="checkmodules" action="install.pl">
[% IF ( checkmodule ) %]
+[% IF (op == 'noop') %]
<input type="hidden" name="step" value="2" />
+[% ELSE %]
+<input type="hidden" name="step" value="3" />
+<input type="hidden" name="op" value="[% op %]" />
+<input type="hidden" name="checkmodule" value="[% checkmodule %]"/>
+[% END %]
<p> All dependencies installed.</p>
<p>Please click 'Next' to continue <input value="Next >>" type="submit" /></p>
[% ELSE %]
+[% IF (op == 'noop') %]
<input type="hidden" name="step" value="1" />
+[% ELSE %]
+<input type="hidden" name="step" value="1" />
+<input type="hidden" name="op" value="[% op %]" />
+[% END %]
<p>Click to recheck dependencies <input value="Recheck" type="submit" /></p>
[% END %]
</form>