Ver Fonte

#564 Prompt for an update in a case log on a lifecycle transition. Can be retrofitted easily. Associated with commit [r3687]

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@3720 a333f486-631f-4898-b8df-5754b55c2be0
romainq há 9 anos atrás
pai
commit
53de32dfa4
1 ficheiros alterados com 15 adições e 2 exclusões
  1. 15 2
      application/cmdbabstract.class.inc.php

+ 15 - 2
application/cmdbabstract.class.inc.php

@@ -2398,14 +2398,27 @@ EOF
 		$iFieldIndex = 0;
 		$aFieldsMap = array();
 
+		// The list of candidate fields is made of the ordered list of "details" attributes + other attributes
+		$aAttributes = array();
+		foreach ($this->FlattenZList(MetaModel::GetZListItems($sClass, 'details')) as $sAttCode)
+		{
+			$aAttributes[$sAttCode] = true;
+		}		
+		foreach(MetaModel::GetAttributesList($sClass) as $sAttCode)
+		{
+			if (!array_key_exists($sAttCode, $aAttributes))
+			{
+				$aAttributes[$sAttCode] = true;
+			}
+		}
 		// Order the fields based on their dependencies, set the fields for which there is only one possible value
 		// and perform this in the order of dependencies to avoid dead-ends
 		$aDeps = array();
-		foreach(MetaModel::GetAttributesList($sClass) as $sAttCode)
+		foreach($aAttributes as $sAttCode => $trash)
 		{
 			$aDeps[$sAttCode] = MetaModel::GetPrequisiteAttributes($sClass, $sAttCode);
 		}
-		$aList =$this->OrderDependentFields($aDeps);
+		$aList = $this->OrderDependentFields($aDeps);
 
 		foreach($aList as $sAttCode)
 		{