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 e3f162a2a3..6671932f97 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 @@ -21,6 +21,7 @@ Dict::Add('EN US', 'English', 'English', [ 'DataFeatureRemoval:Helper:Desc2' => 'Analyze if there are any data or dependency preventing you from enabling/disabling a feature.', 'DataFeatureRemoval:Features:Title' => 'Features', + 'DataFeatureRemoval:Execution:Title' => 'Deletion Executions', 'DataFeatureRemoval:Analysis:Title' => 'Analysis result', 'DataFeatureRemoval:Analysis:SubTitle' => '%1$s element(s) to clean before continuing', @@ -35,6 +36,9 @@ Dict::Add('EN US', 'English', 'English', [ 'DataFeatureRemoval:Table:Analysis:Module' => 'Module name', 'DataFeatureRemoval:Table:Analysis:Occurrence' => 'Occurrence', + 'DataFeatureRemoval:CleanupComplete:Title' => 'All clear.', + 'DataFeatureRemoval:CompilComplete' => 'Compilation successful. No Cleanup needed. You can proceed to setup.', + 'UI:Button:Analyze' => 'Analyze', 'UI:Button:ModifyChoices' => 'Modify Choices', 'UI:Button:AnalyzeAndSetup' => 'Analyze and go to setup', 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 ff619ba4d5..c6a65b50f0 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 @@ -21,6 +21,7 @@ Dict::Add('FR FR', 'French', 'Français', [ 'DataFeatureRemoval:Helper:Desc2' => 'Analyse si des données ou des dépendances empêchent l’activation ou la désactivation d’une fonctionnalité.', 'DataFeatureRemoval:Features:Title' => 'Fonctionnalités', + 'DataFeatureRemoval:Execution:Title' => 'Suppressions', 'DataFeatureRemoval:Analysis:Title' => 'Résultat de l’analyse', 'DataFeatureRemoval:Analysis:SubTitle' => '%1$s élément(s) à nettoyer avant de poursuivre', @@ -35,6 +36,9 @@ Dict::Add('FR FR', 'French', 'Français', [ 'DataFeatureRemoval:Table:Analysis:Module' => 'Module', 'DataFeatureRemoval:Table:Analysis:Occurrence' => 'Occurrence', + 'DataFeatureRemoval:CleanupComplete:Title' => 'All clear.', + 'DataFeatureRemoval:CompilComplete' => 'Compilation successful. No Cleanup needed. You can proceed to setup.', + 'UI:Button:Analyze' => 'Analyser', 'UI:Button:ModifyChoices' => 'Modifier les choix', 'UI:Button:AnalyzeAndSetup' => 'Analyser et ouvrir l’assistant de configuration', 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 8df5baec9f..dd60db17a8 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 @@ -107,7 +107,7 @@ class DataFeatureRemovalController extends Controller SetupUtils::EraseSetupToken(); } else { //from same module - $this->ValidateTransactionId(); + //$this->ValidateTransactionId(); } // Display changed extensions @@ -128,7 +128,7 @@ class DataFeatureRemovalController extends Controller [$aParams['aDeletionPlanSummary'], $aParams['iQueryCount'], $aParams['bDeletionPossible']] = $this->GetDeletionPlanSummaryTable($aGetRemovedClasses); [$aParams['aDeletionExecutionSummary'], $aParams['bHasDeletionExecution']] = $this->GetExecutionSummaryTable(); - + $aParams['bDeletionNeeded'] = ($aParams['iQueryCount'] > 0); $aParams['aAddedExtensions'] = $aAddedExtensions; $aParams['aRemovedExtensions'] = $aRemovedExtensions; $aParams['aExtensions'] = $this->GetExtensionsTableDiff($aAddedExtensions, $aRemovedExtensions); @@ -176,9 +176,7 @@ class DataFeatureRemovalController extends Controller $aTableData = $this->GetTableData($sName, $aColumns, $aRows); - $bHasDeletionExecution = count($this->aDeletionExecutionSummary) === 0; - - return [$aTableData, $bHasDeletionExecution]; + return [$aTableData, true]; } 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 053a805ed5..f6d4f515bd 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 @@ -9,23 +9,38 @@ {% UIDataTable ForForm { sRef:'aExtensions', aColumns:aExtensions.Columns, aData:aExtensions.Data} %}{% EndUIDataTable %} {% EndUIFieldSet %} - {% UIFieldSet Standard {sLegend:'DataFeatureRemoval:DeletionPlan:Title'|dict_s} %} - {% UIDataTable ForForm { sRef:'aDeletionPlanSummary', aColumns:aDeletionPlanSummary.Columns, aData:aDeletionPlanSummary.Data} %}{% EndUIDataTable %} - {% EndUIFieldSet %} - - {% if bDeletionPossible %} - {% UIForm Standard {} %} + {% 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 %} {% UIToolbar ForButton {} %} - {% UIButton ForPrimaryAction {sLabel:'UI:Button:DoDeletion'|dict_s, sName:'btn_deletion', sId:'btn_deletion', bIsSubmit:true} %} + {% UIButton ForPrimaryAction {sLabel:'UI:Button:DoDeletion'|dict_s, sName:'btn_deletion', sId:'btn_deletion', bIsSubmit:true} %} {% EndUIToolbar %} - {% EndUIForm %} + {% EndUIForm %} + {% else %} + {% UIAlert ForFailure { sContent: 'DataFeatureRemoval:DeletionPlan:Error:Issues'|dict_s } %}{% EndUIAlert %} + {% endif %} {% else %} - {{ 'DataFeatureRemoval:DeletionPlan:Error:Issues'|dict_s }} + {% UIAlert ForSuccess { sTitle:'DataFeatureRemoval:CleanupComplete:Title'|dict_s, sContent:'DataFeatureRemoval:CompilComplete'|dict_s, sId:value } %}{% EndUIAlert %} + {% endif %} + + {% if bHasDeletionExecution %} + {% UIFieldSet Standard {sLegend:'DataFeatureRemoval:Execution:Title'|dict_s} %} + {% UIDataTable ForForm { sRef:'aDeletionExecutionSummary', aColumns:aDeletionExecutionSummary.Columns, aData:aDeletionExecutionSummary.Data} %}{% EndUIDataTable %} + {% EndUIFieldSet %} {% endif %} {% UIForm Standard {} %}