'.$langs->trans("DolibarrSetup");
+ print '';
if ($subtitle) {
- print ' - '.$subtitle;
+ print $subtitle;
+ } else {
+ print $langs->trans("DolibarrSetup");
}
print ''."\n";
diff --git a/htdocs/install/repair.php b/htdocs/install/repair.php
index 2f985e418b7..7bba5c48ee2 100644
--- a/htdocs/install/repair.php
+++ b/htdocs/install/repair.php
@@ -73,13 +73,11 @@ if (!is_object($conf)) {
* View
*/
-pHeader('', "upgrade2", GETPOST('action', 'aZ09'));
+pHeader($langs->trans("Repair"), "upgrade2", GETPOST('action', 'aZ09'));
// Action to launch the repair script
$actiondone = 1;
-print ''.$langs->trans("Repair").'
';
-
print '';
print $langs->trans("SetAtLeastOneOptionAsUrlParameter");
print '
';
@@ -1298,16 +1296,54 @@ if ($ok && GETPOST('force_utf8_on_tables', 'alpha')) {
if ($force_utf8_on_tables == 'confirmed') {
$sql = 'SET FOREIGN_KEY_CHECKS=0';
print '';
+ print '| '.$sql.' |
';
$resql = $db->query($sql);
}
+ $foreignkeystorestore = array();
+
+ // First loop to delete foreign keys
+ foreach ($listoftables as $table) {
+ // do not convert llx_const if mysql encrypt/decrypt is used
+ if ($conf->db->dolibarr_main_db_encryption != 0 && preg_match('/\_const$/', $table[0])) {
+ continue;
+ }
+ if ($table[1] == 'VIEW') {
+ print '| '.$table[0].' is a '.$table[1].' (Skipped) |
';
+ continue;
+ }
+
+ // Special case of tables with foreign key on varchar fields
+ $arrayofforeignkey = array(
+ 'llx_accounting_account' => 'fk_accounting_account_fk_pcg_version',
+ 'llx_accounting_system' => 'fk_accounting_account_fk_pcg_version',
+ 'llx_c_type_contact' => 'fk_societe_commerciaux_fk_c_type_contact_code',
+ 'llx_societe_commerciaux' => 'fk_societe_commerciaux_fk_c_type_contact_code'
+ );
+
+ foreach ($arrayofforeignkey as $tmptable => $foreignkeyname) {
+ if ($table[0] == $tmptable) {
+ print '| ';
+ $sqltmp = 'ALTER TABLE '.$table[0].' DROP FOREIGN KEY '.$foreignkeyname;
+ print $sqltmp;
+ if ($force_utf8_on_tables == 'confirmed') {
+ $resqltmp = $db->query($sqltmp);
+ } else {
+ print ' - Disabled';
+ }
+ print ' |
';
+ $foreignkeystorestore[$tmptable] = $foreignkeyname;
+ }
+ }
+ }
+
foreach ($listoftables as $table) {
// do not convert llx_const if mysql encrypt/decrypt is used
if ($conf->db->dolibarr_main_db_encryption != 0 && preg_match('/\_const$/', $table[0])) {
continue;
}
if ($table[1] == 'VIEW') {
- print '| '.$table[0].' is a '.$table[1].' (Skipped) |
';
+ print '| '.$table[0].' is a '.$table[1].' (Skipped) |
';
continue;
}
@@ -1324,17 +1360,45 @@ if ($ok && GETPOST('force_utf8_on_tables', 'alpha')) {
} else {
$resql2 = false;
}
- print ' - Done ('.(($resql1 && $resql2) ? 'OK' : 'KO').')';
+ print ' - Done '.(($resql1 && $resql2) ? '(OK)' : '(KO)');
} else {
- print ' - Disabled';
+ print ' - Disabled';
}
print '';
+ flush();
+ ob_flush();
+ }
+
+ // Restore dropped foreign keys
+ foreach ($foreignkeystorestore as $tmptable => $foreignkeyname) {
+ $stringtofindinline = 'ALTER TABLE .* ADD CONSTRAINT '.$foreignkeyname;
+ $fileforkeys = DOL_DOCUMENT_ROOT.'/install/mysql/tables/'.$tmptable.'.key.sql';
+ //print 'Search in '.$fileforkeys.' to get '.$stringtofindinline."
\n";
+
+ $handle = fopen($fileforkeys, 'r');
+ if ($handle) {
+ while (($line = fgets($handle)) !== false) {
+ // Process the line read.
+ if (preg_match('/^'.$stringtofindinline.'/i', $line)) {
+ $resqltmp = $db->query($line);
+ print '| ';
+ print $line;
+ print ' - Done '.($resqltmp ? '(OK)' : '(KO)');
+ print ' |
';
+ break;
+ }
+ }
+ fclose($handle);
+ }
+ flush();
+ ob_flush();
}
// Enable foreign key checking
if ($force_utf8_on_tables == 'confirmed') {
$sql = 'SET FOREIGN_KEY_CHECKS=1';
print '';
+ print '| '.$sql.' |
';
$resql = $db->query($sql);
}
} else {
@@ -1349,22 +1413,61 @@ if ($ok && GETPOST('force_utf8mb4_on_tables', 'alpha')) {
if ($db->type == "mysql" || $db->type == "mysqli") {
$force_utf8mb4_on_tables = GETPOST('force_utf8mb4_on_tables', 'alpha');
+
$listoftables = $db->DDLListTablesFull($db->database_name);
// Disable foreign key checking for avoid errors
if ($force_utf8mb4_on_tables == 'confirmed') {
$sql = 'SET FOREIGN_KEY_CHECKS=0';
print '';
+ print '| '.$sql.' |
';
$resql = $db->query($sql);
}
+ $foreignkeystorestore = array();
+
+ // First loop to delete foreign keys
+ foreach ($listoftables as $table) {
+ // do not convert llx_const if mysql encrypt/decrypt is used
+ if ($conf->db->dolibarr_main_db_encryption != 0 && preg_match('/\_const$/', $table[0])) {
+ continue;
+ }
+ if ($table[1] == 'VIEW') {
+ print '| '.$table[0].' is a '.$table[1].' (Skipped) |
';
+ continue;
+ }
+
+ // Special case of tables with foreign key on varchar fields
+ $arrayofforeignkey = array(
+ 'llx_accounting_account' => 'fk_accounting_account_fk_pcg_version',
+ 'llx_accounting_system' => 'fk_accounting_account_fk_pcg_version',
+ 'llx_c_type_contact' => 'fk_societe_commerciaux_fk_c_type_contact_code',
+ 'llx_societe_commerciaux' => 'fk_societe_commerciaux_fk_c_type_contact_code'
+ );
+
+ foreach ($arrayofforeignkey as $tmptable => $foreignkeyname) {
+ if ($table[0] == $tmptable) {
+ print '| ';
+ $sqltmp = 'ALTER TABLE '.$table[0].' DROP FOREIGN KEY '.$foreignkeyname;
+ print $sqltmp;
+ if ($force_utf8mb4_on_tables == 'confirmed') {
+ $resqltmp = $db->query($sqltmp);
+ } else {
+ print ' - Disabled';
+ }
+ print ' |
';
+ $foreignkeystorestore[$tmptable] = $foreignkeyname;
+ }
+ }
+ }
+
foreach ($listoftables as $table) {
// do not convert llx_const if mysql encrypt/decrypt is used
if ($conf->db->dolibarr_main_db_encryption != 0 && preg_match('/\_const$/', $table[0])) {
continue;
}
if ($table[1] == 'VIEW') {
- print '| '.$table[0].' is a '.$table[1].' (Skipped) |
';
+ print '| '.$table[0].' is a '.$table[1].' (Skipped) |
';
continue;
}
@@ -1381,19 +1484,45 @@ if ($ok && GETPOST('force_utf8mb4_on_tables', 'alpha')) {
} else {
$resql2 = false;
}
- print ' - Done ('.(($resql1 && $resql2) ? 'OK' : 'KO').')';
+ print ' - Done '.(($resql1 && $resql2) ? '(OK)' : '(KO)');
} else {
- print ' - Disabled';
+ print ' - Disabled';
}
print '';
flush();
ob_flush();
}
+ // Restore dropped foreign keys
+ foreach ($foreignkeystorestore as $tmptable => $foreignkeyname) {
+ $stringtofindinline = 'ALTER TABLE .* ADD CONSTRAINT '.$foreignkeyname;
+ $fileforkeys = DOL_DOCUMENT_ROOT.'/install/mysql/tables/'.$tmptable.'.key.sql';
+ //print 'Search in '.$fileforkeys.' to get '.$stringtofindinline."
\n";
+
+ $handle = fopen($fileforkeys, 'r');
+ if ($handle) {
+ while (($line = fgets($handle)) !== false) {
+ // Process the line read.
+ if (preg_match('/^'.$stringtofindinline.'/i', $line)) {
+ $resqltmp = $db->query($line);
+ print '| ';
+ print $line;
+ print ' - Done '.($resqltmp ? '(OK)' : '(KO)');
+ print ' |
';
+ break;
+ }
+ }
+ fclose($handle);
+ }
+ flush();
+ ob_flush();
+ }
+
// Enable foreign key checking
if ($force_utf8mb4_on_tables == 'confirmed') {
$sql = 'SET FOREIGN_KEY_CHECKS=1';
print '';
+ print '| '.$sql.' |
';
$resql = $db->query($sql);
}
} else {
@@ -1439,9 +1568,9 @@ if ($ok && GETPOST('force_collation_from_conf_on_tables', 'alpha')) {
} else {
$resql2 = false;
}
- print ' - Done ('.(($resql1 && $resql2) ? 'OK' : 'KO').')';
+ print ' - Done '.(($resql1 && $resql2) ? '(OK)' : '(KO)');
} else {
- print ' - Disabled';
+ print ' - Disabled';
}
print '';
}
diff --git a/htdocs/install/step1.php b/htdocs/install/step1.php
index e360e1476ce..ba26c551739 100644
--- a/htdocs/install/step1.php
+++ b/htdocs/install/step1.php
@@ -164,7 +164,7 @@ $error = 0;
dolibarr_install_syslog("--- step1: entering step1.php page");
-pHeader($langs->trans("ConfigurationFile"), "step2");
+pHeader($langs->trans("DolibarrSetup").' - '.$langs->trans("ConfigurationFile"), "step2");
// Test if we can run a first install process
if (!is_writable($conffile)) {
diff --git a/htdocs/install/step2.php b/htdocs/install/step2.php
index 28cab2e155d..a0b64c28a22 100644
--- a/htdocs/install/step2.php
+++ b/htdocs/install/step2.php
@@ -105,7 +105,7 @@ dolibarr_install_syslog("--- step2: entering step2.php page");
* View
*/
-pHeader($langs->trans("CreateDatabaseObjects"), "step4");
+pHeader($langs->trans("DolibarrSetup").' - '.$langs->trans("CreateDatabaseObjects"), "step4");
// Test if we can run a first install process
if (!is_writable($conffile)) {
diff --git a/htdocs/install/step4.php b/htdocs/install/step4.php
index c93f4c815e1..dee25c701c9 100644
--- a/htdocs/install/step4.php
+++ b/htdocs/install/step4.php
@@ -59,7 +59,7 @@ $ok = 0;
* View
*/
-pHeader($langs->trans("AdminAccountCreation"), "step5");
+pHeader($langs->trans("DolibarrSetup").' - '.$langs->trans("AdminAccountCreation"), "step5");
// Test if we can run a first install process
if (!is_writable($conffile)) {
diff --git a/htdocs/install/step5.php b/htdocs/install/step5.php
index 08c45e9999f..7b410b14656 100644
--- a/htdocs/install/step5.php
+++ b/htdocs/install/step5.php
@@ -127,7 +127,7 @@ if ($action == "set") { // Test on permissions not required here
$morehtml = '';
-pHeader($langs->trans("SetupEnd"), "step5", 'set', '', '', 'main-inside main-inside-borderbottom');
+pHeader($langs->trans("DolibarrSetup").' - '.$langs->trans("SetupEnd"), "step5", 'set', '', '', 'main-inside main-inside-borderbottom');
print '
';
// Test if we can run a first install process
diff --git a/htdocs/langs/en_US/sendings.lang b/htdocs/langs/en_US/sendings.lang
index 71d4214c8a5..9f648d5f706 100644
--- a/htdocs/langs/en_US/sendings.lang
+++ b/htdocs/langs/en_US/sendings.lang
@@ -63,7 +63,7 @@ NoProductToShipFoundIntoStock=No product to ship found in warehouse %s. C
WeightVolShort=Weight/Vol.
ValidateOrderFirstBeforeShipment=You must first validate the order before being able to make shipments.
NoLineGoOnTabToAddSome=No line, go on tab "%s" to add
-CreateInvoiceForThisCustomerFromSendings=Bill sendings
+CreateInvoiceForThisCustomerFromSendings=Create Bills
IfValidateInvoiceIsNoSendingStayUnbilled=If invoice validation is 'No', the sending will remain to status 'Unbilled' until the invoice is validated.
OptionToSetSendingBilledNotEnabled=Option from module Workflow, to set sending to 'Billed' automatically when invoice is validated, is not enabled, so you will have to set the status of sendings to 'Billed' manually after the invoice has been generated.
diff --git a/htdocs/langs/fr_FR/sendings.lang b/htdocs/langs/fr_FR/sendings.lang
index d102ba0b21b..8c1a84f562d 100644
--- a/htdocs/langs/fr_FR/sendings.lang
+++ b/htdocs/langs/fr_FR/sendings.lang
@@ -63,7 +63,7 @@ NoProductToShipFoundIntoStock=Aucun produit à expédier n'a été trouvé dans
WeightVolShort=Poids/vol.
ValidateOrderFirstBeforeShipment=Vous devez d'abord valider la commande pour pouvoir créer une expédition.
NoLineGoOnTabToAddSome=Aucune ligne, allez sur l'onglet "%s" pour en ajouter
-CreateInvoiceForThisCustomerFromSendings=Envois de factures
+CreateInvoiceForThisCustomerFromSendings=Création de factures
IfValidateInvoiceIsNoSendingStayUnbilled=Si la validation de la facture est "Non", l'envoi restera à l'état "Non facturé" jusqu'à ce que la facture soit validée.
OptionToSetSendingBilledNotEnabled=L'option du module Workflow, qui permet de définir l'envoi comme "facturé" automatiquement lorsque la facture est validée, n'est pas activée. Vous devrez donc définir manuellement l'état des envois comme "facturé" après que la facture a été générée.