Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion setup/wizardsteps/AbstractWizStepInstall.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ abstract class AbstractWizStepInstall extends WizardStep
*/
protected function BuildConfig()
{
$sMode = $this->oWizard->GetParameter('install_mode', 'install');
$sMode = $this->oWizard->GetParameter('mode', 'install');
$aSelectedModules = json_decode($this->oWizard->GetParameter('selected_modules'), true);
$aSelectedExtensions = json_decode($this->oWizard->GetParameter('selected_extensions'), true);
$sBackupDestination = '';
Expand Down
2 changes: 1 addition & 1 deletion setup/wizardsteps/WizStepLandingBeforeAudit.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public function __construct(WizardController $oWizard, $sCurrentState)
$this->oConfig = new Config($sBuildConfigFile);

$oWizard->SetParameter('previous_version_dir', APPROOT);
$oWizard->SetParameter('install_mode', 'upgrade');
$oWizard->SetParameter('mode', 'upgrade');
$oWizard->SetParameter('source_dir', APPROOT.$this->oConfig->Get('source_dir'));
$oWizard->SetParameter('graphviz_path', $this->oConfig->Get('graphviz_path'));
$oWizard->SetParameter('application_url', $this->oConfig->Get('app_root_url'));
Expand Down
4 changes: 1 addition & 3 deletions setup/wizardsteps/WizStepLicense.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
* You should have received a copy of the GNU Affero General Public License
*/

use Combodo\iTop\Application\WebPage\WebPage;

/**
* License acceptation screen
*/
Expand Down Expand Up @@ -49,7 +47,7 @@ public function UpdateWizardStateAndGetNextStep($bMoveForward = true): WizardSta
*/
private function NeedsGdprConsent()
{
$sMode = $this->oWizard->GetParameter('install_mode');
$sMode = $this->oWizard->GetParameter('mode');

if ($sMode !== 'install') {
return false;
Expand Down
2 changes: 1 addition & 1 deletion setup/wizardsteps/WizStepModulesChoice.php
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ protected function DisplayStep($oPage)
$oPage->warning($this->oMissingDependencyException->getHtmlDesc(), $this->oMissingDependencyException->getMessage());
}

$this->bUpgrade = ($this->oWizard->GetParameter('install_mode') != 'install');
$this->bUpgrade = ($this->oWizard->GetParameter('mode') != 'install');
$aStepInfo = $this->GetStepInfo();
$oPage->add_style("div.choice { margin: 0.5em;}");
$oPage->add_style("div.choice a { text-decoration:none; font-weight: bold; color: #1C94C4 }");
Expand Down
11 changes: 8 additions & 3 deletions setup/wizardsteps/WizStepSummary.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ public function GetTitle()
if ($sMode == 'install') {
return 'Ready to install';

} else {
return 'Ready to upgrade';
}

return 'Ready to upgrade';
}

public function GetPossibleSteps()
Expand All @@ -50,7 +50,12 @@ public function CanAccessToWizardStep()
*/
public function GetNextButtonLabel()
{
return 'Install';
$sMode = $this->oWizard->GetParameter('mode', 'install');
if ($sMode == 'install') {
return 'Install';
}

return 'Upgrade';
}

public function CanMoveForward()
Expand Down
6 changes: 3 additions & 3 deletions setup/wizardsteps/WizStepWelcome.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function GetPossibleSteps()

public function UpdateWizardStateAndGetNextStep($bMoveForward = true): WizardState
{
if ($this->oWizard->GetParameter('install_mode', 'install') === 'install') {
if ($this->oWizard->GetParameter('mode', 'install') === 'install') {

return new WizardState(WizStepLicense::class);
}
Expand All @@ -70,7 +70,7 @@ public function Display(SetupPage $oPage): void

$aPreviousInstance = SetupUtils::GetPreviousInstance(APPROOT);
if ($aPreviousInstance['found']) {
$this->oWizard->SetParameter('install_mode', 'upgrade');
$this->oWizard->SetParameter('mode', 'upgrade');
$this->oWizard->SetParameter('db_server', $aPreviousInstance['db_server']);
$this->oWizard->SetParameter('db_user', $aPreviousInstance['db_user']);
$this->oWizard->SetParameter('db_pwd', $aPreviousInstance['db_pwd']);
Expand All @@ -80,7 +80,7 @@ public function Display(SetupPage $oPage): void
$this->oWizard->SetParameter('db_tls_ca', $aPreviousInstance['db_tls_ca'] ?? '');
$this->oWizard->SetParameter('graphviz_path', $aPreviousInstance['graphviz_path']);
} else {
$this->oWizard->SetParameter('install_mode', 'install');
$this->oWizard->SetParameter('mode', 'install');
$sFullSourceDir = SetupUtils::GetLatestDataModelDir();
$this->oWizard->SetParameter('source_dir', $sFullSourceDir);
$this->oWizard->SetParameter('datamodel_version', SetupUtils::GetDataModelVersion($sFullSourceDir));
Expand Down
41 changes: 23 additions & 18 deletions setup/wizardsteps/WizardStep.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,27 @@
/**
* All the steps of the iTop installation wizard
*
* Steps order (can be retrieved using \WizardController::DumpStructure) :
* Steps order:
*
* WizStepWelcome
* (install) (upgrade)
* + +
* | |
* v +----->
* WizStepLicense WizStepDetectedInfo
* WizStepDBParams + +
* WizStepAdminAccount | |
* WizStepInstallMiscParams v +------>
* + WizStepLicense2 +--> WizStepUpgradeMiscParams
* | +
* +---> <-----------------------------------+
* WizStepModulesChoice
* WizStepSummary
* WizStepDone
* v +----------> WizStepDetectedInfo
* WizStepLicense + +
* WizStepDBParams | |
* WizStepAdminAccount | |
* WizStepInstallMiscParams v +------->
* + WizStepLicense2 +-----------> WizStepUpgradeMiscParams
* | +
* | |
* +----+---------------------------------------------+
* |
* v +--- [Extension management]
* WizStepModulesChoice |
* WizStepDataAudit <----+ WizStepLandingBeforeAudit <---+--- [Hub Connector]
* WizStepSummary |
* WizStepDone +--- [Other Connector]
*/

use Combodo\iTop\Application\WebPage\WebPage;
Expand Down Expand Up @@ -226,15 +231,15 @@ public function GetPossibleSteps()
public function ProcessParams($bMoveForward = true)
{
$sNextStep = '';
$sInstallMode = utils::ReadParam('install_mode');
$sInstallMode = utils::ReadParam('mode');
if ($sInstallMode == 'install')
{
$this->oWizard->SetParameter('install_mode', 'install');
$this->oWizard->SetParameter('mode', 'install');
$sNextStep = Step2::class;
}
else
{
$this->oWizard->SetParameter('install_mode', 'upgrade');
$this->oWizard->SetParameter('mode', 'upgrade');
$sNextStep = Step2bis::class;

}
Expand All @@ -244,11 +249,11 @@ public function ProcessParams($bMoveForward = true)
public function Display(WebPage $oPage)
{
$oPage->p('This is Step 1!');
$sInstallMode = $this->oWizard->GetParameter('install_mode', 'install');
$sInstallMode = $this->oWizard->GetParameter('mode', 'install');
$sChecked = ($sInstallMode == 'install') ? ' checked ' : '';
$oPage->p('<input type="radio" name="install_mode" value="install"'.$sChecked.'/> Install');
$oPage->p('<input type="radio" name="mode" value="install"'.$sChecked.'/> Install');
$sChecked = ($sInstallMode == 'upgrade') ? ' checked ' : '';
$oPage->p('<input type="radio" name="install_mode" value="upgrade"'.$sChecked.'/> Upgrade');
$oPage->p('<input type="radio" name="mode" value="upgrade"'.$sChecked.'/> Upgrade');
}
}

Expand Down