浏览代码

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 年之前
父节点
当前提交
2be831e87b
共有 1 个文件被更改,包括 12 次插入0 次删除
  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