diff --git a/datamodels/2.x/combodo-data-feature-removal/dictionaries/en.dict.combodo-data-feature-removal.php b/datamodels/2.x/combodo-data-feature-removal/dictionaries/en.dict.combodo-data-feature-removal.php index 665af838b4..9b02bc1c8d 100644 --- a/datamodels/2.x/combodo-data-feature-removal/dictionaries/en.dict.combodo-data-feature-removal.php +++ b/datamodels/2.x/combodo-data-feature-removal/dictionaries/en.dict.combodo-data-feature-removal.php @@ -20,6 +20,7 @@ Dict::Add('EN US', 'English', 'English', [ 'DataFeatureRemoval:Features:Title' => 'Extensions', 'DataFeatureRemoval:Result:Title' => 'Modification requested', + 'DataFeatureRemoval:NoResult:Title' => 'No modification requested', 'DataFeatureRemoval:Execution:Title' => 'Deletion Executions', 'DataFeatureRemoval:Analysis:Title' => 'Analysis result', 'DataFeatureRemoval:Analysis:Subtitle' => 'Review all elements requiring attention', diff --git a/datamodels/2.x/combodo-data-feature-removal/dictionaries/fr.dict.combodo-data-feature-removal.php b/datamodels/2.x/combodo-data-feature-removal/dictionaries/fr.dict.combodo-data-feature-removal.php index eba10a30da..7c2c7863da 100644 --- a/datamodels/2.x/combodo-data-feature-removal/dictionaries/fr.dict.combodo-data-feature-removal.php +++ b/datamodels/2.x/combodo-data-feature-removal/dictionaries/fr.dict.combodo-data-feature-removal.php @@ -20,6 +20,7 @@ Dict::Add('FR FR', 'French', 'Français', [ 'DataFeatureRemoval:Features:Title' => 'Extensions', 'DataFeatureRemoval:Result:Title' => 'Modification demandée', + 'DataFeatureRemoval:NoResult:Title' => 'Aucune modification demandée', 'DataFeatureRemoval:Execution:Title' => 'Suppressions', 'DataFeatureRemoval:Analysis:Title' => 'Résultat de l’analyse', 'DataFeatureRemoval:Analysis:Subtitle' => 'Vérifier les éléments à nettoyer', 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 9c2b098d03..b533a430cd 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 @@ -47,7 +47,11 @@ class DataFeatureRemovalController extends Controller $aParams = []; SetupUtils::EraseSetupToken(); - (new SessionParameters(SetupUtils::SESSION_PARAMETERS_NAME))->Erase(); + $oParameters = new SessionParameters(SetupUtils::SESSION_PARAMETERS_NAME); + $oParameters->Erase(); + Session::Unset('aDeletionExecutionSummary'); + Session::Set('bForceCompilation', true); + $oParameters->SetParameter('return_application', 'DataFeatureRemoval'); $this->AddAnalyzeParams(); $aParams['sTransactionId'] = utils::GetNewTransactionId(); @@ -60,7 +64,6 @@ class DataFeatureRemovalController extends Controller $aParams['sSetupUrl'] = utils::GetAbsoluteUrlAppRoot().'setup'; $aParams['iCount'] = $this->iCount; - Session::Set('bForceCompilation', true); $this->AddLinkedStylesheet(utils::GetAbsoluteUrlModulesRoot().DataFeatureRemovalHelper::MODULE_NAME.'/assets/css/DataFeatureRemoval.css'); $this->AddLinkedScript(utils::GetAbsoluteUrlModulesRoot().DataFeatureRemovalHelper::MODULE_NAME.'/assets/js/DataFeatureRemoval.js'); $this->DisplayPage($aParams); @@ -94,7 +97,7 @@ class DataFeatureRemovalController extends Controller } // Display changed extensions - $aHiddenInputNames = [ + $aSetupParameterNames = [ 'selected_extensions' => '[]', 'selected_modules' => '[]', 'display_choices' => '', @@ -108,92 +111,35 @@ class DataFeatureRemovalController extends Controller 'target_env' => ITOP_DEFAULT_ENV, ]; - $aHiddenInputs = []; - foreach ($aHiddenInputNames as $sInputName => $defaultValue) { - $aHiddenInputs[$sInputName] = utils::ReadPostedParam($sInputName, $defaultValue, utils::ENUM_SANITIZATION_FILTER_RAW_DATA); + $oParameters = new SessionParameters(SetupUtils::SESSION_PARAMETERS_NAME); + foreach ($aSetupParameterNames as $sInputName => $defaultValue) { + $oParameters->SetParameter($sInputName, $oParameters->GetParameter($sInputName, $defaultValue)); } - $aParams['aHiddenInputs'] = $aHiddenInputs; - $aAddedExtensions = json_decode($aHiddenInputs['added_extensions'], true); - - $aRemovedExtensions = json_decode($aHiddenInputs['removed_extensions'], true); - if ("[]" === $aHiddenInputs['selected_modules']) { + $aAddedExtensions = json_decode($oParameters->GetParameter('added_extensions', '[]'), true); + $aRemovedExtensions = json_decode($oParameters->GetParameter('removed_extensions', '[]'), true); + if ('[]' === $oParameters->GetParameter('selected_modules', '[]')) { //it does not come from setup // we get extensions from 1st screen uiblocks $this->ReadExtensionsDiff(); - $aHiddenInputs['force-uninstall'] = $this->bForcedUninstallation ? 'on' : ''; + $oParameters->SetParameter('force-uninstall', $this->bForcedUninstallation ? 'on' : ''); $aAddedExtensions = $this->aExtensionsToCheck['to_be_installed']; - $aHiddenInputs['added_extensions'] = $this->ConvertIntoSetupFormat($aAddedExtensions); + $oParameters->SetParameter('added_extensions', $this->ConvertIntoSetupFormat($aAddedExtensions)); $aRemovedExtensions = $this->aExtensionsToCheck['to_be_removed']; - $aHiddenInputs['removed_extensions'] = $this->ConvertIntoSetupFormat($aRemovedExtensions); + $oParameters->SetParameter('removed_extensions', $this->ConvertIntoSetupFormat($aRemovedExtensions)); } - $aParams['aAddedExtensions'] = $aAddedExtensions; - $aParams['aRemovedExtensions'] = $aRemovedExtensions; - DataFeatureRemovalLog::Debug(__METHOD__.' Extensions given in parameter', null, [ 'added_extensions' => $aAddedExtensions, 'removed_extensions' => $aRemovedExtensions]); $aParams['sTransactionId'] = utils::GetNewTransactionId(); $aParams['iColumnCount'] = $this->iColumnCount; - $aParams['aAvailableExtensions'] = $this->SplitArrayIntoColumns($this->GetExtensionsDiff($aAddedExtensions, $aRemovedExtensions), $this->iColumnCount); - - //to make setup redirection work, we need to pass complex data structures to setup wizards (ie extension/module lists) - $sSourceEnv = MetaModel::GetEnvironment(); - $this->oRuntimeEnvironment = new RunTimeEnvironment($sSourceEnv, false); - - if ('[]' === $aHiddenInputs['selected_modules']) { - $oConfig = MetaModel::GetConfig(); - $aSelectedExtensions = DataFeatureRemoverExtensionService::GetInstance()->GetExtensionMap()->GetSelectedExtensions($oConfig, array_keys($aAddedExtensions), array_keys($aRemovedExtensions)); - $aHiddenInputs['selected_extensions'] = $this->ConvertIntoSetupFormat($aSelectedExtensions); - - $aSelectedModules = []; // keep it to compile method - } else { - $aSelectedExtensions = json_decode($aHiddenInputs['selected_extensions'], true); - $aSelectedModules = json_decode($aHiddenInputs['selected_modules'], true); - } - - try { - $this->Compile($aSelectedExtensions, array_keys($aRemovedExtensions), $aSelectedModules); - $aHiddenInputs['selected_modules'] = $this->ConvertIntoSetupFormat($aSelectedModules); - } catch (CoreException $e) { - $aParams['DataFeatureRemovalErrorMessage'] = $e->getHtmlDesc(); - $this->DisplayPage($aParams, 'AnalysisResult'); - return; - } catch (Exception $e) { - $aParams['DataFeatureRemovalErrorMessage'] = $e->getMessage(); - $this->DisplayPage($aParams, 'AnalysisResult'); - return; - } - - $oSetupAudit = new SetupAudit($sSourceEnv); - $aGetRemovedClasses = array_keys($oSetupAudit->RunDataAudit()); - DataFeatureRemovalLog::Debug(__METHOD__, null, ['aGetRemovedClasses' => $aGetRemovedClasses]); - - $aParams['aClasses'] = $aGetRemovedClasses; - - new ContextTag(ContextTag::TAG_SETUP); - $aParams['sLaunchSetupUrl'] = utils::GetAbsoluteUrlAppRoot().'setup/wizard.php'; - $aParams['aSetupParams'] = [ - "_class" => "WizStepLandingBeforeAudit", - "operation" => "next", - ]; - - foreach ($aHiddenInputs as $sInputName => $sInputValue) { - $aParams['aSetupParams'][$sInputName] = $sInputValue; - } - - [$aParams['aDeletionPlanSummary'], $aParams['iQueryCount'], $aParams['bDeletionPossible']] = $this->GetDeletionPlanSummaryTable($aGetRemovedClasses); - [$aParams['aDeletionExecutionSummary'], $aParams['bHasDeletionExecution']] = $this->GetExecutionSummaryTable(); - $aParams['bDeletionNeeded'] = ($aParams['iQueryCount'] > 0); - Session::Set('aDeletionExecutionSummary', serialize($this->aDeletionExecutionSummary)); - - if (!$aParams['bDeletionNeeded']) { - // Erase session setup parameters - SetupUtils::CreateSetupToken(); - } + $aAvailableExtensions = $this->GetExtensionsDiff($aAddedExtensions, $aRemovedExtensions); + $aParams['aAvailableExtensionsCount'] = count($aAvailableExtensions); + $aParams['aAvailableExtensions'] = $this->SplitArrayIntoColumns($aAvailableExtensions, $this->iColumnCount); + $aParams['sAjaxURL'] = utils::GetAbsoluteUrlModulePage(DataFeatureRemovalHelper::MODULE_NAME, 'index.php'); $this->DisplayPage($aParams, 'AnalysisResult'); } @@ -201,55 +147,119 @@ class DataFeatureRemovalController extends Controller private function ConvertIntoSetupFormat(array $aData): string { $aNewData = []; - foreach ($aData as $k => $sVal) { - $aNewData[] = sprintf('"%s":"%s"', $k, $sVal); + foreach ($aData as $sCode => $sLabel) { + $aNewData[] = sprintf('"%s":"%s"', $sCode, $sLabel); } return "{".implode(',', $aNewData)."}"; } /** - * @param array $aSelectedExtensions - * @param array $aRemovedExtensions - * @param array $aSelectedModules - * * @return void * @throws \ConfigException * @throws \CoreException */ - private function Compile(array $aSelectedExtensions, array $aRemovedExtensions, array &$aSelectedModules): void + public function OperationAjaxCompile(): void { + $aParams = []; + //to make setup redirection work, we need to pass complex data structures to setup wizards (ie extension/module lists) $sSourceEnv = MetaModel::GetEnvironment(); - $sBuildDir = APPROOT."/env-$sSourceEnv-build"; - if (! is_dir($sBuildDir)) { - SetupUtils::builddir($sBuildDir); - } - $bIsDirEmpty = count(scandir($sBuildDir)) === 2; - $bForceCompilation = Session::Get('bForceCompilation', false); + $oRuntimeEnvironment = new RunTimeEnvironment($sSourceEnv, false); - $oConfig = MetaModel::GetConfig(); - if ($bIsDirEmpty || $bForceCompilation) { - Session::Unset('bForceCompilation'); - $this->oRuntimeEnvironment->CopySetupFiles(); + $oParameters = new SessionParameters(SetupUtils::SESSION_PARAMETERS_NAME); + $aSelectedModules = json_decode($oParameters->GetParameter('selected_modules', '[]'), true); + $aSelectedExtensions = json_decode($oParameters->GetParameter('selected_extensions', '[]'), true); + $aAddedExtensions = json_decode($oParameters->GetParameter('added_extensions', '[]'), true); + $aRemovedExtensions = json_decode($oParameters->GetParameter('removed_extensions', '[]'), true); + + try { + $oConfig = MetaModel::GetConfig(); if (count($aSelectedModules) === 0) { - $aSelectedModules = $this->oRuntimeEnvironment->GetModulesToLoadFromChoices($oConfig, $aSelectedExtensions); + $aSelectedExtensions = DataFeatureRemoverExtensionService::GetInstance()->GetExtensionMap()->GetSelectedExtensions($oConfig, array_keys($aAddedExtensions), array_keys($aRemovedExtensions)); + $oParameters->SetParameter('selected_extensions', $this->ConvertIntoSetupFormat($aSelectedExtensions)); } - DataFeatureRemovalLog::Debug( - __METHOD__, - null, - ['sSourceEnv' => $sSourceEnv, 'sBuildDir' => $sBuildDir, 'bIsDirEmpty' => $bIsDirEmpty, glob("$sBuildDir/*")] - ); - $this->oRuntimeEnvironment->DoCompile($aSelectedExtensions, $aRemovedExtensions, $aSelectedModules, MFCompiler::CanUseSymbolicLinks()); - } else { - if (count($aSelectedModules) === 0) { - $aSelectedModules = $this->oRuntimeEnvironment->GetModulesToLoadFromChoices($oConfig, $aSelectedExtensions); + + $sBuildDir = APPROOT."/env-$sSourceEnv-build"; + if (! is_dir($sBuildDir)) { + SetupUtils::builddir($sBuildDir); } + $bIsDirEmpty = count(scandir($sBuildDir)) === 2; + $bForceCompilation = Session::Get('bForceCompilation', false); + if ($bIsDirEmpty || $bForceCompilation) { + Session::Unset('bForceCompilation'); + $oRuntimeEnvironment->CopySetupFiles(); + if (count($aSelectedModules) === 0) { + $aSelectedModules = $oRuntimeEnvironment->GetModulesToLoadFromChoices($oConfig, $aSelectedExtensions); + } + + DataFeatureRemovalLog::Debug( + __METHOD__, + null, + ['sSourceEnv' => $sSourceEnv, 'sBuildDir' => $sBuildDir, 'bIsDirEmpty' => $bIsDirEmpty, glob("$sBuildDir/*")] + ); + $oRuntimeEnvironment->DoCompile($aSelectedExtensions, $aRemovedExtensions, $aSelectedModules, MFCompiler::CanUseSymbolicLinks()); + } else { + if (count($aSelectedModules) === 0) { + $aSelectedModules = $oRuntimeEnvironment->GetModulesToLoadFromChoices($oConfig, $aSelectedExtensions); + } + } + } catch (CoreException $e) { + $aParams['error_message'] = $e->getHtmlDesc(); + } catch (Exception $e) { + $aParams['error_message'] = $e->getMessage(); } + + $aParams['success_message'] = Dict::S('DataFeatureRemoval:Compile:Success'); + + $oParameters->SetParameter('selected_modules', json_encode($aSelectedModules)); + $this->DisplayJSONPage($aParams); + } + + public function OperationAjaxRunAudit(): void + { + $oParameters = new SessionParameters(SetupUtils::SESSION_PARAMETERS_NAME); + $aParams = []; + $aPageParams = []; + try { + $sSourceEnv = MetaModel::GetEnvironment(); + $oSetupAudit = new SetupAudit($sSourceEnv); + $aRemovedClasses = array_keys($oSetupAudit->RunDataAudit()); + $oParameters->SetParameter('classes', $aRemovedClasses); + + new ContextTag(ContextTag::TAG_SETUP); + $aPageParams['sLaunchSetupUrl'] = utils::GetAbsoluteUrlAppRoot().'setup/wizard.php'; + $aPageParams['aSetupParams'] = [ + "_class" => "WizStepLandingBeforeAudit", + "operation" => "next", + ]; + $aPageParams['sTransactionId'] = utils::GetNewTransactionId(); + + $aDeletionPlanSummaryEntities = $this->GetDeletionPlanSummaryEntities($aRemovedClasses); + [$aPageParams['aDeletionPlanSummary'], $aPageParams['iQueryCount'], $aPageParams['bDeletionPossible']] = $this->GetDeletionPlanSummaryTable($aDeletionPlanSummaryEntities); + [$aPageParams['aDeletionExecutionSummary'], $aPageParams['bHasDeletionExecution']] = $this->GetExecutionSummaryTable(); + $aPageParams['bDeletionNeeded'] = ($aPageParams['iQueryCount'] > 0); + + if (!$aPageParams['bDeletionNeeded']) { + // Erase session setup parameters + SetupUtils::CreateSetupToken(); + } + + $this->DisplayAjaxPage($aPageParams, 'AjaxRunAudit'); + return; + } catch (CoreException $e) { + $aParams['error_message'] = $e->getHtmlDesc(); + } catch (Exception $e) { + $aParams['error_message'] = $e->getMessage(); + } + + $this->DisplayJSONPage($aParams); } private function GetExecutionSummaryTable(): array { - $sName = 'ExcutionSummary'; + $sName = 'ExecutionSummary'; + + $this->aDeletionExecutionSummary = unserialize(Session::Get('aDeletionExecutionSummary') ?? serialize([])); $aTableData = []; if (count($this->aDeletionExecutionSummary) === 0) { @@ -275,11 +285,15 @@ class DataFeatureRemovalController extends Controller } - private function GetDeletionPlanSummaryTable(array $aRemovedClasses): array + private function GetDeletionPlanSummaryEntities(array $aRemovedClasses): array + { + $oDataCleanupService = new StaticDeletionPlan(); + return $oDataCleanupService->GetCleanupSummary($aRemovedClasses); + } + + private function GetDeletionPlanSummaryTable(array $aDeletionPlanSummaryEntities): array { $sName = 'DeletionPlanSummary'; - $oDataCleanupService = new StaticDeletionPlan(); - $aDeletionPlanSummaryEntities = $oDataCleanupService->GetCleanupSummary($aRemovedClasses); $aColumns = ['Class', 'Delete Count' , 'Update Count', 'Issue Count']; $aRows = []; $iQueryCount = 0; @@ -302,9 +316,10 @@ class DataFeatureRemovalController extends Controller { $this->ValidateTransactionId(); - $this->aDeletionExecutionSummary = unserialize(Session::Get('aDeletionExecutionSummary')); + $this->aDeletionExecutionSummary = unserialize(Session::Get('aDeletionExecutionSummary') ?? serialize([])); Session::Unset('aDeletionExecutionSummary'); - $aClasses = utils::ReadPostedParam('classes', null, utils::ENUM_SANITIZATION_FILTER_CLASS); + $oParameters = new SessionParameters(SetupUtils::SESSION_PARAMETERS_NAME); + $aClasses = $oParameters->GetParameter('classes', []); $oDataCleanupService = new DataCleanupService(); $aDeletionExecutionSummary = $oDataCleanupService->ExecuteCleanup($aClasses); @@ -319,6 +334,7 @@ class DataFeatureRemovalController extends Controller $oSummary->iTotalUpdateCount += $oExecutionSummary->iUpdateCount; } + Session::Set('aDeletionExecutionSummary', serialize($this->aDeletionExecutionSummary)); $this->OperationAnalysisResult(); } @@ -412,12 +428,11 @@ class DataFeatureRemovalController extends Controller /** * Read extensions selected from posted parameters - * @return int Number of extensions to be added or removed */ - public function ReadExtensionsDiff(): int + public function ReadExtensionsDiff(): void { if (!is_null($this->aExtensionsToCheck)) { - return count($this->aExtensionsToCheck['to_be_installed']) + count($this->aExtensionsToCheck['to_be_removed']); + return; } $aAvailableExtensions = $this->GetAvailableExtensions(); @@ -444,7 +459,6 @@ class DataFeatureRemovalController extends Controller $this->aExtensionsToCheck['to_be_installed'][$sCode] = $sLabel; } } - return count($this->aExtensionsToCheck['to_be_installed']) + count($this->aExtensionsToCheck['to_be_removed']); } /** 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 9d5bb1c64a..e7e9853ef7 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 @@ -1,15 +1,31 @@ {# @copyright Copyright (C) 2010-2026 Combodo SARL #} {# @license http://opensource.org/licenses/AGPL-3.0 #} - - {% UIPanel ForInformation { sTitle:'DataFeatureRemoval:Analysis:Title'|dict_s, sSubTitle: 'DataFeatureRemoval:Analysis:Subtitle'|dict_s} %} {% if null != DataFeatureRemovalErrorMessage %}
{% UIAlert ForFailure { sTitle:'DataFeatureRemoval:Failure:Title'|dict_s, sId: 'feature_removal_error_msg', sContent:DataFeatureRemovalErrorMessage } %} {% EndUIAlert %}
+ {% endif %} + {% UIAlert ForInformation { sTitle: '', sId: 'ajax_compile_in_progress_msg', AddCSSClasses: ['ibo-is-hidden', 'ibo-is-html-content'] } %} + {{ 'DataFeatureRemoval:Compile:InProgress'|dict_s }} + {% UISpinner Standard { } %} + {% EndUIAlert %} + {% UIAlert ForSuccess { sTitle:'success', sId: 'ajax_compile_success_msg', AddCSSClasses: ['ibo-is-hidden', 'ibo-is-html-content'] } %}{% EndUIAlert %} + {% UIAlert ForFailure { sTitle:'error', sId: 'ajax_compile_error_msg', AddCSSClasses: ['ibo-is-hidden', 'ibo-is-html-content'] } %}{% EndUIAlert %} + + {% UIAlert ForInformation { sTitle: '', sId: 'ajax_run_audit_in_progress_msg', AddCSSClasses: ['ibo-is-hidden', 'ibo-is-html-content'] } %} + {{ 'DataFeatureRemoval:RunAudit:InProgress'|dict_s }} + {% UISpinner Standard { } %} + {% EndUIAlert %} + {% UIAlert ForSuccess { sTitle:'DataFeatureRemoval:RunAudit:Success'|dict_s, sId: 'ajax_run_audit_success_msg', AddCSSClasses: ['ibo-is-hidden', 'ibo-is-html-content'] } %}{% EndUIAlert %} + {% UIAlert ForFailure { sTitle:'error', sId: 'ajax_run_audit_error_msg', AddCSSClasses: ['ibo-is-hidden', 'ibo-is-html-content'] } %}{% EndUIAlert %} + + {% if aAvailableExtensionsCount == 0 %} + {% UITitle Neutral { sTitle:'DataFeatureRemoval:NoResult:Title'|dict_s, iLevel:2 } %}{% EndUITitle %} + {% else %} {% UIPanel Neutral { sTitle:'DataFeatureRemoval:Result:Title'|dict_s, sSubTitle: '' } %} {% UIMultiColumn Standard {} %} {% for iColumnIndex in 0..iColumnCount-1 %} @@ -25,68 +41,10 @@ {% endfor %} {% EndUIMultiColumn %} {% EndUIPanel %} - {% else %} - {% UIPanel Neutral { sTitle:'DataFeatureRemoval:Result:Title'|dict_s, sSubTitle: '' } %} - {% UIMultiColumn Standard {} %} - {% for iColumnIndex in 0..iColumnCount-1 %} - {% UIColumn Standard {} %} - {% for aExtension in aAvailableExtensions[iColumnIndex] %} - {% if aExtension['installed'] %} - {% UIExtensionDetails Installed { sCode : aExtension['code'], sLabel : aExtension['label'], sDescription : aExtension['description'], aMetaData : [aExtension['version'], aExtension['source']], aExtraFlags : aExtension['extra_flags']} %}{% EndUIExtensionDetails %} - {% else %} - {% UIExtensionDetails NotInstalled { sCode : aExtension['code'], sLabel : aExtension['label'], sDescription : aExtension['description'], aMetaData : [aExtension['version'], aExtension['source']], aExtraFlags : aExtension['extra_flags']} %}{% EndUIExtensionDetails %} - {% endif %} - {% endfor %} - {% EndUIColumn %} - {% endfor %} - {% EndUIMultiColumn %} - {% EndUIPanel %} - - {% if bDeletionNeeded %} - {% UIFieldSet Standard {sLegend:'DataFeatureRemoval:DeletionPlan:Title'|dict_s} %} - {% UIDataTable ForForm { sRef:'aDeletionPlanSummary', aColumns:aDeletionPlanSummary.Columns, aData:aDeletionPlanSummary.Data} %}{% EndUIDataTable %} - {% EndUIFieldSet %} - {% if bDeletionPossible %} - {% UIForm Standard {} %} - {% UIInput ForHidden { sName:'transaction_id', sValue:sTransactionId} %} - {% UIInput ForHidden { sName:'operation', sValue:'DoDeletion'} %} - {% for sKey, sClass in aClasses %} - {% UIInput ForHidden { sName:"classes[" ~ sKey ~ "]", sValue:sClass } %} - {% endfor %} - {% for sCode, sLabel in aAddedExtensions %} - {% UIInput ForHidden { sName:"aAddedExtensions[" ~ sCode ~ "]", sValue:sLabel } %} - {% endfor %} - {% for sCode, sLabel in aRemovedExtensions %} - {% UIInput ForHidden { sName:"aRemovedExtensions[" ~ sCode ~ "]", sValue:sLabel } %} - {% endfor %} - {% for sInputName, sValue in aHiddenInputs %} - {% UIInput ForHidden { sName:sInputName, sValue:sValue } %} - {% endfor %} - {% UIToolbar ForButton {} %} - {% UIButton ForPrimaryAction {sLabel:'UI:Button:DoDeletion'|dict_s, sName:'btn_deletion', sId:'btn_deletion', bIsSubmit:true} %} - {% EndUIToolbar %} - {% EndUIForm %} - {% else %} - {% UIAlert ForFailure { sContent: 'DataFeatureRemoval:DeletionPlan:Error:Issues'|dict_s } %}{% EndUIAlert %} - {% endif %} - {% else %} - {% UIAlert ForSuccess { sTitle:'DataFeatureRemoval:CleanupComplete:Title'|dict_s, sContent:'DataFeatureRemoval:CompilComplete'|dict_s, sId:value } %}{% EndUIAlert %} - - {% UIForm Standard {'sId':'launch-setup-form', Action:sLaunchSetupUrl, 'EncType': 'application/x-www-form-urlencoded'} %} - {% for sKey, sValue in aSetupParams %} - {% UIInput ForHidden { sName:sKey, sValue:sValue } %} - {% endfor %} - {% UIButton ForPrimaryAction {sLabel:'UI:Button:Setup'|dict_s, sName:'btn_setup', sId:'btn_setup', bIsSubmit:true} %} - {% EndUIForm %} - {% endif %} - - {% if bHasDeletionExecution %} - {% UIFieldSet Standard {sLegend:'DataFeatureRemoval:Execution:Title'|dict_s} %} - {% UIDataTable ForForm { sRef:'aDeletionExecutionSummary', aColumns:aDeletionExecutionSummary.Columns, aData:aDeletionExecutionSummary.Data} %}{% EndUIDataTable %} - {% EndUIFieldSet %} - {% endif %} {% endif %} +
+ {% UIForm Standard {} %} {% UIInput ForHidden { sName:'transaction_id', sValue:sTransactionId} %} {% UIInput ForHidden { sName:'operation', sValue:'Main'} %} diff --git a/datamodels/2.x/combodo-data-feature-removal/templates/Features.html.twig b/datamodels/2.x/combodo-data-feature-removal/templates/Features.html.twig index 47c9598431..243ed6eb31 100644 --- a/datamodels/2.x/combodo-data-feature-removal/templates/Features.html.twig +++ b/datamodels/2.x/combodo-data-feature-removal/templates/Features.html.twig @@ -5,7 +5,7 @@ {% UIForm Standard {} %} {% UIInput ForHidden {sName:'operation', sValue:'AnalysisResult'} %} {% UIInput ForHidden {sName:'transaction_id', sValue:sTransactionId} %} - {% UIInput ForHidden {sName:'return_application', sValue:'itop'} %} + {% UIInput ForHidden {sName:'return_application', sValue:'DataFeatureRemoval'} %} {% UIPanel Neutral { sTitle:'DataFeatureRemoval:Features:Title'|dict_s, sSubTitle: '' } %} {% UIMultiColumn Standard {} %} diff --git a/setup/setuputils.class.inc.php b/setup/setuputils.class.inc.php index f26dd9db4f..e6abac18dc 100644 --- a/setup/setuputils.class.inc.php +++ b/setup/setuputils.class.inc.php @@ -2226,7 +2226,7 @@ JS $sButtonLabel = ''; if ($sReturnApplication !== '') { switch ($sReturnApplication) { - case 'itop': + case 'DataFeatureRemoval': $sButtonUrl = utils::GetAbsoluteUrlModulePage('combodo-data-feature-removal', 'index.php'); $sButtonLabel = 'Back to application'; break; diff --git a/setup/wizardsteps/WizStepLandingBeforeAudit.php b/setup/wizardsteps/WizStepLandingBeforeAudit.php index 27dab3b777..3a83a65889 100644 --- a/setup/wizardsteps/WizStepLandingBeforeAudit.php +++ b/setup/wizardsteps/WizStepLandingBeforeAudit.php @@ -33,8 +33,6 @@ class WizStepLandingBeforeAudit extends WizStepModulesChoice $oWizard->SetParameter('display_choices', ''); $oWizard->SetParameter('extensions_not_uninstallable', '[]'); - $oWizard->SaveParameter('use_symbolic_links', MFCompiler::UseSymbolicLinks()); - $oWizard->SaveParameter('force-uninstall', false); $oWizard->SaveParameter('skip_wizard', false); // should be done at the end @@ -64,16 +62,7 @@ class WizStepLandingBeforeAudit extends WizStepModulesChoice $adModulesFromDatabase = ModuleInstallationRepository::GetInstance()->ReadComputeInstalledModules($oConfig); $this->oWizard->SetParameter('selected_modules', json_encode(array_keys($adModulesFromDatabase))); } else { - $this->oWizard->SavePostedParameter('selected_modules'); - $this->oWizard->SavePostedParameter('selected_extensions'); - $this->oWizard->SavePostedParameter('added_extensions'); - $this->oWizard->SavePostedParameter('removed_extensions'); - $this->oWizard->SavePostedParameter('extensions_not_uninstallable'); $this->oWizard->SavePostedParameter('copy_setup_files', '1'); - $this->oWizard->SavePostedParameter('force-uninstall'); - $this->oWizard->SavePostedParameter('use_symbolic_links'); - $this->oWizard->SavePostedParameter('return_application'); - $this->oWizard->SavePostedParameter('target_env'); } $aWizardSteps = $this->oWizard->GetParameter('_steps', null); diff --git a/sources/Service/Session/SessionParameters.php b/sources/Service/Session/SessionParameters.php index ff0e77e94e..55257a7665 100644 --- a/sources/Service/Session/SessionParameters.php +++ b/sources/Service/Session/SessionParameters.php @@ -45,8 +45,10 @@ class SessionParameters */ public function SetParameter($sParamCode, $value): void { - $this->aParameters[$sParamCode] = $value; - $this->Save(); + if (!isset($this->aParameters[$sParamCode]) || $this->aParameters[$sParamCode] !== $value) { + $this->aParameters[$sParamCode] = $value; + $this->Save(); + } } /**