New: Show recommanded choice for migration
This commit is contained in:
parent
c1170abd53
commit
ac3018a5e5
@ -251,6 +251,8 @@ else
|
|||||||
// Si prerequis ok, on affiche le bouton pour passer à l'étape suivante
|
// Si prerequis ok, on affiche le bouton pour passer à l'étape suivante
|
||||||
if ($checksok)
|
if ($checksok)
|
||||||
{
|
{
|
||||||
|
$ok=0;
|
||||||
|
|
||||||
print $langs->trans("ChooseYourSetupMode");
|
print $langs->trans("ChooseYourSetupMode");
|
||||||
|
|
||||||
print '<table width="100%" cellspacing="1" cellpadding="4" border="1">';
|
print '<table width="100%" cellspacing="1" cellpadding="4" border="1">';
|
||||||
@ -276,15 +278,66 @@ else
|
|||||||
array('from'=>'2.5.0', 'to'=>'2.6.0'),
|
array('from'=>'2.5.0', 'to'=>'2.6.0'),
|
||||||
array('from'=>'2.6.0', 'to'=>'2.7.0')
|
array('from'=>'2.6.0', 'to'=>'2.7.0')
|
||||||
);
|
);
|
||||||
# Upgrade lines
|
|
||||||
|
|
||||||
|
// Try to create db connexion
|
||||||
|
if (file_exists($conffile))
|
||||||
|
{
|
||||||
|
include_once($conffile);
|
||||||
|
if (! empty($dolibarr_main_db_type))
|
||||||
|
{
|
||||||
|
require_once($dolibarr_main_document_root."/lib/databases/".$dolibarr_main_db_type.".lib.php");
|
||||||
|
require_once($dolibarr_main_document_root."/lib/admin.lib.php");
|
||||||
|
// $conf is already instancied inside inc.php
|
||||||
|
$conf->db->type = $dolibarr_main_db_type;
|
||||||
|
$conf->db->host = $dolibarr_main_db_host;
|
||||||
|
$conf->db->port = $dolibarr_main_db_port;
|
||||||
|
$conf->db->name = $dolibarr_main_db_name;
|
||||||
|
$conf->db->user = $dolibarr_main_db_user;
|
||||||
|
$conf->db->pass = $dolibarr_main_db_pass;
|
||||||
|
$db = new DoliDb($conf->db->type,$conf->db->host,$conf->db->user,$conf->db->pass,$conf->db->name,$conf->db->port);
|
||||||
|
if ($db->connected == 1 && $db->database_selected == 1)
|
||||||
|
{
|
||||||
|
$ok=1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# If a database access is available, we set more variable
|
||||||
|
if ($ok)
|
||||||
|
{
|
||||||
|
$conf->setValues($db);
|
||||||
|
// Current version is $conf->global->MAIN_VERSION_LAST_UPGRADE
|
||||||
|
// Version to install is DOL_VERSION
|
||||||
|
$dolibarrcurrentversionarray=split('[\.-]',$conf->global->MAIN_VERSION_LAST_UPGRADE);
|
||||||
|
$dolibarrversiontoinstallarray=versiondolibarrarray();
|
||||||
|
}
|
||||||
|
|
||||||
|
# Show upgrade lines
|
||||||
|
$foundrecommandedchoice=0;
|
||||||
foreach ($migrationscript as $migarray)
|
foreach ($migrationscript as $migarray)
|
||||||
{
|
{
|
||||||
$versionfrom=$migarray['from'];
|
$versionfrom=$migarray['from'];
|
||||||
$versionto=$migarray['to'];
|
$versionto=$migarray['to'];
|
||||||
$newversionfrom=eregi_replace('\.[0-9]+$','.*',$versionfrom);
|
$newversionfrom=eregi_replace('\.[0-9]+$','.*',$versionfrom);
|
||||||
$newversionto=eregi_replace('\.[0-9]+$','.*',$versionto);
|
$newversionto=eregi_replace('\.[0-9]+$','.*',$versionto);
|
||||||
print '<tr><td nowrap="nowrap"><b>'.$langs->trans("Upgrade").' '.$newversionfrom.' -> '.$newversionto.'</b></td><td>';
|
print '<tr><td nowrap="nowrap"><b>'.$langs->trans("Upgrade").' '.$newversionfrom.' -> '.$newversionto.'</b></td>';
|
||||||
print $langs->trans("UpgradeDesc").'</td>';
|
print '<td>';
|
||||||
|
print $langs->trans("UpgradeDesc");
|
||||||
|
if ($ok && sizeof($dolibarrcurrentversionarray) > 0) // If a database access is available and a version already available
|
||||||
|
{
|
||||||
|
$dolibarrversionfromarray=split('[\.-]',$versionfrom);
|
||||||
|
$dolibarrversiontoarray=split('[\.-]',$versionto);
|
||||||
|
if (empty($foundrecommandedchoice) && versioncompare($dolibarrversiontoarray,$dolibarrcurrentversionarray) >= 0)
|
||||||
|
{
|
||||||
|
print '<br>';
|
||||||
|
print $langs->trans("InstallChoiceRecommanded",DOL_VERSION,$conf->global->MAIN_VERSION_LAST_UPGRADE);
|
||||||
|
// <img src="../theme/eldy/img/tick.png" alt="Ok"> ';
|
||||||
|
$foundrecommandedchoice=1; // To show only once
|
||||||
|
}
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
print '<td align="center">';
|
print '<td align="center">';
|
||||||
if ($allowupgrade)
|
if ($allowupgrade)
|
||||||
{
|
{
|
||||||
@ -297,6 +350,7 @@ else
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>'."\n";
|
print '</tr>'."\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
print "\n";
|
print "\n";
|
||||||
}
|
}
|
||||||
|
|||||||
@ -128,6 +128,7 @@ KeepDefaultValues=You use the Doliwamp setup wizard, so values proposed here are
|
|||||||
FieldRenamed=Field renamed
|
FieldRenamed=Field renamed
|
||||||
IfLoginDoesNotExistsCheckCreateUser=If login does not exists yet, you must check option "Create user"
|
IfLoginDoesNotExistsCheckCreateUser=If login does not exists yet, you must check option "Create user"
|
||||||
ErrorConnection=Server "<b>%s</b>", database name "<b>%s</b>", login "<b>%s</b>", or database password may be wrong or PHP client version may be too old compared to database version.
|
ErrorConnection=Server "<b>%s</b>", database name "<b>%s</b>", login "<b>%s</b>", or database password may be wrong or PHP client version may be too old compared to database version.
|
||||||
|
InstallChoiceRecommanded=Recommanded choice to install version <b>%s</b> from your current version <b>%s</b>
|
||||||
|
|
||||||
#########
|
#########
|
||||||
# upgrade
|
# upgrade
|
||||||
|
|||||||
@ -128,6 +128,7 @@ KeepDefaultValues=Comme vous utilisez l'assistant d'installation depuis DoliWamp
|
|||||||
FieldRenamed=Champ renommé
|
FieldRenamed=Champ renommé
|
||||||
IfLoginDoesNotExistsCheckCreateUser=Si le login n'existe pas encore, vous devez cocher l'option "Créer l'utilisateur"
|
IfLoginDoesNotExistsCheckCreateUser=Si le login n'existe pas encore, vous devez cocher l'option "Créer l'utilisateur"
|
||||||
ErrorConnection=Le serveur "<b>%s</b>", nom de base "<b>%s</b>", login "<b>%s</b>", ou mot de passe de la base de donnée est peut-être incorrect ou la version du client PHP trop ancienne par rapport à la version de la base de donnée.
|
ErrorConnection=Le serveur "<b>%s</b>", nom de base "<b>%s</b>", login "<b>%s</b>", ou mot de passe de la base de donnée est peut-être incorrect ou la version du client PHP trop ancienne par rapport à la version de la base de donnée.
|
||||||
|
InstallChoiceRecommanded=Choix recommandé pour installer la version <b>%s</b> depuis votre version actuelle <b>%s</b>
|
||||||
|
|
||||||
#########
|
#########
|
||||||
# upgrade
|
# upgrade
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user