瀏覽代碼

Use the SLAComputation utility to allow plug-ins to implement more complex SLA computation schemes.

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@1346 a333f486-631f-4898-b8df-5754b55c2be0
dflaven 14 年之前
父節點
當前提交
36a269cedb
共有 1 個文件被更改,包括 6 次插入6 次删除
  1. 6 6
      modules/itop-tickets-1.0.0/model.itop-tickets.php

+ 6 - 6
modules/itop-tickets-1.0.0/model.itop-tickets.php

@@ -486,9 +486,9 @@ abstract class ResponseTicket extends Ticket
 		$aSLT = $this->ComputeSLT('TTO');
 		if ($aSLT != null)
 		{
-			//echo "<p>TTO: SLT found: {$aSLT['SLT']}, value: {$aSLT['value']}</p>\n";
-			$iStartDate = AttributeDateTime::GetAsUnixSeconds($this->Get('start_date'));		
-			$this->Set('tto_escalation_deadline', $iStartDate + $aSLT['value']);
+			$oStartDate = new DateTime($this->Get('start_date'));
+			$oDeadline = SLAComputation::GetDeadline($this, $aSLT['value'], $oStartDate);		
+			$this->Set('tto_escalation_deadline', $oDeadline->format('U'));
 		}
 		else
 		{
@@ -497,9 +497,9 @@ abstract class ResponseTicket extends Ticket
 		$aSLT = $this->ComputeSLT('TTR');
 		if ($aSLT != null)
 		{
-			//echo "<p>TTR: SLT found: {$aSLT['SLT']}, value: {$aSLT['value']}</p>\n";
-			$iStartDate = AttributeDateTime::GetAsUnixSeconds($this->Get('start_date'));		
-			$this->Set('ttr_escalation_deadline', $iStartDate + $aSLT['value']);
+			$oStartDate = new DateTime($this->Get('start_date'));
+			$oDeadline = SLAComputation::GetDeadline($this, $aSLT['value'], $oStartDate);		
+			$this->Set('ttr_escalation_deadline', $oDeadline->format('U'));
 		}
 		else
 		{