summaryrefslogtreecommitdiff
path: root/plugins/libkolab
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2015-02-12 10:54:51 (GMT)
committerThomas Bruederli <bruederli@kolabsys.com>2015-02-12 10:54:51 (GMT)
commit314501fdb20e2d8cd5a3ee0fbba66153f0287a05 (patch)
treef7e2987eac3f4f114d79197b49cbbb415f16aeb9 /plugins/libkolab
parent5990d292e91d1c979c19223855eda346ba3a248f (diff)
downloadroundcubemail-plugins-kolab-314501fdb20e2d8cd5a3ee0fbba66153f0287a05.tar.gz
Make the list of properties considered 'significant' for scheduling configurable
Diffstat (limited to 'plugins/libkolab')
-rw-r--r--plugins/libkolab/config.inc.php.dist8
-rw-r--r--plugins/libkolab/lib/kolab_format_event.php5
-rw-r--r--plugins/libkolab/lib/kolab_format_task.php2
-rw-r--r--plugins/libkolab/lib/kolab_format_xcal.php5
-rw-r--r--plugins/libkolab/lib/kolab_storage.php9
5 files changed, 24 insertions, 5 deletions
diff --git a/plugins/libkolab/config.inc.php.dist b/plugins/libkolab/config.inc.php.dist
index 5973d33..6e4b613 100644
--- a/plugins/libkolab/config.inc.php.dist
+++ b/plugins/libkolab/config.inc.php.dist
@@ -39,6 +39,14 @@ $config['kolab_http_request'] = array();
// 1 - bypass only messages, but use index cache
$config['kolab_messages_cache_bypass'] = 0;
+// These event properties contribute to a significant revision to the calendar component
+// and if changed will increment the sequence number relevant for scheduling according to RFC 5545
+$config['kolab_event_scheduling_properties'] = array('start', 'end', 'allday', 'location', 'status', 'cancelled');
+
+// These task properties contribute to a significant revision to the calendar component
+// and if changed will increment the sequence number relevant for scheduling according to RFC 5545
+$config['kolab_task_scheduling_properties'] = array('start', 'due', 'summary', 'status');
+
// LDAP directory to find avilable users for folder sharing.
// Either contains an array with LDAP addressbook configuration or refers to entry in $config['ldap_public'].
// If not specified, the configuraton from 'kolab_auth_addressbook' will be used.
diff --git a/plugins/libkolab/lib/kolab_format_event.php b/plugins/libkolab/lib/kolab_format_event.php
index 03b5dde..075c517 100644
--- a/plugins/libkolab/lib/kolab_format_event.php
+++ b/plugins/libkolab/lib/kolab_format_event.php
@@ -26,7 +26,7 @@ class kolab_format_event extends kolab_format_xcal
{
public $CTYPEv2 = 'application/x-vnd.kolab.event';
- public $scheduling_properties = array('start', 'end', 'allday', 'location', 'status', 'cancelled');
+ public static $scheduling_properties = array('start', 'end', 'allday', 'location', 'status', 'cancelled');
protected $objclass = 'Event';
protected $read_func = 'readEvent';
@@ -250,6 +250,9 @@ class kolab_format_event extends kolab_format_xcal
}
}
+ // preserve this property for date serialization
+ $exception['allday'] = $master['allday'];
+
return $exception;
}
diff --git a/plugins/libkolab/lib/kolab_format_task.php b/plugins/libkolab/lib/kolab_format_task.php
index 52744d4..ee0ca6a 100644
--- a/plugins/libkolab/lib/kolab_format_task.php
+++ b/plugins/libkolab/lib/kolab_format_task.php
@@ -26,7 +26,7 @@ class kolab_format_task extends kolab_format_xcal
{
public $CTYPEv2 = 'application/x-vnd.kolab.task';
- public $scheduling_properties = array('start', 'due', 'summary', 'status');
+ public static $scheduling_properties = array('start', 'due', 'summary', 'status');
protected $objclass = 'Todo';
protected $read_func = 'readTodo';
diff --git a/plugins/libkolab/lib/kolab_format_xcal.php b/plugins/libkolab/lib/kolab_format_xcal.php
index 33ada93..d0f89b6 100644
--- a/plugins/libkolab/lib/kolab_format_xcal.php
+++ b/plugins/libkolab/lib/kolab_format_xcal.php
@@ -30,7 +30,7 @@ abstract class kolab_format_xcal extends kolab_format
public static $fulltext_cols = array('title', 'description', 'location', 'attendees:name', 'attendees:email', 'categories');
- public $scheduling_properties = array('start', 'end', 'location');
+ public static $scheduling_properties = array('start', 'end', 'location');
protected $sensitivity_map = array(
'public' => kolabformat::ClassPublic,
@@ -321,8 +321,7 @@ abstract class kolab_format_xcal extends kolab_format
// increment sequence when updating properties relevant for scheduling.
// RFC 5545: "It is incremented [...] each time the Organizer makes a significant revision to the calendar component."
- // TODO: make the list of properties considered 'significant' for scheduling configurable
- foreach ($this->scheduling_properties as $prop) {
+ foreach (self::$scheduling_properties as $prop) {
$a = $old[$prop];
$b = $object[$prop];
if ($object['allday'] && ($prop == 'start' || $prop == 'end') && $a instanceof DateTime && $b instanceof DateTime) {
diff --git a/plugins/libkolab/lib/kolab_storage.php b/plugins/libkolab/lib/kolab_storage.php
index 47c1e4b..bc38adc 100644
--- a/plugins/libkolab/lib/kolab_storage.php
+++ b/plugins/libkolab/lib/kolab_storage.php
@@ -106,6 +106,15 @@ class kolab_storage
), true);
}
+ // adjust some configurable settings
+ if ($event_scheduling_prop = $rcmail->config->get('kolab_event_scheduling_properties', null)) {
+ kolab_format_event::$scheduling_properties = (array)$event_scheduling_prop;
+ }
+ // adjust some configurable settings
+ if ($task_scheduling_prop = $rcmail->config->get('kolab_task_scheduling_properties', null)) {
+ kolab_format_task::$scheduling_properties = (array)$task_scheduling_prop;
+ }
+
return self::$ready;
}