diff --git a/htdocs/install/check.php b/htdocs/install/check.php
index a832ab8a231..ca3d0fa58ff 100644
--- a/htdocs/install/check.php
+++ b/htdocs/install/check.php
@@ -22,12 +22,15 @@
*/
/**
- \file htdocs/install/check.php
- \ingroup install
- \brief Test si le fichier conf est modifiable et si il n'existe pas, test la possibilité de le créer
- \version $Revision$
+ \file htdocs/install/check.php
+ \ingroup install
+ \brief Test si le fichier conf est modifiable et si il n'existe pas, test la possibilité de le créer
+ \version $Revision$
*/
+
$err = 0;
+$allowinstall = 0;
+$allowupgrade = 0;
include_once("./inc.php");
@@ -35,28 +38,36 @@ $setuplang=isset($_POST["selectlang"])?$_POST["selectlang"]:(isset($_GET["select
$langs->defaultlang=$setuplang;
$langs->load("install");
-pHeader($langs->trans("DolibarrWelcome"), "licence"); // Etape suivante = license
+
+pHeader($langs->trans("DolibarrWelcome"),""); // Etape suivante = license
print $langs->trans("InstallEasy")."
";
// Si fichier présent et lisible
if (is_readable($conffile))
{
- $confexists=1;
- include_once($conffile);
+ $confexists=1;
+ include_once($conffile);
+
+ // Deja installé, on peut upgrader
+ // \todo Test if database ok
+ $allowupgrade=1;
}
else
{
- // Si non on le crée
- $confexists=0;
- $fp = @fopen("$conffile", "w");
- if($fp)
+ // Si non on le crée
+ $confexists=0;
+ $fp = @fopen("$conffile", "w");
+ if($fp)
{
- @fwrite($fp, '");
- fclose($fp);
+ @fwrite($fp, '");
+ fclose($fp);
}
+
+ // First install, on ne peut pas upgrader
+ $allowupgrade=0;
}
// Si fichier absent et n'a pu etre créé
@@ -74,7 +85,7 @@ if (!file_exists($conffile))
}
else
{
- print "
";
+ print "
\n";
// Si ficiher présent mais ne peut etre modifié
if (!is_writable($conffile))
{
@@ -88,7 +99,7 @@ else
print $langs->trans("ConfFileIsNotWritable");
print "
";
- $err++;
+ $allowinstall=0;
}
// Si fichier présent et peut etre modifié
else
@@ -101,13 +112,59 @@ else
}
print "
";
print $langs->trans("ConfFileIsWritable");
- print "
";
- print $langs->trans("YouCanContinue");
+ print "
";
+ $allowinstall=1;
}
+ print "
\n";
+ print "
\n";
+
+ // Si pas d'erreur, on affiche le bouton pour passer à l'étape suivante
+
+
+ print $langs->trans("ChooseYourSetupMode");
+
+ print '
| '.$langs->trans("FreshInstall").' | '; + print $langs->trans("FreshInstallDesc").' | '; + print ''; + if ($allowinstall) + { + print ''.$langs->trans("Start").''; + } + else + { + print $langs->trans("InstallNotAllowed"); + } + print ' | '; + print '
| '.$langs->trans("Upgrade").' | '; + print $langs->trans("UpgradeDesc").' | '; + print ''; + if ($allowupgrade) + { + print ''.$langs->trans("Start").''; + } + else + { + print $langs->trans("NotAvailable"); + } + print ' | '; + print '