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:43:50 (GMT)
commit0d68fa3330836ba78e1ebac54ec3affd06b16699 (patch)
tree556da7b91c413c35a0c36cecd62e78c5d6bbecae
parent8181bf55158cb05ac69dfa4e51f7d773751b9196 (diff)
downloadroundcubemail-plugins-kolab-0d68fa3330836ba78e1ebac54ec3affd06b16699.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 a45da6e..3cb7826 100644
--- a/plugins/libcalendaring/libvcalendar.php
+++ b/plugins/libcalendaring/libvcalendar.php
@@ -471,7 +471,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 f5c61f9..aa2c568 100644
--- a/plugins/libcalendaring/tests/libvcalendar.php
+++ b/plugins/libcalendaring/tests/libvcalendar.php
@@ -321,6 +321,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