mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-22 00:32:16 +02:00
#854 Flag Is null allowed not working on attributes Date and DateTime + the default value is now operant
SVN:trunk[3185]
This commit is contained in:
@@ -2510,18 +2510,16 @@ class AttributeDateTime extends AttributeDBField
|
||||
return $iUnixSeconds;
|
||||
}
|
||||
|
||||
// This has been done at the time when itop was using TIMESTAMP columns,
|
||||
// now that iTop is using DATETIME columns, it seems possible to have IsNullAllowed returning false... later when this is needed
|
||||
public function IsNullAllowed() {return true;}
|
||||
public function GetDefaultValue()
|
||||
{
|
||||
$default = parent::GetDefaultValue();
|
||||
|
||||
if (!parent::IsNullAllowed())
|
||||
if (!empty($default))
|
||||
{
|
||||
if (empty($default))
|
||||
$iDate = strtotime($default);
|
||||
if ($iDate !== false)
|
||||
{
|
||||
$default = date($this->GetDateFormat());
|
||||
$default = date($this->GetDateFormat(), $iDate);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user