mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 02:28:44 +02:00
cannot write itop conf error durring setup wizard: add preventive check when empty dependencies
This commit is contained in:
@@ -741,42 +741,40 @@ class RunTimeEnvironment
|
|||||||
//
|
//
|
||||||
$aAvailableExtensions = array();
|
$aAvailableExtensions = array();
|
||||||
$aAvailableModules = $this->AnalyzeInstallation($oConfig, $this->GetBuildDir());
|
$aAvailableModules = $this->AnalyzeInstallation($oConfig, $this->GetBuildDir());
|
||||||
foreach($aSelectedModuleCodes as $sModuleId)
|
if (!empty($aSelectedModuleCodes)) {
|
||||||
{
|
foreach ($aSelectedModuleCodes as $sModuleId) {
|
||||||
$aModuleData = $aAvailableModules[$sModuleId];
|
$aModuleData = $aAvailableModules[$sModuleId];
|
||||||
$sName = $sModuleId;
|
$sName = $sModuleId;
|
||||||
$sVersion = $aModuleData['version_code'];
|
$sVersion = $aModuleData['version_code'];
|
||||||
$aComments = array();
|
$aComments = array();
|
||||||
$aComments[] = $sShortComment;
|
$aComments[] = $sShortComment;
|
||||||
if ($aModuleData['mandatory'])
|
if ($aModuleData['mandatory']) {
|
||||||
{
|
$aComments[] = 'Mandatory';
|
||||||
$aComments[] = 'Mandatory';
|
} else {
|
||||||
|
$aComments[] = 'Optional';
|
||||||
|
}
|
||||||
|
if ($aModuleData['visible']) {
|
||||||
|
$aComments[] = 'Visible (during the setup)';
|
||||||
|
} else {
|
||||||
|
$aComments[] = 'Hidden (selected automatically)';
|
||||||
|
}
|
||||||
|
|
||||||
|
$aDependencies = $aModuleData['dependencies'];
|
||||||
|
if (!empty($aDependencies)) {
|
||||||
|
foreach ($aDependencies as $sDependOn) {
|
||||||
|
$aComments[] = "Depends on module: $sDependOn";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$sComment = implode("\n", $aComments);
|
||||||
|
|
||||||
|
$oInstallRec = new ModuleInstallation();
|
||||||
|
$oInstallRec->Set('name', $sName);
|
||||||
|
$oInstallRec->Set('version', $sVersion);
|
||||||
|
$oInstallRec->Set('comment', $sComment);
|
||||||
|
$oInstallRec->Set('parent_id', $iMainItopRecord);
|
||||||
|
$oInstallRec->Set('installed', $iInstallationTime);
|
||||||
|
$oInstallRec->DBInsertNoReload();
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
$aComments[] = 'Optional';
|
|
||||||
}
|
|
||||||
if ($aModuleData['visible'])
|
|
||||||
{
|
|
||||||
$aComments[] = 'Visible (during the setup)';
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$aComments[] = 'Hidden (selected automatically)';
|
|
||||||
}
|
|
||||||
foreach ($aModuleData['dependencies'] as $sDependOn)
|
|
||||||
{
|
|
||||||
$aComments[] = "Depends on module: $sDependOn";
|
|
||||||
}
|
|
||||||
$sComment = implode("\n", $aComments);
|
|
||||||
|
|
||||||
$oInstallRec = new ModuleInstallation();
|
|
||||||
$oInstallRec->Set('name', $sName);
|
|
||||||
$oInstallRec->Set('version', $sVersion);
|
|
||||||
$oInstallRec->Set('comment', $sComment);
|
|
||||||
$oInstallRec->Set('parent_id', $iMainItopRecord);
|
|
||||||
$oInstallRec->Set('installed', $iInstallationTime);
|
|
||||||
$oInstallRec->DBInsertNoReload();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->oExtensionsMap)
|
if ($this->oExtensionsMap)
|
||||||
|
|||||||
Reference in New Issue
Block a user