mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-19 00:28:47 +02:00
Added support for hierarchical ZLists when checking the data model consistency
SVN:trunk[1038]
This commit is contained in:
@@ -1371,6 +1371,23 @@ abstract class MetaModel
|
||||
}
|
||||
}
|
||||
|
||||
public static function FlattenZList($aList)
|
||||
{
|
||||
$aResult = array();
|
||||
foreach($aList as $value)
|
||||
{
|
||||
if (!is_array($value))
|
||||
{
|
||||
$aResult[] = $value;
|
||||
}
|
||||
else
|
||||
{
|
||||
$aResult = array_merge($aResult, self::FlattenZList($value));
|
||||
}
|
||||
}
|
||||
return $aResult;
|
||||
}
|
||||
|
||||
public static function Init_DefineState($sStateCode, $aStateDef)
|
||||
{
|
||||
$sTargetClass = self::GetCallersPHPClass("Init");
|
||||
@@ -2342,7 +2359,7 @@ abstract class MetaModel
|
||||
//
|
||||
foreach(self::EnumZLists() as $sListCode)
|
||||
{
|
||||
foreach (self::GetZListItems($sClass, $sListCode) as $sMyAttCode)
|
||||
foreach (self::FlattenZList(self::GetZListItems($sClass, $sListCode)) as $sMyAttCode)
|
||||
{
|
||||
if (!self::IsValidAttCode($sClass, $sMyAttCode))
|
||||
{
|
||||
@@ -2352,6 +2369,7 @@ abstract class MetaModel
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (count($aErrors) > 0)
|
||||
{
|
||||
echo "<div style=\"width:100%;padding:10px;background:#FFAAAA;display:;\">";
|
||||
|
||||
Reference in New Issue
Block a user