');
$oStep->Display($oPage);
@@ -263,8 +265,8 @@ EOF
$oPage->output();
}
/**
- * Make the wizard run: Start, Next or Back depending WizardUpdateButtons();
-on the page's parameters
+ * Make the wizard run: 'Start', 'Next' or 'Back' depending WizardUpdateButtons();
+ * on the page's parameters
*/
public function Run()
{
diff --git a/setup/wizardsteps/WizStepLandingBeforeAudit.php b/setup/wizardsteps/WizStepLandingBeforeAudit.php
index 8e92fa74d5..691f851212 100644
--- a/setup/wizardsteps/WizStepLandingBeforeAudit.php
+++ b/setup/wizardsteps/WizStepLandingBeforeAudit.php
@@ -52,6 +52,17 @@ class WizStepLandingBeforeAudit extends WizStepModulesChoice
*/
public function UpdateWizardStateAndGetNextStep($bMoveForward = true): WizardState
{
+ if ($this->oWizard->GetParameter('skip_wizard', false)) {
+ $oRuntimeEnv = new RunTimeEnvironment();
+ $sBuildConfigFile = APPCONF.$oRuntimeEnv->GetBuildEnv().'/'.ITOP_CONFIG_FILE;
+ $oConfig = new Config($sBuildConfigFile);
+ $oExtensionMap = iTopExtensionsMap::GetExtensionsMap($oRuntimeEnv->GetBuildEnv());
+ $aExtensionsFromDatabase = $oExtensionMap->GetChoicesFromDatabase($oConfig);
+ $this->oWizard->SetParameter('selected_extensions', json_encode($aExtensionsFromDatabase));
+ $adModulesFromDatabase = ModuleInstallationRepository::GetInstance()->ReadComputeInstalledModules($oConfig);
+ $this->oWizard->SetParameter('selected_modules', json_encode(array_keys($adModulesFromDatabase)));
+ }
+
$aWizardSteps = $this->GetWizardSteps();
$this->oWizard->SetWizardSteps($aWizardSteps);
$this->sCurrentState = count($aWizardSteps) - 1;
diff --git a/setup/wizardsteps/WizStepWelcome.php b/setup/wizardsteps/WizStepWelcome.php
index 9420f0ea8c..ebbf7ab7ee 100644
--- a/setup/wizardsteps/WizStepWelcome.php
+++ b/setup/wizardsteps/WizStepWelcome.php
@@ -24,6 +24,15 @@
class WizStepWelcome extends WizardStep
{
protected $bCanMoveForward;
+ private array $aInfo;
+ private array $aWarnings;
+ private array $aErrors;
+
+ public function __construct(WizardController $oWizard, $sCurrentState)
+ {
+ parent::__construct($oWizard, $sCurrentState);
+ $this->CheckInstallation();
+ }
public function GetTitle()
{
@@ -66,39 +75,14 @@ class WizStepWelcome extends WizardStep
EOF
);
$oPage->add('
'.ITOP_APPLICATION.' Installation Wizard
');
- $aResults = SetupUtils::CheckPhpAndExtensions();
- $this->bCanMoveForward = true;
- $aInfo = [];
- $aWarnings = [];
- $aErrors = [];
- foreach ($aResults as $oCheckResult) {
- switch ($oCheckResult->iSeverity) {
- case CheckResult::ERROR:
- $aErrors[] = $oCheckResult->sLabel;
- $this->bCanMoveForward = false;
- break;
-
- case CheckResult::WARNING:
- $aWarnings[] = $oCheckResult->sLabel;
- break;
-
- case CheckResult::INFO:
- $aInfo[] = $oCheckResult->sLabel;
- break;
-
- case CheckResult::TRACE:
- SetupLog::Ok($oCheckResult->sLabel);
- break;
- }
- }
$sStyle = 'style="display:none;overflow:auto;"';
$sToggleButtons = '
';
- if (count($aErrors) > 0) {
+ if (count($this->aErrors) > 0) {
$sStyle = 'style="overflow:auto;"';
- $sTitle = count($aErrors).' Error(s), '.count($aWarnings).' Warning(s).';
+ $sTitle = count($this->aErrors).' Error(s), '.count($this->aWarnings).' Warning(s).';
$sH2Class = 'text-error';
- } elseif (count($aWarnings) > 0) {
- $sTitle = count($aWarnings).' Warning(s) '.$sToggleButtons;
+ } elseif (count($this->aWarnings) > 0) {
+ $sTitle = count($this->aWarnings).' Warning(s) '.$sToggleButtons;
$sH2Class = 'text-warning';
} else {
$sTitle = 'Ok. '.$sToggleButtons;
@@ -110,13 +94,13 @@ EOF
HTML
);
- foreach ($aErrors as $sText) {
+ foreach ($this->aErrors as $sText) {
$oPage->error($sText);
}
- foreach ($aWarnings as $sText) {
+ foreach ($this->aWarnings as $sText) {
$oPage->warning($sText);
}
- foreach ($aInfo as $sText) {
+ foreach ($this->aInfo as $sText) {
$oPage->ok($sText);
}
$oPage->add('
');
@@ -127,8 +111,78 @@ HTML
$oPage->add_ready_script('CheckDirectoryConfFilesPermissions("'.utils::GetItopVersionWikiSyntax().'")');
}
+ /**
+ * Add post display stuff to the setup screen
+ * @param \SetupPage $oPage
+ *
+ * @return void
+ */
+ public function PreFormDisplay(SetupPage $oPage)
+ {
+ if ($this->bCanMoveForward) {
+ $sBuildConfigFile = APPCONF.ITOP_DEFAULT_ENV.'/'.ITOP_CONFIG_FILE;
+ if (file_exists($sBuildConfigFile)) {
+ $oContextTag = new ContextTag(ContextTag::TAG_SETUP);
+ $sToken = SetupUtils::CreateSetupToken();
+ $oPage->add(
+ <<
+
+
+
+
+HTML
+ );
+ }
+ }
+ }
+
public function CanMoveForward()
{
return $this->bCanMoveForward;
}
+
+ /**
+ */
+ public function CheckInstallation(): void
+ {
+ $aResults = SetupUtils::CheckPhpAndExtensions();
+ $this->bCanMoveForward = true;
+ $this->aInfo = [];
+ $this->aWarnings = [];
+ $this->aErrors = [];
+ foreach ($aResults as $oCheckResult) {
+ switch ($oCheckResult->iSeverity) {
+ case CheckResult::ERROR:
+ $this->aErrors[] = $oCheckResult->sLabel;
+ $this->bCanMoveForward = false;
+ break;
+
+ case CheckResult::WARNING:
+ $this->aWarnings[] = $oCheckResult->sLabel;
+ break;
+
+ case CheckResult::INFO:
+ $this->aInfo[] = $oCheckResult->sLabel;
+ break;
+
+ case CheckResult::TRACE:
+ SetupLog::Ok($oCheckResult->sLabel);
+ break;
+ }
+ }
+ }
}
diff --git a/setup/wizardsteps/WizardStep.php b/setup/wizardsteps/WizardStep.php
index a953c52756..cc9f2190d8 100644
--- a/setup/wizardsteps/WizardStep.php
+++ b/setup/wizardsteps/WizardStep.php
@@ -76,6 +76,10 @@ abstract class WizardStep
{
}
+ public function PreFormDisplay(SetupPage $oPage)
+ {
+ }
+
protected function CheckDependencies()
{
if (is_null($this->bDependencyCheck)) {