Browse Source

Fixed Trac #156: make sure the hierarchical ZLists are supported everywhere (final cleanup).

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@1118 a333f486-631f-4898-b8df-5754b55c2be0
dflaven 14 năm trước cách đây
mục cha
commit
1eea4906be

+ 1 - 1
application/uiwizard.class.inc.php

@@ -227,7 +227,7 @@ $sJSHandlerCode
 			
 		// Now use the dependencies between the fields to order them
 		// Start from the order of the 'details'
-		$aList = MetaModel::GetZListItems($this->m_sClass, 'details');
+		$aList = MetaModel::FlattenZlist(MetaModel::GetZListItems($this->m_sClass, 'details'));
 		$index = 0;
 		$aOrder = array();
 		foreach($aFields as $sAttCode => $void)

+ 1 - 1
core/metamodel.class.php

@@ -840,7 +840,7 @@ abstract class MetaModel
 
 	public static function IsAttributeInZList($sClass, $sListCode, $sAttCodeOrFltCode, $sGroup = null)
 	{
-		$aZList = self::GetZListItems($sClass, $sListCode);
+		$aZList = self::FlattenZlist(self::GetZListItems($sClass, $sListCode));
 		if (!$sGroup)
 		{
 			return (in_array($sAttCodeOrFltCode, $aZList));

+ 1 - 1
synchro/synchrodatasource.class.inc.php

@@ -1676,7 +1676,7 @@ class SynchroReplica extends DBObject implements iDisplay
 		$sClass = get_class($this);
 		$oPage->add('<fieldset>');
 		$oPage->add('<legend>'.Dict::S('Core:SynchroReplica:PrivateDetails').'</legend>');
-		$aZList = MetaModel::GetZListItems($sClass, 'details');
+		$aZList = MetaModel::FlattenZlist(MetaModel::GetZListItems($sClass, 'details'));
 		foreach( $aZList as $sAttCode)
 		{
 			$sDisplayValue = $this->GetAsHTML($sAttCode);	

+ 1 - 1
test/testlist.inc.php

@@ -531,7 +531,7 @@ class TestMyBizModel extends TestBizModel
 	
 			foreach (MetaModel::GetSubclasses("cmdbObjectHomeMade") as $sKlass)
 			{
-				$aItems = MetaModel::GetZListItems($sKlass, $sListCode);
+				$aItems = MetaModel::FlattenZlist(MetaModel::GetZListItems($sKlass, $sListCode));
 				if (count($aItems) == 0) continue;
 	
 				echo "$sKlass - $sListCode : {".implode(", ", $aItems)."}</br>\n";