Cache start/due dates for task objects
This commit is contained in:
parent
2ad9e2e1ba
commit
529d16eac3
1 changed files with 8 additions and 1 deletions
|
@ -448,9 +448,10 @@ class kolab_storage_cache
|
|||
{
|
||||
$bincols = array_flip($this->binary_cols);
|
||||
$sql_data = array('dtstart' => null, 'dtend' => null, 'xml' => '', 'tags' => '', 'words' => '');
|
||||
$objtype = $object['_type'] ? $object['_type'] : $this->folder->type;
|
||||
|
||||
// set type specific values
|
||||
if ($this->folder->type == 'event') {
|
||||
if ($objtype == 'event') {
|
||||
// database runs in server's timezone so using date() is what we want
|
||||
$sql_data['dtstart'] = date('Y-m-d H:i:s', is_object($object['start']) ? $object['start']->format('U') : $object['start']);
|
||||
$sql_data['dtend'] = date('Y-m-d H:i:s', is_object($object['end']) ? $object['end']->format('U') : $object['end']);
|
||||
|
@ -460,6 +461,12 @@ class kolab_storage_cache
|
|||
$sql_data['dtend'] = date('Y-m-d H:i:s', $object['recurrence']['UNTIL'] ?: strtotime('now + 2 years'));
|
||||
}
|
||||
}
|
||||
else if ($objtype == 'task') {
|
||||
if ($object['start'])
|
||||
$sql_data['dtstart'] = date('Y-m-d H:i:s', is_object($object['start']) ? $object['start']->format('U') : $object['start']);
|
||||
if ($object['due'])
|
||||
$sql_data['dtend'] = date('Y-m-d H:i:s', is_object($object['due']) ? $object['due']->format('U') : $object['due']);
|
||||
}
|
||||
|
||||
if ($object['_formatobj']) {
|
||||
$sql_data['xml'] = preg_replace('!(</?[a-z0-9:-]+>)[\n\r\t\s]+!ms', '$1', (string)$object['_formatobj']->write());
|
||||
|
|
Loading…
Add table
Reference in a new issue