From 52b4daf69670d59687de70f89d5060303b67a96d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a?= Date: Sun, 21 Apr 2013 10:43:34 +0200 Subject: [PATCH] Refactor + replaced "OK" and "Error" status install messages with images --- htdocs/install/etape1.php | 42 ++++++++++++++++----------------------- htdocs/install/etape2.php | 20 +++++++++---------- 2 files changed, 27 insertions(+), 35 deletions(-) diff --git a/htdocs/install/etape1.php b/htdocs/install/etape1.php index 24e56a7ecf0..53f1aba9e19 100644 --- a/htdocs/install/etape1.php +++ b/htdocs/install/etape1.php @@ -458,7 +458,7 @@ if (! $error && $db->connected && $action == "set") print ''; print $langs->trans("ConfFileReload"); print ''; - print ''.$langs->trans("OK").''; + print 'Ok'; $userroot=isset($_POST["db_user_root"])?$_POST["db_user_root"]:""; @@ -508,7 +508,7 @@ if (! $error && $db->connected && $action == "set") print $langs->trans("UserCreation").' : '; print $dolibarr_main_db_user; print ''; - print ''.$langs->trans("OK").''; + print 'Ok'; } else { @@ -542,7 +542,7 @@ if (! $error && $db->connected && $action == "set") print $langs->trans("UserCreation").' : '; print $dolibarr_main_db_user; print ''; - print ''.$langs->trans("Error").''; + print 'Error'; print ''; // Affiche aide diagnostique @@ -576,7 +576,7 @@ if (! $error && $db->connected && $action == "set") print $langs->trans("DatabaseCreation")." (".$langs->trans("User")." ".$userroot.") : "; print $dolibarr_main_db_name; print ''; - print "".$langs->trans("OK").""; + print 'Ok'; $check1=$newdb->getDefaultCharacterSetDatabase(); $check2=$newdb->getDefaultCollationDatabase(); @@ -606,7 +606,7 @@ if (! $error && $db->connected && $action == "set") print $langs->trans("DatabaseCreation")." (".$langs->trans("User")." ".$userroot.") : "; print $dolibarr_main_db_name; print ''; - print ''.$langs->trans("Error").''; + print 'Error'; print ''; // Affiche aide diagnostique @@ -632,43 +632,35 @@ if (! $error && $db->connected && $action == "set") if ($db->connected == 1) { + dolibarr_install_syslog("etape1: connexion to server by user ".$conf->db->user." is ok", LOG_DEBUG); + print ""; + print $langs->trans("ServerConnection")." (".$langs->trans("User")." ".$conf->db->user.") : "; + print $dolibarr_main_db_host; + print ""; + print 'Ok'; + print ""; + // si acces serveur ok et acces base ok, tout est ok, on ne va pas plus loin, on a meme pas utilise le compte root. if ($db->database_selected == 1) { - dolibarr_install_syslog("etape1: connexion to server by user ".$conf->db->user." is ok", LOG_DEBUG); - print ""; - print $langs->trans("ServerConnection")." (".$langs->trans("User")." ".$conf->db->user.") : "; - print $dolibarr_main_db_host; - print ""; - print $langs->trans("OK"); - print ""; - dolibarr_install_syslog("etape1: connexion to database : ".$conf->db->name.", by user : ".$conf->db->user." is ok", LOG_DEBUG); print ""; print $langs->trans("DatabaseConnection")." (".$langs->trans("User")." ".$conf->db->user.") : "; print $dolibarr_main_db_name; print ""; - print $langs->trans("OK"); + print 'Ok'; print ""; $error = 0; } else { - dolibarr_install_syslog("etape1: connexion to server by user ".$conf->db->user." is ok", LOG_DEBUG); - print ""; - print $langs->trans("ServerConnection")." (".$langs->trans("User")." ".$conf->db->user.") : "; - print $dolibarr_main_db_host; - print ""; - print $langs->trans("OK"); - print ""; - dolibarr_install_syslog("etape1: connexion to database ".$conf->db->name.", by user : ".$conf->db->user." has failed", LOG_ERR); print ""; print $langs->trans("DatabaseConnection")." (".$langs->trans("User")." ".$conf->db->user.") : "; print $dolibarr_main_db_name; print ''; - print $langs->trans("Error"); + print 'Error'; print ""; // Affiche aide diagnostique @@ -688,7 +680,7 @@ if (! $error && $db->connected && $action == "set") print $langs->trans("ServerConnection")." (".$langs->trans("User")." ".$conf->db->user.") : "; print $dolibarr_main_db_host; print ''; - print ''.$db->error.''; + print 'Error'; print ""; // Affiche aide diagnostique @@ -938,7 +930,7 @@ function write_conf_file($conffile) print $langs->trans("SaveConfigurationFile"); print ' '.$conffile.''; print ""; - print $langs->trans("OK"); + print 'Ok'; print ""; } else diff --git a/htdocs/install/etape2.php b/htdocs/install/etape2.php index 9ad310dec9d..92b5f2111b7 100644 --- a/htdocs/install/etape2.php +++ b/htdocs/install/etape2.php @@ -87,12 +87,12 @@ if ($action == "set") if ($db->connected == 1) { print ""; - print $langs->trans("ServerConnection")." : ".$conf->db->host."".$langs->trans("OK").""; + print $langs->trans("ServerConnection")." : ".$conf->db->host.'Ok'; $ok = 1 ; } else { - print "Failed to connect to server : ".$conf->db->host."".$langs->trans("Error").""; + print "Failed to connect to server : ".$conf->db->host.'Error'; } if ($ok) @@ -104,7 +104,7 @@ if ($action == "set") else { dolibarr_install_syslog("etape2: Connexion failed to database : ".$conf->db->name); - print "Failed to select database ".$conf->db->name."".$langs->trans("Error").""; + print "Failed to select database ".$conf->db->name.'Error'; $ok = 0 ; } } @@ -241,13 +241,13 @@ if ($action == "set") if ($error == 0) { print ''; - print $langs->trans("TablesAndPrimaryKeysCreation").''.$langs->trans("OK").''; + print $langs->trans("TablesAndPrimaryKeysCreation").'Ok'; $ok = 1; } } else { - print ''.$langs->trans("ErrorFailedToFindSomeFiles",$dir).''.$langs->trans("Error").''; + print ''.$langs->trans("ErrorFailedToFindSomeFiles",$dir).'Error'; dolibarr_install_syslog("Failed to find files to create database in directory ".$dir,LOG_ERR); } } @@ -388,7 +388,7 @@ if ($action == "set") if ($tablefound && $error == 0) { print ''; - print $langs->trans("OtherKeysCreation").''.$langs->trans("OK").''; + print $langs->trans("OtherKeysCreation").'Ok'; $okkeys = 1; } } @@ -466,11 +466,11 @@ if ($action == "set") print "".$langs->trans("FunctionsCreation").""; if ($ok) { - print "".$langs->trans("OK").""; + print 'Ok'; } else { - print ''.$langs->trans("Error").''; + print 'Error'; $ok = 1 ; } @@ -588,11 +588,11 @@ if ($action == "set") print "".$langs->trans("ReferenceDataLoading").""; if ($ok) { - print "".$langs->trans("OK").""; + print 'Ok'; } else { - print ''.$langs->trans("Error").''; + print 'Error'; $ok = 1; // Data loading are not blocking errors } }