From 2a6de0bd285c33a081dd3b66e6bd9b5cac5f7bc2 Mon Sep 17 00:00:00 2001 From: Denis Flaven Date: Thu, 10 Sep 2009 14:08:22 +0000 Subject: [PATCH] Added an automatic naming for the change tickets based on their Id (Same as for Incident tickets but starting with C-). SVN:code[132] --- trunk/business/ChangeMgmt.business.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/trunk/business/ChangeMgmt.business.php b/trunk/business/ChangeMgmt.business.php index 4613d66ebf..ac59bcd8bd 100644 --- a/trunk/business/ChangeMgmt.business.php +++ b/trunk/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); + } } ////////////////////////////////////////////////////////////////////////////////////