Fix: error when running install twice

Fix: a minor error was locking the full upgrade process.
This commit is contained in:
Laurent Destailleur 2015-12-31 12:02:22 +01:00
parent 41516093bb
commit 5a49b8ce53
9 changed files with 17 additions and 9 deletions

View File

@ -536,5 +536,5 @@ $(".runupgrade").click(function() {
</script>';
dolibarr_install_syslog("--- check: end");
pFooter(true); // Never display next button
pFooter(1); // Never display next button

View File

@ -55,6 +55,8 @@ background: #FDFDFD;
border: 1px solid #ACBCBB;
padding: 0 0 0 0;
margin: 0 0 0 0;
color: #AAA !important;
cursor: not-allowed !important;
}
input[type=submit] {

View File

@ -412,7 +412,7 @@ function pHeader($subtitle,$next,$action='set',$param='',$forcejqueryurl='')
/**
* Print HTML footer of install pages
*
* @param integer $nonext No button "Next step"
* @param integer $nonext 1=No button "Next step", 2=Show button but disabled
* @param string $setuplang Language code
* @param string $jscheckfunction Add a javascript check function
* @param integer $withpleasewait Add also please wait tags
@ -429,9 +429,9 @@ function pFooter($nonext=0,$setuplang='',$jscheckfunction='', $withpleasewait=0)
print '</td></tr></table>'."\n";
print '</td></tr></table>'."\n";
if (! $nonext)
if (! $nonext || ($nonext == '2'))
{
print '<div class="nextbutton" id="nextbutton"><input type="submit" value="'.$langs->trans("NextStep").' ->"';
print '<div class="nextbutton" id="nextbutton"><input type="submit" '.($nonext == '2' ? 'disabled="disabled" title="DisabledBecauseOfErrorAddParamignoreerrors"':'').'value="'.$langs->trans("NextStep").' ->"';
if ($jscheckfunction) print ' onClick="return '.$jscheckfunction.'();"';
print '></div>';
if ($withpleasewait) print '<div style="visibility: hidden;" class="pleasewait" id="pleasewait"><br>'.$langs->trans("NextStepMightLastALongTime").'<br><br><div class="blinkwait">'.$langs->trans("PleaseBePatient").'</div></div>';

View File

@ -26,6 +26,9 @@
ALTER TABLE llx_don ADD COLUMN fk_country integer NOT NULL DEFAULT 0 after country;
UPDATE llx_user set api_key = null where api_key = '';
UPDATE llx_commande_fourn set billed=1 where statut = 8;
UPDATE llx_commande_fourn set statut=5 where statut = 8 and billed=1;

View File

@ -6,6 +6,9 @@
-- Requests to clean corrupted database
UPDATE llx_user set api_key = null where api_key = '';
-- delete foreign key that should never exists
ALTER TABLE llx_propal DROP FOREIGN KEY fk_propal_fk_currency;
ALTER TABLE llx_commande DROP FOREIGN KEY fk_commande_fk_currency;

View File

@ -727,7 +727,7 @@ function jsinfo()
dolibarr_install_syslog("--- step1: end");
pFooter($error,$setuplang,'jsinfo',1);
pFooter($error?1:0,$setuplang,'jsinfo',1);
/**

View File

@ -616,6 +616,6 @@ else
dolibarr_install_syslog("--- step2: end");
pFooter(!$ok,$setuplang);
pFooter($ok?0:1,$setuplang);
if (isset($db) && is_object($db)) $db->close();

View File

@ -483,8 +483,8 @@ $ret=0;
if (! $ok && isset($argv[1])) $ret=1;
dol_syslog("Exit ".$ret);
dolibarr_install_syslog("--- upgrade: end");
pFooter(((! $ok && empty($_GET["ignoreerrors"])) || $dirmodule),$setuplang);
dolibarr_install_syslog("--- upgrade: end ".((! $ok && empty($_GET["ignoreerrors"])) || $dirmodule));
pFooter(((! $ok && empty($_GET["ignoreerrors"])) || $dirmodule)?2:0,$setuplang);
if ($db->connected) $db->close();

View File

@ -423,7 +423,7 @@ if ($error && isset($argv[1])) $ret=1;
dol_syslog("Exit ".$ret);
dolibarr_install_syslog("--- upgrade2: end");
pFooter($error,$setuplang);
pFooter($error?2:0,$setuplang);
if ($db->connected) $db->close();