Support import/export of custom properties

This commit is contained in:
Thomas Bruederli 2013-02-21 17:41:41 +01:00
parent e1b78250da
commit cf3426a4ae

View file

@ -9,7 +9,7 @@
* @author Bogomil "Bogo" Shopov <shopov@kolabsys.com>
*
* Copyright (C) 2010, Lazlo Westerhof <hello@lazlo.me>
* Copyright (C) 2011, Kolab Systems AG <contact@kolabsys.com>
* Copyright (C) 2013, Kolab Systems AG <contact@kolabsys.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
@ -258,6 +258,10 @@ class calendar_ical
else if (in_array($attr['value'], array('FREE', 'BUSY', 'TENTATIVE')))
$event['free_busy'] = strtolower($attr['value']);
break;
default:
if (substr($attr['name'], 0, 2) == 'X-')
$event['x-custom'][] = array($attr['name'], $attr['value']);
}
}
@ -416,6 +420,9 @@ class calendar_ical
else if ($event['free_busy'] == 'tentative')
$vevent .= "STATUS:TENTATIVE" . self::EOL;
foreach ((array)$event['x-custom'] as $prop)
$vevent .= $prop[0] . ':' . $this->escpape($prop[1]) . self::EOL;
// TODO: export attachments
$vevent .= "END:VEVENT" . self::EOL;