#804 tickets' highlighting is now based on the computation performed by the stopwatch, in order to support non 24x7 working hours

SVN:trunk[2952]
This commit is contained in:
Denis Flaven
2013-10-24 08:11:40 +00:00
parent 0c327f2c36
commit 02e6658439
3 changed files with 75 additions and 82 deletions

View File

@@ -1417,42 +1417,40 @@
$sHilightClass = '';
switch($this->GetState())
{
case 'new':
case 'approved':
$iEscalationDeadline = $this->Get('tto_escalation_deadline');
if ($iEscalationDeadline != null)
{
// A SLA is running
$iStartDate = AttributeDateTime::GetAsUnixSeconds($this->Get('start_date'));
$ratio = ($iEscalationDeadline - time())/($iEscalationDeadline - $iStartDate);
if ($ratio <= 0)
{
$sHilightClass = HILIGHT_CLASS_CRITICAL;
}
else if ($ratio <= 0.25)
{
$sHilightClass = HILIGHT_CLASS_WARNING;
}
}
break;
case 'assigned':
$iEscalationDeadline = $this->Get('ttr_escalation_deadline');
if ($iEscalationDeadline != null)
{
// A SLA is running
$iStartDate = AttributeDateTime::GetAsUnixSeconds($this->Get('start_date'));
$ratio = ($iEscalationDeadline - time())/($iEscalationDeadline - $iStartDate);
if ($ratio <= 0)
{
$sHilightClass = HILIGHT_CLASS_CRITICAL;
}
else if ($ratio <= 0.25)
{
$sHilightClass = HILIGHT_CLASS_WARNING;
}
}
break;
case 'new':
case 'approved':
$iEscalationDeadline = $this->Get('tto_escalation_deadline');
if ($iEscalationDeadline != null)
{
// A SLA is running
$oTTOStopWatch = $this->Get('tto');
if ($oTTOStopWatch->IsThresholdPassed(100))
{
$sHilightClass = HILIGHT_CLASS_CRITICAL;
}
else if ($oTTOStopWatch->IsThresholdPassed(75))
{
$sHilightClass = HILIGHT_CLASS_WARNING;
}
}
break;
case 'assigned':
$iEscalationDeadline = $this->Get('ttr_escalation_deadline');
if ($iEscalationDeadline != null)
{
// A SLA is running
$oTTRStopWatch = $this->Get('ttr');
if ($oTTRStopWatch->IsThresholdPassed(100))
{
$sHilightClass = HILIGHT_CLASS_CRITICAL;
}
else if ($oTTRStopWatch->IsThresholdPassed(75))
{
$sHilightClass = HILIGHT_CLASS_WARNING;
}
}
break;
case 'escalated_tto':
case 'escalated_ttr':

View File

@@ -1806,44 +1806,41 @@
{
$sHilightClass = '';
switch($this->GetState())
{
case 'new':
case 'approved':
$iEscalationDeadline = $this->Get('tto_escalation_deadline');
if ($iEscalationDeadline != null)
{
// A SLA is running
$iStartDate = AttributeDateTime::GetAsUnixSeconds($this->Get('start_date'));
$ratio = ($iEscalationDeadline - time())/($iEscalationDeadline - $iStartDate);
if ($ratio <= 0)
{
$sHilightClass = HILIGHT_CLASS_CRITICAL;
}
else if ($ratio <= 0.25)
{
$sHilightClass = HILIGHT_CLASS_WARNING;
}
}
break;
case 'assigned':
$iEscalationDeadline = $this->Get('ttr_escalation_deadline');
if ($iEscalationDeadline != null)
{
// A SLA is running
$iStartDate = AttributeDateTime::GetAsUnixSeconds($this->Get('start_date'));
$ratio = ($iEscalationDeadline - time())/($iEscalationDeadline - $iStartDate);
if ($ratio <= 0)
{
$sHilightClass = HILIGHT_CLASS_CRITICAL;
}
else if ($ratio <= 0.25)
{
$sHilightClass = HILIGHT_CLASS_WARNING;
}
}
break;
{
case 'new':
case 'approved':
$iEscalationDeadline = $this->Get('tto_escalation_deadline');
if ($iEscalationDeadline != null)
{
// A SLA is running
$oTTOStopWatch = $this->Get('tto');
if ($oTTOStopWatch->IsThresholdPassed(100))
{
$sHilightClass = HILIGHT_CLASS_CRITICAL;
}
else if ($oTTOStopWatch->IsThresholdPassed(75))
{
$sHilightClass = HILIGHT_CLASS_WARNING;
}
}
break;
case 'assigned':
$iEscalationDeadline = $this->Get('ttr_escalation_deadline');
if ($iEscalationDeadline != null)
{
// A SLA is running
$oTTRStopWatch = $this->Get('ttr');
if ($oTTRStopWatch->IsThresholdPassed(100))
{
$sHilightClass = HILIGHT_CLASS_CRITICAL;
}
else if ($oTTRStopWatch->IsThresholdPassed(75))
{
$sHilightClass = HILIGHT_CLASS_WARNING;
}
}
break;
case 'escalated_tto':
case 'escalated_ttr':
$sHilightClass = HILIGHT_CLASS_CRITICAL;

View File

@@ -1799,13 +1799,12 @@
if ($iEscalationDeadline != null)
{
// A SLA is running
$iStartDate = AttributeDateTime::GetAsUnixSeconds($this->Get('start_date'));
$ratio = ($iEscalationDeadline - time())/($iEscalationDeadline - $iStartDate);
if ($ratio <= 0)
$oTTOStopWatch = $this->Get('tto');
if ($oTTOStopWatch->IsThresholdPassed(100))
{
$sHilightClass = HILIGHT_CLASS_CRITICAL;
}
else if ($ratio <= 0.25)
else if ($oTTOStopWatch->IsThresholdPassed(75))
{
$sHilightClass = HILIGHT_CLASS_WARNING;
}
@@ -1817,13 +1816,12 @@
if ($iEscalationDeadline != null)
{
// A SLA is running
$iStartDate = AttributeDateTime::GetAsUnixSeconds($this->Get('start_date'));
$ratio = ($iEscalationDeadline - time())/($iEscalationDeadline - $iStartDate);
if ($ratio <= 0)
$oTTRStopWatch = $this->Get('ttr');
if ($oTTRStopWatch->IsThresholdPassed(100))
{
$sHilightClass = HILIGHT_CLASS_CRITICAL;
}
else if ($ratio <= 0.25)
else if ($oTTRStopWatch->IsThresholdPassed(75))
{
$sHilightClass = HILIGHT_CLASS_WARNING;
}