Fixed setting mimetype of attachments on create/update event (#244)

This commit is contained in:
Aleksander Machniak (Kolab Systems) 2011-08-01 20:39:11 +02:00
parent 7e3a88996f
commit 159d672a1d

View file

@ -289,6 +289,7 @@ class kolab_calendar
$old = $this->storage->getObject($event['id']);
$object = array_merge($old, $this->_from_rcube_event($event));
$saved = $this->storage->save($object, $event['id']);
if (PEAR::isError($saved)) {
raise_error(array(
'code' => 600, 'type' => 'php',
@ -711,6 +712,10 @@ class kolab_calendar
$attachment['name'] = basename($filename, $ext) . '-' . $collisions[$filename] . $ext;
}
// set type parameter
if ($attachment['mimetype'])
$attachment['type'] = $attachment['mimetype'];
$object['_attachments'][$attachment['name']] = $attachment;
unset($event['attachments'][$idx]);
}