浏览代码

#790 Only report as installed the modules from the previous installation, not all previous installations.

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@2914 a333f486-631f-4898-b8df-5754b55c2be0
dflaven 11 年之前
父节点
当前提交
395457f105
共有 1 个文件被更改,包括 19 次插入0 次删除
  1. 19 0
      setup/runtimeenv.class.inc.php

+ 19 - 0
setup/runtimeenv.class.inc.php

@@ -194,6 +194,20 @@ class RunTimeEnvironment
 		// Build the list of installed module (get the latest installation)
 		// Build the list of installed module (get the latest installation)
 		//
 		//
 		$aInstallByModule = array(); // array of <module> => array ('installed' => timestamp, 'version' => <version>)
 		$aInstallByModule = array(); // array of <module> => array ('installed' => timestamp, 'version' => <version>)
+		$iRootId = 0;
+		foreach ($aSelectInstall as $aInstall)
+		{
+			if (($aInstall['parent_id'] == 0) && ($aInstall['name'] != 'datamodel'))
+			{
+				// Root module, what is its ID ?
+				$iId = (int) $aInstall['id'];
+				if ($iId > $iRootId)
+				{
+					$iRootId = $iId;
+				}
+			}
+		}
+		
 		foreach ($aSelectInstall as $aInstall)
 		foreach ($aSelectInstall as $aInstall)
 		{
 		{
 			//$aInstall['comment']; // unsused
 			//$aInstall['comment']; // unsused
@@ -212,6 +226,11 @@ class RunTimeEnvironment
 			{
 			{
 				$sModuleName = ROOT_MODULE;
 				$sModuleName = ROOT_MODULE;
 			}
 			}
+			else if($aInstall['parent_id'] != $iRootId)
+			{
+				// Skip all modules belonging to previous installations
+				continue;
+			}
 	
 	
 			if (array_key_exists($sModuleName, $aInstallByModule))
 			if (array_key_exists($sModuleName, $aInstallByModule))
 			{
 			{