diff --git a/setup/wizardcontroller.class.inc.php b/setup/wizardcontroller.class.inc.php index 2f2fd3258d..eace6760da 100644 --- a/setup/wizardcontroller.class.inc.php +++ b/setup/wizardcontroller.class.inc.php @@ -38,7 +38,7 @@ require_once(APPROOT.'setup/extensionsmap.class.inc.php'); class WizardController { - protected $aSteps; + protected $aWizardSteps; protected $sInitialStepClass; protected $sInitialState; protected $aParameters; @@ -53,7 +53,7 @@ class WizardController $this->sInitialStepClass = $sInitialStepClass; $this->sInitialState = $sInitialState; $this->aParameters = []; - $this->aSteps = []; + $this->aWizardSteps = []; } /** @@ -62,7 +62,7 @@ class WizardController */ protected function PushStep($aStepInfo) { - array_push($this->aSteps, $aStepInfo); + array_push($this->aWizardSteps, $aStepInfo); } /** @@ -71,7 +71,7 @@ class WizardController */ protected function PopStep() { - return array_pop($this->aSteps); + return array_pop($this->aWizardSteps); } /** @@ -235,9 +235,9 @@ HTML; $oPage->add(''); } - $oPage->add(''); + $oPage->add(''); $oPage->add('
| '); } if ($oStep->CanMoveForward()) { @@ -296,7 +296,7 @@ on the page's parameters $sOperation = utils::ReadParam('operation'); $this->aParameters = utils::ReadParam('_params', [], false, 'raw_data'); - $this->SetSteps(json_decode(utils::ReadParam('_steps', '[]', false, 'raw_data'), true)); + $this->SetWizardSteps(json_decode(utils::ReadParam('_steps', '[]', false, 'raw_data'), true)); switch ($sOperation) { case 'next': @@ -371,9 +371,9 @@ on the page's parameters return $sOutput; } - public function SetSteps(array $aSteps): void + public function SetWizardSteps(array $aWizardSteps): void { - $this->aSteps = $aSteps; + $this->aWizardSteps = $aWizardSteps; } /** diff --git a/setup/wizardsteps/WizStepLandingBeforeAudit.php b/setup/wizardsteps/WizStepLandingBeforeAudit.php index d2bf47fc01..a848f372cc 100644 --- a/setup/wizardsteps/WizStepLandingBeforeAudit.php +++ b/setup/wizardsteps/WizStepLandingBeforeAudit.php @@ -40,25 +40,6 @@ class WizStepLandingBeforeAudit extends WizStepModulesChoice */ public function UpdateWizardStateAndGetNextStep($bMoveForward = true): WizardState { - $this->oWizard->SetParameter('selected_components', '[{"_0":"_0","_1":"_1","_2":"_2","_3":"_3","_4":"_4"},{"_0":"_0"},{"_0":"_0","_0_0":"_0_0"},{"_0":"_0"},{"_0":"_0","_1":"_1"},{"_0":"_0","_1":"_1"}]'); - $aSteps = json_decode( - '[ - {"class":"WizStepWelcome","state":""}, - {"class":"WizStepInstallOrUpgrade","state":""}, - {"class":"WizStepDetectedInfo","state":""}, - {"class":"WizStepUpgradeMiscParams","state":""}, - {"class":"WizStepModulesChoice","state":"start_upgrade"}, - {"class":"WizStepModulesChoice","state":"1"}, - {"class":"WizStepModulesChoice","state":"2"}, - {"class":"WizStepModulesChoice","state":"3"}]', - true - ); - $this->oWizard->SetSteps($aSteps); - $this->aSteps = $aSteps; - - $this->sCurrentState = count($aSteps) - 1; - //parent::UpdateWizardStateAndGetNextStep(true); - $oProductionEnv = new RunTimeEnvironment(); $sBuildConfigFile = APPCONF.$oProductionEnv->GetBuildEnv().'/'.ITOP_CONFIG_FILE; @chmod($sBuildConfigFile, 0770); // In case it exists: RWX for owner and group, nothing for others @@ -79,6 +60,13 @@ class WizStepLandingBeforeAudit extends WizStepModulesChoice $this->oWizard->SaveParameter('removed_extensions', []); $this->oWizard->SaveParameter('extensions_not_uninstallable', []); + $aWizardSteps = $this->GetWizardSteps(); + $this->oWizard->SetWizardSteps($aWizardSteps); + $this->sCurrentState = count($aWizardSteps) - 1; + + $aSelectedComponents = $this->GetSelectedComponents($this->aSteps, $this->oWizard->GetParameter('selected_extensions')); + $this->oWizard->SetParameter('selected_components', json_encode($aSelectedComponents)); + return new WizardState(WizStepDataAudit::class); } diff --git a/setup/wizardsteps/WizStepModulesChoice.php b/setup/wizardsteps/WizStepModulesChoice.php index 1ca139445c..e32d82231c 100644 --- a/setup/wizardsteps/WizStepModulesChoice.php +++ b/setup/wizardsteps/WizStepModulesChoice.php @@ -120,46 +120,6 @@ class WizStepModulesChoice extends AbstractWizStepInstall return [$aExtensionsAdded, $aExtensionsRemoved, $aExtensionsNotUninstallable]; } - public static function GetSetupComponentsFromExtensions(Config $oConfig, array $aSelectedExtensions): array - { - $sSourceFile = APPROOT.'datamodels/2.x/installation.xml'; - $oExtensionsMap = new iTopExtensionsMap(); - $oExtensionsMap->LoadChoicesFromDatabase($oConfig); - $aOptions = $oExtensionsMap->GetAllExtensionsOptionInfo(false); - - if (is_file($sSourceFile)) { - $aParams = new XMLParameters($sSourceFile); - $aSteps = $aParams->Get('steps', []); - - // Display this step of the wizard only if there is something to display - if (count($aOptions) > 0) { - $aSteps[] = [ - 'title' => 'Extensions', - 'description' => ' |