mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 18:48:51 +02:00
N°9144 Small fixes
> Prevent verification when some dependencies are missing > Close unclosed div > Change progress bar title depending on step > Fix ignored "check uninstall check" flag > Added phpunit tests to cover "check uninstall check" flag > Progress bar appropriately reflect error status (red & not animated)
This commit is contained in:
@@ -69,7 +69,7 @@ class WizStepDataAudit extends WizStepInstall
|
||||
|
||||
$aInstallParams = $this->BuildConfig();
|
||||
|
||||
$this->AddProgressBar($oPage);
|
||||
$this->AddProgressBar($oPage, 'Progress of the verification');
|
||||
|
||||
$sJSONData = json_encode($aInstallParams);
|
||||
$oPage->add('<input type="hidden" id="installer_parameters" value="'.utils::EscapeHtml($sJSONData).'"/>');
|
||||
@@ -78,17 +78,19 @@ class WizStepDataAudit extends WizStepInstall
|
||||
$oPage->add('<input type="hidden" id="authent_token" value="'.$sAuthentToken.'"/>');
|
||||
$sApplicationUrl = $this->oWizard->GetParameter('application_url').'pages/exec.php?exec_module=combodo-data-feature-removal&exec_page=index.php';
|
||||
$oPage->add('<input type="hidden" id="application_url" value="'.$sApplicationUrl.'"/>');
|
||||
|
||||
if (!$this->CheckDependencies()) {
|
||||
$oPage->error($this->sDependencyIssue);
|
||||
}
|
||||
|
||||
$oPage->add_ready_script(
|
||||
<<<JS
|
||||
$oPage->add_ready_script(<<<JS
|
||||
$("#wiz_form").data("installation_status", "error");
|
||||
document.getElementById("setup_msg").innerText = "Unmet dependencies";
|
||||
JS);
|
||||
} else {
|
||||
$oPage->add_ready_script(<<<JS
|
||||
$("#wiz_form").data("installation_status", "not started");
|
||||
ExecuteStep("");
|
||||
JS
|
||||
);
|
||||
JS);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected function AddProgressErrorScript($oPage, $aRes)
|
||||
|
||||
@@ -58,9 +58,9 @@ class WizStepInstall extends AbstractWizStepInstall
|
||||
return new WizardState(WizStepDone::class);
|
||||
}
|
||||
|
||||
protected function AddProgressBar(WebPage $oPage)
|
||||
protected function AddProgressBar(WebPage $oPage, string $sTitle = 'Progress of the operations')
|
||||
{
|
||||
$oPage->add('<fieldset id="installation_progress"><legend>Progress of the installation</legend>');
|
||||
$oPage->add('<fieldset id="installation_progress"><legend>'.$sTitle.'</legend>');
|
||||
$oPage->add('<div id="progress_content">');
|
||||
$oPage->LinkScriptFromAppRoot('setup/jquery.progression.js');
|
||||
$oPage->add('<p class="center"><span id="setup_msg">Ready to start...</span></p><div style="display:block;margin-left: auto; margin-right:auto;" id="progress">0%</div>');
|
||||
@@ -74,7 +74,7 @@ class WizStepInstall extends AbstractWizStepInstall
|
||||
{
|
||||
|
||||
$aInstallParams = $this->BuildConfig();
|
||||
$this->AddProgressBar($oPage);
|
||||
$this->AddProgressBar($oPage, 'Progress of the installation');
|
||||
|
||||
$sJSONData = json_encode($aInstallParams);
|
||||
$oPage->add('<input type="hidden" id="installer_parameters" value="'.utils::EscapeHtml($sJSONData).'"/>');
|
||||
@@ -136,6 +136,7 @@ EOF
|
||||
$oPage->add_ready_script(
|
||||
<<<EOF
|
||||
$("#wiz_form").data("installation_status", "error");
|
||||
$("#progress .progress").addClass('progress-error');
|
||||
WizardUpdateButtons();
|
||||
$('#setup_error').html('$sMessage').show();
|
||||
EOF
|
||||
|
||||
@@ -126,6 +126,7 @@ HTML
|
||||
);
|
||||
|
||||
$sAuthentToken = $this->oWizard->GetParameter('authent', '');
|
||||
$oPage->add('</div>');
|
||||
$oPage->add('<input type="hidden" id="authent_token" value="'.$sAuthentToken.'"/>');
|
||||
//$oPage->add('</fieldset>');
|
||||
$oPage->add_ready_script(
|
||||
|
||||
@@ -680,10 +680,14 @@ EOF
|
||||
if ($bMissingFromDisk) {
|
||||
$bDisabled = true;
|
||||
$bChecked = false;
|
||||
} elseif ($bMandatory || $bInstalled && !$bCanBeUninstalled) {
|
||||
} elseif ($bMandatory) {
|
||||
$bDisabled = true;
|
||||
$bChecked = true;
|
||||
} elseif ($bInstalled && !$bCanBeUninstalled && !$bDisableUninstallCheck) {
|
||||
$bChecked = true;
|
||||
$bDisabled = true;
|
||||
}
|
||||
|
||||
if ($bAllDisabled) {
|
||||
$bDisabled = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user