Fix: export of null dates (& times) in "spreadsheet" format should not give the current date !

SVN:2.2.0[4167]
This commit is contained in:
Denis Flaven
2016-06-01 16:28:22 +00:00
parent f84bf4de68
commit 8f92a38200

View File

@@ -199,10 +199,18 @@ class SpreadsheetBulkExport extends TabularBulkExport
$oFinalAttDef = $oAttDef->GetFinalAttDef();
if (get_class($oFinalAttDef) == 'AttributeDateTime')
{
$iDate = AttributeDateTime::GetAsUnixSeconds($oObj->Get($sAttCode));
$sData .= '<td>'.date('Y-m-d', $iDate).'</td>'; // Add the first column directly
$sField = date('H:i:s', $iDate); // Will add the second column below
$sData .= "<td>$sField</td>";
$value = $oObj->Get($sAttCode);
if (($value === null) || ($value === '0000-00-00') || ($value === '0000-00-00 00:00:00') )
{
$sData .= '<td></td><td></td>';
}
else
{
$iDate = AttributeDateTime::GetAsUnixSeconds($oObj->Get($sAttCode));
$sData .= '<td>'.date('Y-m-d', $iDate).'</td>'; // Add the first column directly
$sField = date('H:i:s', $iDate); // Will add the second column below
$sData .= "<td>$sField</td>";
}
}
else if($oAttDef instanceof AttributeCaseLog)
{