N°2847 - Add lifecycle states default colors

This commit is contained in:
Molkobain
2020-10-05 08:43:32 +02:00
parent 6fb5d20971
commit ea8a8e3afa
4 changed files with 120 additions and 4 deletions

View File

@@ -33,9 +33,42 @@ class TitleFactory
$sStatusAttCode = MetaModel::GetStateAttributeCode($sObjClass);
if(!empty($sStatusAttCode))
{
$sStateCode = $oObject->GetState();
$sStatusLabel = $oObject->GetStateLabel();
// TODO 2.8.0 : Dehardcode this
$sStatusColor = 'green';
switch ($sStateCode)
{
case 'new':
$sStatusColor = 'new';
break;
case 'waiting_for_approval':
case 'pending':
$sStatusColor = 'waiting';
break;
case 'escalated_tto':
case 'escalated_ttr':
case 'rejected':
$sStatusColor = 'failure';
break;
case 'resolved':
$sStatusColor = 'success';
break;
case 'closed':
$sStatusColor = 'frozen';
break;
case 'approved':
case 'assigned':
case 'dispatched':
case 'redispatched':
default:
$sStatusColor = 'neutral';
break;
}
$oTitle->SetStatus($sStatusAttCode, $sStatusLabel, $sStatusColor);
}