CheckDependencies()) {
return true;
} else {
return false;
}
}
/**
* Tells whether this step/state allows to go back or not
* @return boolean True if the '<< Back' button should be displayed
*/
public function CanMoveBackward()
{
return false;
}
public function UpdateWizardStateAndGetNextStep($bMoveForward = true): WizardState
{
return new WizardState(WizStepSummary::class);
}
public function Display(SetupPage $oPage): void
{
$aInstallParams = $this->BuildConfig();
$this->AddProgressBar($oPage, 'Progress of the verification');
$sJSONData = json_encode($aInstallParams);
$oPage->add('');
$sAuthentToken = $this->oWizard->GetParameter('authent', '');
$oPage->add('');
if (!$this->CheckDependencies()) {
$oPage->error($this->sDependencyIssue);
$oPage->add_ready_script(<<add_ready_script(<< '[]',
'selected_extensions' => '[]',
'display_choices' => '[]',
'added_extensions' => '[]',
'removed_extensions' => '[]',
'extensions_not_uninstallable' => '[]',
'copy_setup_files' => 1,
'return_button_label' => '',
];
$aHiddenInputs = '';
foreach ($aParams as $sParamName => $defaultValue) {
$sElements = utils::HtmlEntities($this->oWizard->GetParameter($sParamName, $defaultValue));
$sParamName = utils::HtmlEntities($sParamName);
$aHiddenInputs .= <<
INPUT;
}
$sUID = Session::Get('setup_token');
$oPage->add(
<<
$aHiddenInputs
HTML
);
$sButtonLabel = $this->oWizard->GetParameter('return_button_label', '');
if ($sButtonLabel !== '') {
$sButtonLabel = utils::HtmlEntities($sButtonLabel);
$sButtonUrl = utils::GetAbsoluteUrlModulePage('itsm-designer-connector', 'launch.php');
$sButtonUrl = utils::HtmlEntities($sButtonUrl);
$oPage->add_ready_script(
<<');
JS
);
}
}
protected function AddProgressErrorScript($oPage, $aRes)
{
$oPage->add_ready_script(
<< 0) {
$('#return-button').removeClass('ibo-is-hidden');
}
JS
);
if (isset($aRes['error_code']) && $aRes['error_code'] === DataAuditSequencer::DATA_AUDIT_FAILED) {
$oPage->add_ready_script(
<<');
$('#ignore_and_continue').on('click', function() {
return confirm("If you skip the cleanup you won't be able to run the process later. You'll have to migrate or delete unconsistent data manually.");
});
$('.ibo-setup--wizard--buttons-container tr td:nth-child(3)').after('| | ');
$('#goto-data-feature-removal').on("click", function() {
$('#goto-data-feature-removal').prop('disabled', true);
$('#submit-wait').removeClass("ibo-is-hidden");
$('#data-feature-removal').submit();
});
$("#wiz_form").data("installation_status", "cleanup_needed");
$('#btn_next').hide();
JS
);
}
}
public function JSCanMoveForward()
{
return 'return ["completed", "cleanup_needed"].indexOf($("#wiz_form").data("installation_status")) !== -1;';
}
public function JSCanMoveBackward()
{
if ($this->oWizard->GetParameter('return_button_label', '') !== '') {
return 'return false;';
}
return 'return ["not started", "error", "cleanup_needed"].indexOf($("#wiz_form").data("installation_status")) !== -1;';
}
}