mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-21 01:28:47 +02:00
- New configuration parameter deadline_format to specify how to display Deadlines (date or time difference or a mix of the two)
SVN:trunk[1424]
This commit is contained in:
@@ -2280,17 +2280,20 @@ class AttributeDeadline extends AttributeDateTime
|
||||
$sResult = '';
|
||||
if ($value !== null)
|
||||
{
|
||||
$value = AttributeDateTime::GetAsUnixSeconds($value);
|
||||
$difference = $value - time();
|
||||
$iValue = AttributeDateTime::GetAsUnixSeconds($value);
|
||||
$sDate = parent::GetAsHTML($value, $oHostObject);
|
||||
$difference = $iValue - time();
|
||||
|
||||
if ($difference >= 0)
|
||||
{
|
||||
$sResult = self::FormatDuration($difference);
|
||||
$sDifference = self::FormatDuration($difference);
|
||||
}
|
||||
else
|
||||
{
|
||||
$sResult = Dict::Format('UI:DeadlineMissedBy_duration', self::FormatDuration(-$difference));
|
||||
$sDifference = Dict::Format('UI:DeadlineMissedBy_duration', self::FormatDuration(-$difference));
|
||||
}
|
||||
$sFormat = MetaModel::GetConfig()->Get('deadline_format', '$difference$');
|
||||
$sResult = str_replace(array('$date$', '$difference$'), array($sDate, $sDifference), $sFormat);
|
||||
}
|
||||
return $sResult;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user