Browse Source

Bug fix: properly record history of Hierarchical Keys

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@2584 a333f486-631f-4898-b8df-5754b55c2be0
dflaven 12 years ago
parent
commit
2be831e87b
1 changed files with 12 additions and 0 deletions
  1. 12 0
      core/cmdbobject.class.inc.php

+ 12 - 0
core/cmdbobject.class.inc.php

@@ -322,6 +322,18 @@ abstract class CMDBObject extends DBObject
 				$oMyChangeOp->Set("newvalue", $value ? 1 : 0);
 				$iId = $oMyChangeOp->DBInsertNoReload();
 			}
+			elseif ($oAttDef instanceOf AttributeHierarchicalKey)
+			{
+				// Hierarchical keys
+				//
+				$oMyChangeOp = MetaModel::NewObject("CMDBChangeOpSetAttributeScalar");
+				$oMyChangeOp->Set("objclass", get_class($this));
+				$oMyChangeOp->Set("objkey", $this->GetKey());
+				$oMyChangeOp->Set("attcode", $sAttCode);
+				$oMyChangeOp->Set("oldvalue", $original);
+				$oMyChangeOp->Set("newvalue", $value[$sAttCode]);
+				$iId = $oMyChangeOp->DBInsertNoReload();
+			}
 			else
 			{
 				// Scalars