浏览代码

#976: make sure that we do not bypass the method that computes the reference for newly created tickets.

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@3306 a333f486-631f-4898-b8df-5754b55c2be0
dflaven 10 年之前
父节点
当前提交
47eca05fbb
共有 1 个文件被更改,包括 13 次插入11 次删除
  1. 13 11
      core/cmdbobject.class.inc.php

+ 13 - 11
core/cmdbobject.class.inc.php

@@ -428,38 +428,40 @@ abstract class CMDBObject extends DBObject
 	}
 	}
 
 
 
 
-	public function DBInsert()
-	{
-		return $this->DBInsertTracked_Internal();
-	}
-
 	public function DBInsertTracked(CMDBChange $oChange, $bSkipStrongSecurity = null)
 	public function DBInsertTracked(CMDBChange $oChange, $bSkipStrongSecurity = null)
 	{
 	{
 		self::SetCurrentChange($oChange);
 		self::SetCurrentChange($oChange);
 		$this->CheckUserRights($bSkipStrongSecurity, UR_ACTION_MODIFY);
 		$this->CheckUserRights($bSkipStrongSecurity, UR_ACTION_MODIFY);
-
 		$ret = $this->DBInsertTracked_Internal();
 		$ret = $this->DBInsertTracked_Internal();
 		return $ret;
 		return $ret;
 	}
 	}
-
+	
 	public function DBInsertTrackedNoReload(CMDBChange $oChange, $bSkipStrongSecurity = null)
 	public function DBInsertTrackedNoReload(CMDBChange $oChange, $bSkipStrongSecurity = null)
 	{
 	{
 		self::SetCurrentChange($oChange);
 		self::SetCurrentChange($oChange);
 		$this->CheckUserRights($bSkipStrongSecurity, UR_ACTION_MODIFY);
 		$this->CheckUserRights($bSkipStrongSecurity, UR_ACTION_MODIFY);
-
 		$ret = $this->DBInsertTracked_Internal(true);
 		$ret = $this->DBInsertTracked_Internal(true);
 		return $ret;
 		return $ret;
 	}
 	}
-
+	
+	/**
+	 * To Be Obsoleted: DO NOT rely on an overload of this method since
+	 * DBInsertTracked (resp. DBInsertTrackedNoReload) may call directly
+	 * DBInsert (resp. DBInsertNoReload) in future versions of iTop.
+	 * @param bool $bDoNotReload
+	 * @return integer Identifier of the created object
+	 */
 	protected function DBInsertTracked_Internal($bDoNotReload = false)
 	protected function DBInsertTracked_Internal($bDoNotReload = false)
 	{
 	{
 		if ($bDoNotReload)
 		if ($bDoNotReload)
 		{
 		{
-			$ret = parent::DBInsertNoReload();
+IssueLog::Info('CMDBObject::DBInsertTracked_Internal(true)');
+			$ret = $this->DBInsertNoReload();
 		}
 		}
 		else
 		else
 		{
 		{
-			$ret = parent::DBInsert();
+IssueLog::Info('CMDBObject::DBInsertTracked_Internal(false)');
+			$ret = $this>DBInsert();
 		}
 		}
 		return $ret;
 		return $ret;
 	}
 	}