mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-20 17:18:51 +02:00
Keep track of which module altered which node in the XML.
SVN:trunk[3845]
This commit is contained in:
@@ -479,6 +479,15 @@ class ModelFactory
|
||||
}
|
||||
}
|
||||
|
||||
$oAlteredNodes = $oXPath->query('/itop_design//*[@_delta]');
|
||||
if ($oAlteredNodes->length > 0)
|
||||
{
|
||||
foreach($oAlteredNodes as $oAlteredNode)
|
||||
{
|
||||
$oAlteredNode->SetAttribute('_altered_in', $sModuleName);
|
||||
}
|
||||
}
|
||||
|
||||
$oFormat = new iTopDesignFormat($oDocument);
|
||||
if (!$oFormat->Convert())
|
||||
{
|
||||
@@ -1592,7 +1601,24 @@ class MFElement extends DOMElement
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check if the given node is (a child of a node) altered by one of the supplied modules
|
||||
* @param array $aModules The list of module codes to consider
|
||||
* @return boolean
|
||||
*/
|
||||
public function IsAlteredByModule($aModules)
|
||||
{
|
||||
// Iterate through the parents: reset the flag if any of them has a flag set
|
||||
for($oParent = $this ; $oParent instanceof MFElement ; $oParent = $oParent->parentNode)
|
||||
{
|
||||
if (in_array($oParent->getAttribute('_altered_in'), $aModules))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static $aTraceAttributes = null;
|
||||
/**
|
||||
* Enable/disable the trace on changed nodes
|
||||
@@ -2012,6 +2038,7 @@ class MFDocument extends DOMDocument
|
||||
}
|
||||
return $oElement;
|
||||
}
|
||||
|
||||
/**
|
||||
* For debugging purposes
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user