diff --git a/datamodels/2.x/combodo-data-feature-removal/src/Controller/DataFeatureRemovalController.php b/datamodels/2.x/combodo-data-feature-removal/src/Controller/DataFeatureRemovalController.php index 94eb6ab4f..6d1e3cb8f 100644 --- a/datamodels/2.x/combodo-data-feature-removal/src/Controller/DataFeatureRemovalController.php +++ b/datamodels/2.x/combodo-data-feature-removal/src/Controller/DataFeatureRemovalController.php @@ -26,6 +26,7 @@ use Dict; use Exception; use MetaModel; use RunTimeEnvironment; +use SecurityException; use SetupUtils; use utils; @@ -83,10 +84,11 @@ class DataFeatureRemovalController extends Controller { $aParams = []; - if (SetupUtils::IsSessionSetupTokenValid()) { + try { //from setup wizard/mtp + SetupUtils::CheckSetupToken(); SetupUtils::EraseSetupToken(); - } else { + } catch (SecurityException $e) { //from same module $this->ValidateTransactionId(); } @@ -100,6 +102,8 @@ class DataFeatureRemovalController extends Controller 'removed_extensions' => '[]', 'extensions_not_uninstallable' => '[]', 'copy_setup_files' => 1, + 'return_button_label' => '', + 'return_button_url' => '', ]; $aHiddenInputs = []; diff --git a/datamodels/2.x/combodo-data-feature-removal/templates/AnalysisResult.html.twig b/datamodels/2.x/combodo-data-feature-removal/templates/AnalysisResult.html.twig index 9d5bb1c64..ac52c86a0 100644 --- a/datamodels/2.x/combodo-data-feature-removal/templates/AnalysisResult.html.twig +++ b/datamodels/2.x/combodo-data-feature-removal/templates/AnalysisResult.html.twig @@ -87,11 +87,15 @@ {% endif %} {% endif %} - {% UIForm Standard {} %} - {% UIInput ForHidden { sName:'transaction_id', sValue:sTransactionId} %} - {% UIInput ForHidden { sName:'operation', sValue:'Main'} %} - {% UIToolbar ForButton {} %} - {% UIButton ForPrimaryAction {sLabel:'UI:Button:BackToMain'|dict_s, sName:'btn_back', sId:'btn_back', bIsSubmit:true} %} - {% EndUIToolbar %} - {% EndUIForm %} + {% if aHiddenInputs.return_button_label != '' %} + {% UIButton ForAlternativeSecondaryAction { sLabel:aHiddenInputs.return_button_label, OnClickJsCode: 'window.location.href="' ~ aHiddenInputs.return_button_url ~ '"'} %} + {% else %} + {% UIForm Standard {} %} + {% UIInput ForHidden { sName:'transaction_id', sValue:sTransactionId} %} + {% UIInput ForHidden { sName:'operation', sValue:'Main'} %} + {% UIToolbar ForButton {} %} + {% UIButton ForPrimaryAction {sLabel:'UI:Button:BackToMain'|dict_s, sName:'btn_back', sId:'btn_back', bIsSubmit:true} %} + {% EndUIToolbar %} + {% EndUIForm %} + {% endif %} {% EndUIPanel %} diff --git a/setup/wizardsteps/WizStepDataAudit.php b/setup/wizardsteps/WizStepDataAudit.php index 33f07764b..67fb6fadf 100644 --- a/setup/wizardsteps/WizStepDataAudit.php +++ b/setup/wizardsteps/WizStepDataAudit.php @@ -112,6 +112,8 @@ JS); 'removed_extensions' => '[]', 'extensions_not_uninstallable' => '[]', 'copy_setup_files' => 1, + 'return_button_label' => '', + 'return_button_url' => '', ]; $aHiddenInputs = ''; foreach ($aParams as $sParamName => $defaultValue) { @@ -127,7 +129,7 @@ INPUT; << - + $aHiddenInputs HTML diff --git a/setup/wizardsteps/WizStepDone.php b/setup/wizardsteps/WizStepDone.php index 2cde077c2..843ead687 100644 --- a/setup/wizardsteps/WizStepDone.php +++ b/setup/wizardsteps/WizStepDone.php @@ -144,6 +144,11 @@ class WizStepDone extends WizardStep return false; } + public function JSCanMoveBackward() + { + return 'return false;'; + } + /** * Tells whether this step of the wizard requires that the configuration file be writable * @return bool True if the wizard will possibly need to modify the configuration at some point diff --git a/setup/wizardsteps/WizStepLandingBeforeAudit.php b/setup/wizardsteps/WizStepLandingBeforeAudit.php index 14de33e1e..d4bb4aa10 100644 --- a/setup/wizardsteps/WizStepLandingBeforeAudit.php +++ b/setup/wizardsteps/WizStepLandingBeforeAudit.php @@ -24,9 +24,6 @@ class WizStepLandingBeforeAudit extends WizStepModulesChoice $oWizard->SaveParameter('use_symbolic_links', MFCompiler::UseSymbolicLinks()); $oWizard->SaveParameter('force-uninstall', ''); - $oWizard->SaveParameter('return_button_label', ''); - $oWizard->SaveParameter('return_button_url', ''); - // should be done at the end parent::__construct($oWizard, $sCurrentState, false); }