summaryrefslogtreecommitdiff
path: root/plugins/tasklist
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2015-02-24 09:48:47 (GMT)
committerThomas Bruederli <bruederli@kolabsys.com>2015-02-24 09:48:58 (GMT)
commit0e4bac5227be2c72407158dcaff3d5b694cb4246 (patch)
treedcc2d61d4ff5583928be68372e55df068228b7df /plugins/tasklist
parent73bc0f4b1344ec56f4818690c0cd1c8d3f131307 (diff)
downloadroundcubemail-plugins-kolab-0e4bac5227be2c72407158dcaff3d5b694cb4246.tar.gz
Validate task input form (#3614 and #3680)
Diffstat (limited to 'plugins/tasklist')
-rw-r--r--plugins/tasklist/drivers/kolab/tasklist_kolab_driver.php7
-rw-r--r--plugins/tasklist/localization/en_US.inc2
-rw-r--r--plugins/tasklist/tasklist.js8
3 files changed, 17 insertions, 0 deletions
diff --git a/plugins/tasklist/drivers/kolab/tasklist_kolab_driver.php b/plugins/tasklist/drivers/kolab/tasklist_kolab_driver.php
index 3dd977b..c445b0a 100644
--- a/plugins/tasklist/drivers/kolab/tasklist_kolab_driver.php
+++ b/plugins/tasklist/drivers/kolab/tasklist_kolab_driver.php
@@ -997,6 +997,13 @@ class tasklist_kolab_driver extends tasklist_driver
unset($object['startdate']);
}
+ // as per RFC (and the Kolab schema validation), start and due dates need to be of the same type (#3614)
+ // this should be catched in the client already but just make sure we don't write invalid objects
+ if (!empty($object['start']) && !empty($object['due']) && $object['due']->_dateonly != $object['start']->_dateonly) {
+ $object['start']->_dateonly = true;
+ $object['due']->_dateonly = true;
+ }
+
$object['complete'] = $task['complete'] * 100;
if ($task['complete'] == 1.0 && empty($task['complete']))
$object['status'] = 'COMPLETED';
diff --git a/plugins/tasklist/localization/en_US.inc b/plugins/tasklist/localization/en_US.inc
index 435064d..57ad7e5 100644
--- a/plugins/tasklist/localization/en_US.inc
+++ b/plugins/tasklist/localization/en_US.inc
@@ -105,6 +105,8 @@ $labels['savingdata'] = 'Saving data...';
$labels['errorsaving'] = 'Failed to save data.';
$labels['notasksfound'] = 'No tasks found for the given criteria';
$labels['invalidstartduedates'] = 'Start date must not be greater than due date.';
+$labels['invalidstartduetimes'] = 'Start and due dates must either both or none specify a time.';
+$labels['recurrencerequiresdate'] = 'Recurring tasks require either a start or due date.';
$labels['deletetasktconfirm'] = 'Do you really want to delete this task?';
$labels['deleteparenttasktconfirm'] = 'Do you really want to delete this task and all its subtasks?';
$labels['deletelistconfirm'] = 'Do you really want to delete this list with all its tasks?';
diff --git a/plugins/tasklist/tasklist.js b/plugins/tasklist/tasklist.js
index 9d92f25..4acc8e2 100644
--- a/plugins/tasklist/tasklist.js
+++ b/plugins/tasklist/tasklist.js
@@ -2206,6 +2206,14 @@ function rcube_tasklist_ui(settings)
alert(rcmail.gettext('invalidstartduedates', 'tasklist'));
return false;
}
+ else if ((data.time == '') != (data.starttime == '')) {
+ alert(rcmail.gettext('invalidstartduetimes', 'tasklist'));
+ return false;
+ }
+ }
+ else if (data.recurrence && !data.startdate && !data.date) {
+ alert(rcmail.gettext('recurrencerequiresdate', 'tasklist'));
+ return false;
}
// collect tags