N°9169 - Enhance ITSM designer connector with return button functionality

This commit is contained in:
lenaick.moreira
2026-06-02 16:43:31 +02:00
parent 25d8631b88
commit 38c41abe72
5 changed files with 25 additions and 13 deletions

View File

@@ -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 = [];

View File

@@ -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 %}

View File

@@ -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;
<<<HTML
<form id="data-feature-removal" class="ibo-setup--wizard ibo-is-hidden" method="post" action="$sApplicationUrl">
<input type="hidden" name="operation" value="AnalysisResult"/>
<input type="hidden" name="setup_token" value="$sUID"/>
<input type="hidden" name="authent" value="$sUID"/>
$aHiddenInputs
</form>
HTML

View File

@@ -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

View File

@@ -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);
}