diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index ef5b3eab061..8cc3fc28c9e 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -160,9 +160,10 @@ function versiondolibarrarray() * @param int $linelengthlimit Limit for length of each line (Use 0 if unknown, may be faster if defined) * @param int $nocommentremoval Do no try to remove comments (in such a case, we consider that each line is a request, so use also $linelengthlimit=0) * @param int $offsetforchartofaccount Offset to use to load chart of account table to update sql on the fly to add offset to rowid and account_parent value + * @param int $colspan 2=Add a colspan=2 on td * @return int <=0 if KO, >0 if OK */ -function run_sql($sqlfile, $silent = 1, $entity = '', $usesavepoint = 1, $handler = '', $okerror = 'default', $linelengthlimit = 32768, $nocommentremoval = 0, $offsetforchartofaccount = 0) +function run_sql($sqlfile, $silent = 1, $entity = '', $usesavepoint = 1, $handler = '', $okerror = 'default', $linelengthlimit = 32768, $nocommentremoval = 0, $offsetforchartofaccount = 0, $colspan = 0) { global $db, $conf, $langs, $user; @@ -282,13 +283,9 @@ function run_sql($sqlfile, $silent = 1, $entity = '', $usesavepoint = 1, $handle } } else { if (!$silent) { - print ''; - } - if (!$silent) { - print '
'.$langs->trans("Failed to get max rowid for ".$table)."
"; - } - if (!$silent) { - print ''; + print ''; + print '
'.$langs->trans("Failed to get max rowid for ".$table)."
"; + print ''; } $error++; break; @@ -337,7 +334,7 @@ function run_sql($sqlfile, $silent = 1, $entity = '', $usesavepoint = 1, $handle // Add log of request if (!$silent) { - print ''.$langs->trans("Request").' '.($i + 1)." sql='".dol_htmlentities($newsql, ENT_NOQUOTES)."'\n"; + print ''.$langs->trans("Request").' '.($i + 1)." sql='".dol_htmlentities($newsql, ENT_NOQUOTES)."'\n"; } dol_syslog('Admin.lib::run_sql Request '.($i + 1), LOG_DEBUG); $sqlmodified = 0; @@ -371,13 +368,9 @@ function run_sql($sqlfile, $silent = 1, $entity = '', $usesavepoint = 1, $handle $cursor = $reg[1]; if (empty($listofinsertedrowid[$cursor])) { if (!$silent) { - print ''; - } - if (!$silent) { - print '
'.$langs->trans("FileIsNotCorrect")."
"; - } - if (!$silent) { - print ''; + print ''; + print '
'.$langs->trans("FileIsNotCorrect")."
"; + print ''; } $error++; break; @@ -437,22 +430,14 @@ function run_sql($sqlfile, $silent = 1, $entity = '', $usesavepoint = 1, $handle // Is it an error we accept if (!in_array($errno, $okerrors)) { if (!$silent) { - print ''; - } - if (!$silent) { - print '
'.$langs->trans("Error")." ".$db->errno().": ".$newsql."
".$db->error()."
"; - } - if (!$silent) { - print ''."\n"; + print ''; + print '
'.$langs->trans("Error")." ".$db->errno().": ".$newsql."
".$db->error()."
"; + print ''."\n"; } dol_syslog('Admin.lib::run_sql Request '.($i + 1)." Error ".$db->errno()." ".$newsql."
".$db->error(), LOG_ERR); $error++; } } - - if (!$silent) { - print ''."\n"; - } } } diff --git a/htdocs/install/default.css b/htdocs/install/default.css index 88967664ad8..664dfd78d89 100644 --- a/htdocs/install/default.css +++ b/htdocs/install/default.css @@ -59,10 +59,12 @@ table.main-inside { margin-top: 10px; color: #000000; border-top: 1px solid #ccc; - /* border-bottom: 1px solid #ccc; */ line-height: 22px; } - +table.main-inside-borderbottom { + border-bottom: 1px solid #ccc; +} + table.main { padding-left: 6px; padding-right: 6px; diff --git a/htdocs/install/step5.php b/htdocs/install/step5.php index b841edb12ac..0958ef7bb3b 100644 --- a/htdocs/install/step5.php +++ b/htdocs/install/step5.php @@ -114,7 +114,7 @@ if ($action == "set") { $morehtml = ''; -pHeader($langs->trans("SetupEnd"), "step5"); +pHeader($langs->trans("SetupEnd"), "step5", 'set', '', '', 'main-inside main-inside-borderbottom'); print '
'; // Test if we can run a first install process diff --git a/htdocs/install/upgrade.php b/htdocs/install/upgrade.php index 70257bba79e..e349317b0c4 100644 --- a/htdocs/install/upgrade.php +++ b/htdocs/install/upgrade.php @@ -102,7 +102,7 @@ if (!$versionfrom && !$versionto) { } -pHeader('', "upgrade2", GETPOST('action', 'aZ09'), 'versionfrom='.$versionfrom.'&versionto='.$versionto); +pHeader('', "upgrade2", GETPOST('action', 'aZ09'), 'versionfrom='.$versionfrom.'&versionto='.$versionto, '', 'main-inside main-inside-borderbottom'); $actiondone = 0; @@ -348,9 +348,10 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ print ''.$langs->trans("ChoosedMigrateScript").''.$file.''."\n"; // Run sql script - $ok = run_sql($dir.$file, 0, '', 1); + $ok = run_sql($dir.$file, 0, '', 1, '', 'default', 32768, 0, 0, 2); $listoffileprocessed[$dir.$file] = $dir.$file; + // Scan if there is migration scripts that depends of Dolibarr version // for modules htdocs/module/sql or htdocs/custom/module/sql (files called "dolibarr_x.y.z-a.b.c.sql") $modulesfile = array(); @@ -369,17 +370,20 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ } } - foreach ($modulesfile as $modulefilelong => $modulefileshort) { - if (in_array($modulefilelong, $listoffileprocessed)) { - continue; + if (count($modulesfile)) { + print '
'; + + foreach ($modulesfile as $modulefilelong => $modulefileshort) { + if (in_array($modulefilelong, $listoffileprocessed)) { + continue; + } + + print ''.$langs->trans("ChoosedMigrateScript").' (external modules)'.$modulefileshort.''."\n"; + + // Run sql script + $okmodule = run_sql($modulefilelong, 0, '', 1); // Note: Result of migration of external module should not decide if we continue migration of Dolibarr or not. + $listoffileprocessed[$modulefilelong] = $modulefilelong; } - - print '
'; - print ''.$langs->trans("ChoosedMigrateScript").' (external modules)'.$modulefileshort.''."\n"; - - // Run sql script - $okmodule = run_sql($modulefilelong, 0, '', 1); // Note: Result of migration of external module should not decide if we continue migration of Dolibarr or not. - $listoffileprocessed[$modulefilelong] = $modulefilelong; } } } diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index a11de7c447e..62822bec9ee 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -113,7 +113,7 @@ if ((!$versionfrom || preg_match('/version/', $versionfrom)) && (!$versionto || exit; } -pHeader('', 'step5', GETPOST('action', 'aZ09') ?GETPOST('action', 'aZ09') : 'upgrade', 'versionfrom='.$versionfrom.'&versionto='.$versionto); +pHeader('', 'step5', GETPOST('action', 'aZ09') ?GETPOST('action', 'aZ09') : 'upgrade', 'versionfrom='.$versionfrom.'&versionto='.$versionto, '', 'main-inside main-inside-borderbottom'); if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ09'))) {