#1449: Installer improved to add a zebra/Nozebra screen

+ some minor changes in html

Signed-off-by: Chris Cormack <crc@liblime.com>
This commit is contained in:
Paul POULAIN 2007-10-03 12:08:47 +02:00 committed by Chris Cormack
parent c6c916d2e1
commit 7f4c6d8335
5 changed files with 250 additions and 215 deletions

View File

@ -238,38 +238,44 @@ elsif ( $step && $step == 3 ) {
#
#
my $op = $query->param('op');
if ( $op && $op eq 'finish' ) {
my $kohaversion=C4::Context::KOHAVERSION;
# remove the 3 last . to have a Perl number
$kohaversion =~ s/(.*\..*)\.(.*)\.(.*)/$1$2$3/;
if (C4::Context->preference('Version')) {
warn "UPDATE Version";
my $finish=$dbh->prepare("UPDATE systempreferences SET value=? WHERE variable='Version'");
$finish->execute($kohaversion);
} else {
warn "INSERT Version";
my $finish=$dbh->prepare("INSERT into systempreferences (variable,value,explanation) values ('Version',?,'The Koha database version. Don t change this value manually, it s holded by the webinstaller')");
$finish->execute($kohaversion);
}
# Installation is finished.
# We just deny anybody acess to install
# And we redirect people to mainpage.
# The installer wil have to relogin since we donot pass cookie to redirection.
$template->param( "$op" => 1 );
}
elsif ( $op && $op eq 'finished' ) {
#
#
# we have finished, just redirect to mainpage.
#
#
if ( $op && $op eq 'finished' ) {
#
# we have finished, just redirect to mainpage.
#
print $query->redirect("/cgi-bin/koha/mainpage.pl");
exit 1;
}
elsif ( $op && $op eq 'finish' ) {
my $kohaversion=C4::Context::KOHAVERSION;
# remove the 3 last . to have a Perl number
$kohaversion =~ s/(.*\..*)\.(.*)\.(.*)/$1$2$3/;
if (C4::Context->preference('Version')) {
warn "UPDATE Version";
my $finish=$dbh->prepare("UPDATE systempreferences SET value=? WHERE variable='Version'");
$finish->execute($kohaversion);
} else {
warn "INSERT Version";
my $finish=$dbh->prepare("INSERT into systempreferences (variable,value,explanation) values ('Version',?,'The Koha database version. Don t change this value manually, it s holded by the webinstaller')");
$finish->execute($kohaversion);
}
# Installation is finished.
# We just deny anybody acess to install
# And we redirect people to mainpage.
# The installer wil have to relogin since we donot pass cookie to redirection.
$template->param( "$op" => 1 );
}
elsif ( $op && $op eq 'Nozebra' ) {
if ($query->param('Nozebra')) {
$dbh->do("UPDATE systempreferences SET value=1 WHERE variable='NoZebra'");
} else {
$dbh->do("UPDATE systempreferences SET value=0 WHERE variable='NoZebra'");
}
$template->param( "$op" => 1 );
}
elsif ( $op && $op eq 'addframeworks' ) {
#
# 1ST install : insert the SQL files the user has selected
# 1ST install, 3rd sub-step : insert the SQL files the user has selected
#
#Framework importing and reports
@ -285,7 +291,7 @@ elsif ( $step && $step == 3 ) {
$dbh->do('SET FOREIGN_KEY_CHECKS=0');
my $request =
$dbh->prepare(
"SELECT value FROM systempreferences WHERE variable='FrameworksLoaded'"
"SELECT value FROM systempreferences WHERE variable='FrameworksLoaded'"
);
$request->execute;
my ($systempreference) = $request->fetchrow;
@ -331,11 +337,11 @@ elsif ( $step && $step == 3 ) {
}
my $updateflag =
$dbh->do(
"UPDATE systempreferences set value=\"$systempreference\" where variable='FrameworksLoaded'"
"UPDATE systempreferences set value=\"$systempreference\" where variable='FrameworksLoaded'"
);
unless ( $updateflag == 1 ) {
my $string =
"INSERT INTO systempreferences (value, variable, explanation, type) VALUES (\"$systempreference\",'FrameworksLoaded','Frameworks loaded through webinstaller','choice')";
"INSERT INTO systempreferences (value, variable, explanation, type) VALUES (\"$systempreference\",'FrameworksLoaded','Frameworks loaded through webinstaller','choice')";
my $rq = $dbh->prepare($string);
$rq->execute;
}
@ -347,23 +353,23 @@ elsif ( $step && $step == 3 ) {
$dbh->do('SET FOREIGN_KEY_CHECKS=1');
}
elsif ( $op && $op eq 'selectframeworks' ) {
#
#
# 1ST install : show the user the sql datas he can insert in the database.
#
#
# (note that the term "selectframeworks is not correct. The user can select various files, not only frameworks)
#Framework Selection
#sql data for import are supposed to be located in installer/data/<language>/<level>
# Where <language> is en|fr or any international abbreviation (provided language hash is updated... This will be a problem with internationlisation.)
# Where <level> is a category of requirement : required, recommended optional
# level should contain :
# SQL File for import With a readable name.
# txt File taht explains what this SQL File is meant for.
# Could be VERY useful to have A Big file for a kind of library.
# But could also be useful to have some Authorised values data set prepared here.
# Framework Selection is achieved through checking boxes.
#
#
# 1ST install, 2nd sub-step : show the user the sql datas he can insert in the database.
#
#
# (note that the term "selectframeworks is not correct. The user can select various files, not only frameworks)
#Framework Selection
#sql data for import are supposed to be located in installer/data/<language>/<level>
# Where <language> is en|fr or any international abbreviation (provided language hash is updated... This will be a problem with internationlisation.)
# Where <level> is a category of requirement : required, recommended optional
# level should contain :
# SQL File for import With a readable name.
# txt File taht explains what this SQL File is meant for.
# Could be VERY useful to have A Big file for a kind of library.
# But could also be useful to have some Authorised values data set prepared here.
# Framework Selection is achieved through checking boxes.
my $langchoice = $query->param('fwklanguage');
$langchoice = $query->cookie('KohaOpacLanguage') unless ($langchoice);
my $dir = C4::Context->config('intranetdir') . "/installer/data/";
@ -391,7 +397,7 @@ elsif ( $step && $step == 3 ) {
my @levellist;
my $request =
$dbh->prepare(
"SELECT value FROM systempreferences WHERE variable='FrameworksLoaded'"
"SELECT value FROM systempreferences WHERE variable='FrameworksLoaded'"
);
$request->execute;
my ($frameworksloaded) = $request->fetchrow;
@ -444,30 +450,12 @@ elsif ( $step && $step == 3 ) {
$template->param( "levelloop" => \@levellist );
$template->param( "$op" => 1 );
}
elsif ( $op && $op eq 'updatestructure' ) {
#Do updatedatabase And report
my $execstring =
C4::Context->config("intranetdir") . "/updater/updatedatabase";
undef $/;
my $string = qx|$execstring 2>&1|;
if ($string) {
$string =~ s/\n|\r/<br \/>/g;
$string =~
s/(DBD::mysql.*? failed: .*? line [0-9]*.|=================.*?====================)/<font color=red>$1<\/font>/g;
$template->param( "updatereport" => $string );
}
$template->param( $op => 1 );
}
elsif ( $op && $op eq 'importdatastructure' ) {
#
#
# UPDATE (not 1st install) run updatedatabase
#
#
#Import data structure and show errors if any
#Uses DBI to read the file [MJR 2007-07-01]
#
#
# 1st install, 1st "sub-step" : import kohastructure
#
#
my $dbh = DBI->connect(
"DBI:$info{dbms}:$info{dbname}:$info{hostname}"
. ( $info{port} ? ":$info{port}" : "" ),
@ -485,11 +473,30 @@ s/(DBD::mysql.*? failed: .*? line [0-9]*.|=================.*?==================
);
$dbh->disconnect;
}
elsif ( $op && $op eq 'updatestructure' ) {
#
# Not 1st install, the only sub-step : update database
#
#Do updatedatabase And report
my $execstring =
C4::Context->config("intranetdir") . "/updater/updatedatabase";
undef $/;
my $string = qx|$execstring 2>&1|;
if ($string) {
$string =~ s/\n|\r/<br \/>/g;
$string =~
s/(DBD::mysql.*? failed: .*? line [0-9]*.|=================.*?====================)/<font color=red>$1<\/font>/g;
$template->param( "updatereport" => $string );
}
$template->param( $op => 1 );
}
else {
#Check if there are enough tables.
# Paul has cleaned up tables so reduced the count
#I put it there because it implied a data import if condition was not satisfied.
#
# check wether it's a 1st install or an update
#
#Check if there are enough tables.
# Paul has cleaned up tables so reduced the count
#I put it there because it implied a data import if condition was not satisfied.
my $dbh = DBI->connect(
"DBI:$info{dbms}:$info{dbname}:$info{hostname}"
. ( $info{port} ? ":$info{port}" : "" ),

View File

@ -22,8 +22,9 @@ body {
h1 {
color: #006;
font-size: 18px;
font-weight: lighter;
font-size: 2em;
font-weight: normal;
vertical-align:middle;
}
h2 { font-size: 16px; }

View File

@ -2,8 +2,7 @@
<title>Koha &rsaquo; Web Installer &rsaquo; Step 1</title>
<!-- TMPL_INCLUDE NAME="installer-doc-head-close.inc" -->
<div>
<h1 id="logo"><img alt="Koha" src="/intranet-tmpl/prog/img/koha.org-logo.gif" /></h1>
<h1>Koha &rsaquo; Web Installer &rsaquo; Step 1</h1>
<h1 id="logo"><img alt="Koha" src="/intranet-tmpl/prog/img/koha.org-logo.gif" /> Web Installer &rsaquo; Step 1</h1>
<!--TMPL_UNLESS Name="language"-->
<p>You are about to install Koha.</p>

View File

@ -1,8 +1,7 @@
<!-- TMPL_INCLUDE NAME="doc-head-open.inc" --><title>Koha &rsaquo; Web Installer &rsaquo; Step 2</title>
<!-- TMPL_INCLUDE NAME="installer-doc-head-close.inc" -->
<div>
<h1 id="logo"><img alt="Koha" src="/intranet-tmpl/prog/img/koha.org-logo.gif" /></h1>
<h1>Koha &rsaquo; Web Installer &rsaquo; Step 2</h1>
<h1 id="logo"><img alt="Koha" src="/intranet-tmpl/prog/img/koha.org-logo.gif" /> Web Installer &rsaquo; Step 2</h1>
<h2 align="center">Database settings:</h2>
<ul>
<li><em>database name : </em><!--TMPL_VAR NAME="dbname"--></li>

View File

@ -2,148 +2,177 @@
<!--TMPL_IF Name="finish"--><meta http-equiv="refresh" content="10; url=/cgi-bin/koha/mainpage.pl"><!--/TMPL_IF-->
<!-- TMPL_INCLUDE NAME="installer-doc-head-close.inc" -->
<div>
<h1 id="logo"><img alt="Koha" src="/intranet-tmpl/prog/img/koha.org-logo.gif" /></h1>
<h1>Koha &rsaquo; Web Installer &rsaquo; Step 3</h1>
<h1 id="logo"><img alt="Koha" src="/intranet-tmpl/prog/img/koha.org-logo.gif" /> Web Installer &rsaquo; Step 3</h1>
<!--TMPL_IF NAME="selectframeworks"-->
<script language="JavaScript">
<!--
var sURL = unescape(window.location.pathname);
function doLoad()
{
// the timeout value should be the same as in the "refresh" meta-tag
setTimeout( "refresh()", 2*1000 );
}
function refresh(value)
{
// This version of the refresh function will cause a new
// entry in the visitor's history. It is provided for
// those browsers that only support JavaScript 1.0.
//
sURL=sURL+'?step=3&op=selectframeworks&fwklanguage='+value;
window.location.href = sURL;
}
//-->
</script>
<script language="JavaScript1.1">
<!--
function refresh(value)
{
// This version does NOT cause an entry in the browser's
// page view history. Most browsers will always retrieve
// the document from the web-server whether it is already
// in the browsers page-cache or not.
//
sURL=sURL+'?step=3&op=selectframeworks&fwklanguage='+value;
window.location.replace( sURL );
}
//-->
</script>
<script language="JavaScript1.2">
<!--
function refresh(value)
{
// This version of the refresh function will be invoked
// for browsers that support JavaScript version 1.2
//
<script language="JavaScript">
<!--
// The argument to the location.reload function determines
// if the browser should retrieve the document from the
// web-server. In our example all we need to do is cause
// the JavaScript block in the document body to be
// re-evaluated. If we needed to pull the document from
// the web-server again (such as where the document contents
// change dynamically) we would pass the argument as 'true'.
//
sURL=sURL+'?step=3&op=selectframeworks&fwklanguage='+value;
window.location.replace( sURL );
}
//-->
</script>
</head>
<body>
<script language="JavaScript">
function Hide(link) {
subfield = document.getElementById('bloc'+link);
var initstyle=subfield.style.display;
if (initstyle == 'block') subfield.style.display = 'none' ;
if (initstyle == 'none') subfield.style.display = 'block' ;
}
</script>
var sURL = unescape(window.location.pathname);
function doLoad()
{
// the timeout value should be the same as in the "refresh" meta-tag
setTimeout( "refresh()", 2*1000 );
}
function refresh(value)
{
// This version of the refresh function will cause a new
// entry in the visitor's history. It is provided for
// those browsers that only support JavaScript 1.0.
//
sURL=sURL+'?step=3&op=selectframeworks&fwklanguage='+value;
window.location.href = sURL;
}
//-->
</script>
<script language="JavaScript1.1">
<!--
function refresh(value)
{
// This version does NOT cause an entry in the browser's
// page view history. Most browsers will always retrieve
// the document from the web-server whether it is already
// in the browsers page-cache or not.
//
sURL=sURL+'?step=3&op=selectframeworks&fwklanguage='+value;
window.location.replace( sURL );
}
//-->
</script>
<script language="JavaScript1.2">
<!--
function refresh(value)
{
// This version of the refresh function will be invoked
// for browsers that support JavaScript version 1.2
//
// The argument to the location.reload function determines
// if the browser should retrieve the document from the
// web-server. In our example all we need to do is cause
// the JavaScript block in the document body to be
// re-evaluated. If we needed to pull the document from
// the web-server again (such as where the document contents
// change dynamically) we would pass the argument as 'true'.
//
sURL=sURL+'?step=3&op=selectframeworks&fwklanguage='+value;
window.location.replace( sURL );
}
//-->
</script>
</head>
<body>
<script language="JavaScript">
function Hide(link) {
subfield = document.getElementById('bloc'+link);
var initstyle=subfield.style.display;
if (initstyle == 'block') subfield.style.display = 'none' ;
if (initstyle == 'none') subfield.style.display = 'block' ;
}
</script>
<!--/TMPL_IF-->
<!--TMPL_IF Name="finish"-->
<h1>Congratulations, Installation complete</h1>
<p>If this page does not redirect in 5 seconds, click <a href="/">here</a>.</p>
<h1>Congratulations, Installation complete</h1>
<p>If this page does not redirect in 5 seconds, click <a href="/">here</a>.</p>
<!--/TMPL_IF-->
<!--TMPL_IF Name="selectframeworks"-->
<h2 align="center">Selecting Default Settings</h2>
<form name="frameworkselection" method="post" action="install.pl">
<input type="hidden" name="step" value="3" />
<input type="hidden" name="op" value="addframeworks" />
<p>Each language has a set of default settings that cover a wide range of configuration options. Please select a language from the dropdown or use the default lanaguage already selected.</p>
<p><select name="fwklanguage" onchange="javascript:refresh(this.value)">
<!--TMPL_LOOP Name="languagelist" -->
<!--TMPL_IF Name="checked"--><option value="<!--TMPL_VAR Name="dirname"-->" selected="selected"><!--TMPL_VAR Name="languagedescription"--></option>
<!--TMPL_ELSE--><option value="<!--TMPL_VAR Name="dirname"-->"><!--TMPL_VAR Name="languagedescription"--></option>
<!--/TMPL_IF-->
<!--/TMPL_LOOP-->
</select>
</p>
<p>
<!--TMPL_LOOP Name="levelloop"-->
<div>
<h3><!--TMPL_VAR Name="label"--></h3>
<!--TMPL_LOOP Name="frameworks"-->
<div style="border:1px;">
<p>
<!--TMPL_IF Name="checked"--><input type="checkbox" name="framework" value="<!--TMPL_VAR Name="fwkfile"-->" checked="checked" />
<!--TMPl_ELSE--><input type="checkbox" name="framework" value="<!--TMPL_VAR Name="fwkfile"-->" />
<h2 align="center">Selecting Default Settings</h2>
<form name="frameworkselection" method="post" action="install.pl">
<input type="hidden" name="step" value="3" />
<input type="hidden" name="op" value="addframeworks" />
<p>Each language has a set of default settings that cover a wide range of configuration options. Please select a language from the dropdown or use the default lanaguage already selected.</p>
<p><select name="fwklanguage" onchange="javascript:refresh(this.value)">
<!--TMPL_LOOP Name="languagelist" -->
<!--TMPL_IF Name="checked"--><option value="<!--TMPL_VAR Name="dirname"-->" selected="selected"><!--TMPL_VAR Name="languagedescription"--></option>
<!--TMPL_ELSE--><option value="<!--TMPL_VAR Name="dirname"-->"><!--TMPL_VAR Name="languagedescription"--></option>
<!--/TMPL_IF-->
<!--TMPL_VAR Name="fwkdescription"-->
<em>(<!--TMPL_VAR Name="fwkname"-->)</em>
<!--/TMPL_LOOP-->
</select>
</p>
<p>
<!--TMPL_LOOP Name="levelloop"-->
<div>
<h3><!--TMPL_VAR Name="label"--></h3>
<!--TMPL_LOOP Name="frameworks"-->
<table style="border:1px;vertical-align:top;">
<tr>
<td style="vertical-align:top;">
<!--TMPL_IF Name="checked"-->
<input type="checkbox" name="framework" value="<!--TMPL_VAR Name="fwkfile"-->" checked="checked" />
<!--TMPl_ELSE-->
<input type="checkbox" name="framework" value="<!--TMPL_VAR Name="fwkfile"-->" />
<!--/TMPL_IF-->
</td>
<td>
<!--TMPL_VAR Name="fwkdescription"-->
<em>(<!--TMPL_VAR Name="fwkname"-->)</em>
</td>
</table>
<!--/TMPL_LOOP-->
</div>
<!--/TMPL_LOOP-->
</div>
</p>
<!--/TMPL_LOOP-->
<p>When you've made your selections, please click 'Import' below to begin the process. It may take a while to complete,
please be patient.</p>
<p><input type="submit" value="import" />
</p>
</form>
</p>
</p>
<!--/TMPL_LOOP-->
<p>When you've made your selections, please click 'Import' below to begin the process. It may take a while to complete,
please be patient.</p>
<p><input type="submit" value="import" />
</p>
</form>
</p>
<!--/TMPL_IF-->
<!--TMPL_IF Name="addframeworks"-->
<h2 align="center">Results of installation:</h2>
<p>Language :<!--TMPL_VAR Name="fwklanguage"--></p>
<!--TMPL_LOOP Name="list"-->
<h3><!--TMPL_VAR Name="level"--> data added</h3>
<p>
<ul>
<!--TMPL_LOOP Name="fwklist"-->
<li><!--TMPL_VAR Name="fwkname"--><!--TMPL_IF Name="error"--><br /><span class="error"><!--TMPL_VAR Name="error"--></span><!--/TMPL_IF--> </li>
<!--/TMPL_LOOP-->
</ul>
</p>
<!--/TMPL_LOOP-->
<p>Installation complete.<br />
<p>Click on Finish to complete and load the Koha Staff Interface.
<form name="finish">
<input type="hidden" name="step" value="3" />
<input type="hidden" name="op" value="finish" />
<input type="submit" value="Finish" /></form>
<!--TMPL_LOOP Name="list"-->
<h3><!--TMPL_VAR Name="level"--> data added</h3>
<ul>
<!--TMPL_LOOP Name="fwklist"-->
<li><!--TMPL_VAR Name="fwkname"--><!--TMPL_IF Name="error"--><br /><span class="error"><!--TMPL_VAR Name="error"--></span><!--/TMPL_IF--> </li>
<!--/TMPL_LOOP-->
</ul>
<!--/TMPL_LOOP-->
<h2>Zebra or Nozebra ?</h2>
<p>Koha comes in 2 flavours : Zebra and NoZebra. You will now decide the version you need</p>
<p>some directions to help you choose:</p>
<h3>Zebra version</h3>
<ul>
<li>is highly scalable (can support easily more than 300 000 items on a public library with an OPAC widely accessed on the web : see http://catalog.ccfls.org/cgi-bin/koha/opac-main.pl or http://www.mediathequeouestprovence.fr/)<li>
<li>provide a public (external) z3950 server</li>
<li>is complex to configure and administrate</li>
</ul>
<h3>NoZebra version</h3>
<ul>
<li>is available immediatly once Koha is installed</li>
<li>is probably not that speedy for catalogue with more than 100 000 items</li>
<li>does not provide a public (external) z3950 server</li>
</ul>
<p>Whatever you choose now, you can always change your mind and setup the other version.</p>
<p>Note that, if you choose "Zebra", you won't have a working koha, you must set up zebra first (catalogue search won't work, the rest will)</p>
<h3>What do you choose ?</h3>
<form action="install.pl">
<input type="hidden" name="step" value="3" />
<input type="hidden" name="op" value="Nozebra" />
<p><input type="radio" name="NoZebra" value="1" />Nozebra: my catalogue is not that large and I want something simple to setup</p>
<p><input type="radio" name="NoZebra" value="0" />Zebra: I have a large catalogue, I'm not afraid having to setup more software on my server</p>
<input type="submit" value="Choose" /></form>
</form>
<!-- /TMPL_IF -->
<!-- TMPL_IF name="Nozebra" -->
<p>Installation complete.<br />
<p>Click on Finish to complete and load the Koha Staff Interface.
<form name="finish">
<input type="hidden" name="step" value="3" />
<input type="hidden" name="op" value="finish" />
<input type="submit" value="Finish" /></form>
</p>
</p>
</p>
<!--/TMPL_IF-->
@ -159,19 +188,19 @@ function Hide(link) {
</ul>
<form action="install.pl">
<input type="hidden" name="step" value="3" />
<p> Click Next to continue <input value="Next &gt;&gt;" type="submit" /></p>
<p> Click Next to continue <input value="Next &gt;&gt;" type="submit" /></p>
</form>
<!-- /TMPL_IF -->
<!--/TMPL_IF-->
<!--TMPL_IF Name="proposeimport"-->
<p>Now we're ready to create the database tables and fill them with some default data.</p>
<form action="install.pl">
<input type="hidden" name="step" value="3" />
<input type="hidden" name="op" value="importdatastructure" />
<p> Click Next to continue <input value="Next &gt;&gt;" type="submit" /></p>
</form>
<p>Now we're ready to create the database tables and fill them with some default data.</p>
<form action="install.pl">
<input type="hidden" name="step" value="3" />
<input type="hidden" name="op" value="importdatastructure" />
<p> Click Next to continue <input value="Next &gt;&gt;" type="submit" /></p>
</form>
<!--/TMPL_IF-->