From 7470c8e72e126a078d5c38315ff06a7092a6d62b Mon Sep 17 00:00:00 2001 From: Denis Flaven Date: Mon, 18 Jul 2011 15:08:44 +0000 Subject: [PATCH] Use the SLAComputation utility to allow plug-ins to implement more complex SLA computation schemes. SVN:trunk[1346] --- modules/itop-tickets-1.0.0/model.itop-tickets.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/itop-tickets-1.0.0/model.itop-tickets.php b/modules/itop-tickets-1.0.0/model.itop-tickets.php index 5729aea900..0fa832dbf4 100644 --- a/modules/itop-tickets-1.0.0/model.itop-tickets.php +++ b/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 "

TTO: SLT found: {$aSLT['SLT']}, value: {$aSLT['value']}

\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 "

TTR: SLT found: {$aSLT['SLT']}, value: {$aSLT['value']}

\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 {