* InfoLog/CalDAV: fixed since last package (Horde_Icalendar update) not imported start, due and completed dates

This commit is contained in:
Ralf Becker 2015-07-16 13:30:10 +00:00
parent ed9cd28473
commit 71bd48bf59

View File

@ -624,6 +624,17 @@ class infolog_ical extends infolog_bo
return $result; return $result;
} }
/**
* Convert date(-array) to timestamp used in InfoLog
*
* @param int|array $date
* @return int
*/
protected static function date2ts($date)
{
return is_scalar($date) ? $date : egw_time::to($date, 'ts');
}
/** /**
* Convert VTODO into a eGW infolog entry * Convert VTODO into a eGW infolog entry
* *
@ -720,8 +731,7 @@ class infolog_ical extends infolog_bo
} }
foreach ($component->getAllAttributes() as $attribute) foreach ($component->getAllAttributes() as $attribute)
{ {
//$attribute['value'] = trim($attribute['value']); if (!$attribute['value'] && $attribute['value'] !== '0') continue;
if (!strlen($attribute['value'])) continue;
switch ($attribute['name']) switch ($attribute['name'])
{ {
@ -768,15 +778,15 @@ class infolog_ical extends infolog_bo
case 'DUE': case 'DUE':
// even as EGroupware only displays the date, we can still store the full value // even as EGroupware only displays the date, we can still store the full value
// unless infolog get's stored, it does NOT truncate the time // unless infolog get's stored, it does NOT truncate the time
$taskData['info_enddate'] = $attribute['value']; $taskData['info_enddate'] = self::date2ts($attribute['value']);
break; break;
case 'COMPLETED': case 'COMPLETED':
$taskData['info_datecompleted'] = $attribute['value']; $taskData['info_datecompleted'] = self::date2ts($attribute['value']);
break; break;
case 'DTSTART': case 'DTSTART':
$taskData['info_startdate'] = $attribute['value']; $taskData['info_startdate'] = self::date2ts($attribute['value']);
break; break;
case 'PRIORITY': case 'PRIORITY':