From 357ae4abb1b8bdb4edbbb53e9e7f32d48d6197bd Mon Sep 17 00:00:00 2001 From: Denis Flaven Date: Thu, 24 Jul 2014 12:46:56 +0000 Subject: [PATCH] Automatically add an id on the transitions to allow a finer granularity for the deltas. SVN:trunk[3287] --- setup/modelfactory.class.inc.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/setup/modelfactory.class.inc.php b/setup/modelfactory.class.inc.php index df88f12a4..0e577c564 100644 --- a/setup/modelfactory.class.inc.php +++ b/setup/modelfactory.class.inc.php @@ -215,6 +215,9 @@ class ModelFactory $this->oMenus = $this->oDOMDocument->CreateElement('menus'); $this->oRoot->AppendChild($this->oMenus); + $this->oCombodo = $this->oDOMDocument->CreateElement('combodo'); + $this->oRoot->AppendChild($this->oCombodo); + foreach($aRootNodeExtensions as $sElementName) { $oElement = $this->oDOMDocument->CreateElement($sElementName); @@ -428,7 +431,17 @@ class ModelFactory $oUserRightsNode->SetAttribute('_created_in', $sModuleName); } } - + // Adjust the XML to transparently add an id (=stimulus) on all life-cycle transitions + // which don't already have one + $oNodeList = $oXPath->query('/itop_design/classes//class/lifecycle/states/state/transitions/transition/stimulus'); + foreach($oNodeList as $oNode) + { + if ($oNode->parentNode->getAttribute('id') == '') + { + $oNode->parentNode->SetAttribute('id', $oNode->textContent); + } + } + $oDeltaRoot = $oDocument->childNodes->item(0); $this->LoadDelta($oDocument, $oDeltaRoot, $this->oDOMDocument); }