summaryrefslogtreecommitdiff
path: root/plugins/libkolab
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2015-02-15 16:10:22 (GMT)
committerThomas Bruederli <bruederli@kolabsys.com>2015-02-15 16:10:22 (GMT)
commitd564e23aa345ce67c7c8cabca1a324628a94fcba (patch)
treee21aae17e61606b03e3757cecdca67eb14047914 /plugins/libkolab
parent12591358e600dd3b0ad91a8f29345354e34000ac (diff)
downloadroundcubemail-plugins-kolab-d564e23aa345ce67c7c8cabca1a324628a94fcba.tar.gz
Use the right list of properties relevenat for scheduling (follow-up of commit 12591358). Static vars don't work here as intended
Diffstat (limited to 'plugins/libkolab')
-rw-r--r--plugins/libkolab/lib/kolab_format_event.php12
-rw-r--r--plugins/libkolab/lib/kolab_format_task.php19
-rw-r--r--plugins/libkolab/lib/kolab_format_xcal.php14
3 files changed, 22 insertions, 23 deletions
diff --git a/plugins/libkolab/lib/kolab_format_event.php b/plugins/libkolab/lib/kolab_format_event.php
index f3c52df..fe10f9d 100644
--- a/plugins/libkolab/lib/kolab_format_event.php
+++ b/plugins/libkolab/lib/kolab_format_event.php
@@ -44,6 +44,9 @@ class kolab_format_event extends kolab_format_xcal
$this->obj = $data;
$this->loaded = true;
}
+
+ // copy static property overriden by this class
+ $this->_scheduling_properties = self::$scheduling_properties;
}
/**
@@ -275,13 +278,4 @@ class kolab_format_event extends kolab_format_xcal
return $exception;
}
- /**
- * Identify changes considered relevant for scheduling
- *
- * @see kolab_format_xcal::check_rescheduling()
- */
- public static function check_rescheduling($object, $old, $checks = null)
- {
- return parent::check_rescheduling($object, $old, $checks ?: self::$scheduling_properties);
- }
}
diff --git a/plugins/libkolab/lib/kolab_format_task.php b/plugins/libkolab/lib/kolab_format_task.php
index 2c0cda5..d3ddfe9 100644
--- a/plugins/libkolab/lib/kolab_format_task.php
+++ b/plugins/libkolab/lib/kolab_format_task.php
@@ -32,6 +32,16 @@ class kolab_format_task extends kolab_format_xcal
protected $read_func = 'readTodo';
protected $write_func = 'writeTodo';
+ /**
+ * Default constructor
+ */
+ function __construct($data = null, $version = 3.0)
+ {
+ parent::__construct(is_string($data) ? $data : null, $version);
+
+ // copy static property overriden by this class
+ $this->_scheduling_properties = self::$scheduling_properties;
+ }
/**
* Set properties to the kolabformat object
@@ -127,13 +137,4 @@ class kolab_format_task extends kolab_format_xcal
return $tags;
}
- /**
- * Identify changes considered relevant for scheduling
- *
- * @see kolab_format_xcal::check_rescheduling()
- */
- public static function check_rescheduling($object, $old, $checks = null)
- {
- return parent::check_rescheduling($object, $old, $checks ?: self::$scheduling_properties);
- }
}
diff --git a/plugins/libkolab/lib/kolab_format_xcal.php b/plugins/libkolab/lib/kolab_format_xcal.php
index 8d751a6..6d49ad1 100644
--- a/plugins/libkolab/lib/kolab_format_xcal.php
+++ b/plugins/libkolab/lib/kolab_format_xcal.php
@@ -32,6 +32,8 @@ abstract class kolab_format_xcal extends kolab_format
public static $scheduling_properties = array('start', 'end', 'location');
+ protected $_scheduling_properties = null;
+
protected $sensitivity_map = array(
'public' => kolabformat::ClassPublic,
'private' => kolabformat::ClassPrivate,
@@ -317,11 +319,10 @@ abstract class kolab_format_xcal extends kolab_format
}
else {
$object['sequence'] = $old_sequence;
- $old = $this->data['uid'] ? $this->data : $this->to_array();
// 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."
- if (self::check_rescheduling($object, $old)) {
+ if ($this->check_rescheduling($object)) {
$object['sequence']++;
}
}
@@ -634,15 +635,18 @@ abstract class kolab_format_xcal extends kolab_format
*
* @param array Hash array with NEW object properties
* @param array Hash array with OLD object properties
- * @param array List of object properties to check for changes
*
* @return boolean True if changes affect scheduling, False otherwise
*/
- public static function check_rescheduling($object, $old, $checks = null)
+ public function check_rescheduling($object, $old = null)
{
$reschedule = false;
- foreach ($checks ?: self::$scheduling_properties as $prop) {
+ if (!is_array($old)) {
+ $old = $this->data['uid'] ? $this->data : $this->to_array();
+ }
+
+ foreach ($this->_scheduling_properties ?: self::$scheduling_properties as $prop) {
$a = $old[$prop];
$b = $object[$prop];
if ($object['allday'] && ($prop == 'start' || $prop == 'end') && $a instanceof DateTime && $b instanceof DateTime) {