summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2014-08-25 07:42:09 (GMT)
committerThomas Bruederli <bruederli@kolabsys.com>2014-08-25 07:45:08 (GMT)
commit84a7fca3ca464966fbf2263efdf0ac40dc1715e4 (patch)
tree9a76cc9358eee1a8a02a656b9acc19d021bde6c2
parentfe2f86e4e2fc681251243d58506e2ab012e870c5 (diff)
downloadroundcubemail-plugins-kolab-84a7fca3ca464966fbf2263efdf0ac40dc1715e4.tar.gz
Support multiple CATEGORIES properties (#3497)
-rw-r--r--plugins/libcalendaring/libvcalendar.php2
-rw-r--r--plugins/libcalendaring/tests/libvcalendar.php1
-rw-r--r--plugins/libcalendaring/tests/resources/vtodo.ics3
3 files changed, 5 insertions, 1 deletions
diff --git a/plugins/libcalendaring/libvcalendar.php b/plugins/libcalendaring/libvcalendar.php
index 603eaa3..107d3b0 100644
--- a/plugins/libcalendaring/libvcalendar.php
+++ b/plugins/libcalendaring/libvcalendar.php
@@ -469,7 +469,7 @@ class libvcalendar implements Iterator
case 'CATEGORY':
case 'CATEGORIES':
- $event['categories'] = $prop->getParts();
+ $event['categories'] = array_merge((array)$event['categories'], $prop->getParts());
break;
case 'CLASS':
diff --git a/plugins/libcalendaring/tests/libvcalendar.php b/plugins/libcalendaring/tests/libvcalendar.php
index ddc6e97..5898d27 100644
--- a/plugins/libcalendaring/tests/libvcalendar.php
+++ b/plugins/libcalendaring/tests/libvcalendar.php
@@ -317,6 +317,7 @@ class libvcalendar_test extends PHPUnit_Framework_TestCase
$this->assertEquals('-1D:DISPLAY', $task['alarms'], "Taks alarm value");
$this->assertEquals('IN-PROCESS', $task['status'], "Task status property");
$this->assertEquals(1, count($task['x-custom']), "Custom properties");
+ $this->assertEquals(4, count($task['categories']));
}
/**
diff --git a/plugins/libcalendaring/tests/resources/vtodo.ics b/plugins/libcalendaring/tests/resources/vtodo.ics
index 9526142..0d4534c 100644
--- a/plugins/libcalendaring/tests/resources/vtodo.ics
+++ b/plugins/libcalendaring/tests/resources/vtodo.ics
@@ -28,6 +28,9 @@ STATUS:IN-PROCESS
DTSTART;TZID=Europe/Zurich:20130921T000000
DUE;VALUE=DATE:20130921
SEQUENCE:2
+CATEGORIES:Tag1,Tag2
+CATEGORIES:Tag3
+CATEGORIES:Tag4
X-MOZ-GENERATION:1
BEGIN:VALARM
ACTION:DISPLAY