diff --git a/setup/extensionsmap.class.inc.php b/setup/extensionsmap.class.inc.php index ca59ad63e3..440608f12e 100644 --- a/setup/extensionsmap.class.inc.php +++ b/setup/extensionsmap.class.inc.php @@ -61,24 +61,29 @@ class iTopExtension * @var bool */ public $bVisible; - + /** * @var string[] */ public $aModules; - + /** * @var string[] */ public $aModuleVersion; - + + /** + * @var string[] + */ + public $aModuleInfo; + /** * @var string */ public $sSourceDir; - + /** - * + * * @var string[] */ public $aMissingDependencies; @@ -96,6 +101,7 @@ class iTopExtension $this->sInstalledVersion = ''; $this->aModules = array(); $this->aModuleVersion = array(); + $this->aModuleInfo = array(); $this->sSourceDir = ''; $this->bVisible = true; $this->aMissingDependencies = array(); @@ -309,11 +315,11 @@ class iTopExtensionsMap $sModuleVersion = '0.0.1'; } - if (($sParentExtensionId !== null) && (array_key_exists($sParentExtensionId, $this->aExtensions)) && ($this->aExtensions[$sParentExtensionId] instanceof iTopExtension)) - { + if (($sParentExtensionId !== null) && (array_key_exists($sParentExtensionId, $this->aExtensions)) && ($this->aExtensions[$sParentExtensionId] instanceof iTopExtension)) { // Already inside an extension, let's add this module the list of modules belonging to this extension $this->aExtensions[$sParentExtensionId]->aModules[] = $sModuleName; $this->aExtensions[$sParentExtensionId]->aModuleVersion[$sModuleName] = $sModuleVersion; + $this->aExtensions[$sParentExtensionId]->aModuleInfo[$sModuleName] = $aModuleInfo[2]; } else { @@ -328,8 +334,6 @@ class iTopExtensionsMap } // Let's create a "fake" extension from this module (containing just this module) for backwards compatibility - $sExtensionId = $sModuleId; - $oExtension = new iTopExtension(); $oExtension->sCode = $sModuleName; $oExtension->sLabel = $aModuleInfo[2]['label']; @@ -340,9 +344,10 @@ class iTopExtensionsMap $oExtension->sMoreInfoUrl = $aModuleInfo[2]['doc.more_information']; $oExtension->aModules = array($sModuleName); $oExtension->aModuleVersion[$sModuleName] = $sModuleVersion; + $oExtension->aModuleInfo[$sModuleName] = $aModuleInfo[2]; $oExtension->sSourceDir = $sSearchDir; $oExtension->bVisible = $bVisible; - $this->AddExtension($oExtension); + $this->AddExtension($oExtension); } closedir($hDir); diff --git a/setup/wizardsteps.class.inc.php b/setup/wizardsteps.class.inc.php index b11b19b321..0490c1ce6b 100644 --- a/setup/wizardsteps.class.inc.php +++ b/setup/wizardsteps.class.inc.php @@ -1674,10 +1674,12 @@ EOF /** * Converts the list of selected "choices" into a list of "modules": take into account the selected and the mandatory modules - * @param hash $aInfo Info about the "choice" array('options' => array(...), 'alternatives' => array(...)) - * @param hash $aSelectedChoices List of selected choices array('name' => 'selected_value_id') - * @param hash $aModules Return parameter: List of selected modules array('module_id' => true) + * + * @param array $aInfo Info about the "choice" array('options' => array(...), 'alternatives' => array(...)) + * @param array $aSelectedChoices List of selected choices array('name' => 'selected_value_id') + * @param array $aModules Return parameter: List of selected modules array('module_id' => true) * @param string $sParentId Used for recursion + * * @return string A text representation of what will be installed */ protected function GetSelectedModules($aInfo, $aSelectedChoices, &$aModules, $sParentId = '', $sDisplayChoices = '', &$aSelectedExtensions = null) @@ -1698,35 +1700,55 @@ EOF } } $aOptions = isset($aInfo['options']) ? $aInfo['options'] : array(); - foreach($aOptions as $index => $aChoice) - { + foreach($aOptions as $index => $aChoice) { $sChoiceId = $sParentId.self::$SEP.$index; - if ( (isset($aChoice['mandatory']) && $aChoice['mandatory']) || - (isset($aSelectedChoices[$sChoiceId]) && ($aSelectedChoices[$sChoiceId] == $sChoiceId)) ) - { + $aModuleInfo = []; + // Get the extension corresponding to the choice + foreach ($this->oExtensionsMap->GetAllExtensions() as $sExtensionVersion => $oExtension) { + if (utils::StartsWith($sExtensionVersion, $aChoice['extension_code'].'/')) { + $aModuleInfo = $oExtension->aModuleInfo; + break; + } + } + if ((isset($aChoice['mandatory']) && $aChoice['mandatory']) || + (isset($aSelectedChoices[$sChoiceId]) && ($aSelectedChoices[$sChoiceId] == $sChoiceId))) { $sDisplayChoices .= '