Kaynağa Gözat

Added an automatic naming for the change tickets based on their Id (Same as for Incident tickets but starting with C-).

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@132 a333f486-631f-4898-b8df-5754b55c2be0
dflaven 15 yıl önce
ebeveyn
işleme
1c87c6166b
1 değiştirilmiş dosya ile 13 ekleme ve 0 silme
  1. 13 0
      business/ChangeMgmt.business.php

+ 13 - 0
business/ChangeMgmt.business.php

@@ -179,6 +179,19 @@ class bizChangeTicket extends cmdbAbstractObject
 		$this->Set('last_update', time());
 		return true;
 	}
+
+	public function ComputeFields()
+	{
+		if ($this->GetKey() > 0)
+		{
+			$sName = sprintf('C-%06d', $this->GetKey());
+		}
+		else
+		{
+			$sName = "Id not set";
+		}
+		$this->Set('name', $sName);
+	}
 }
 
 ////////////////////////////////////////////////////////////////////////////////////