Validate task input form (#3614 and #3680)

This commit is contained in:
Thomas Bruederli 2015-02-24 10:48:47 +01:00
parent 73bc0f4b13
commit 0e4bac5227
3 changed files with 17 additions and 0 deletions

View file

@ -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';

View file

@ -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?';

View file

@ -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