summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Machniak <machniak@kolabsys.com>2013-04-18 13:46:51 (GMT)
committerAleksander Machniak <machniak@kolabsys.com>2013-04-18 13:46:51 (GMT)
commit08332b5238d4fa0357c3e24cc18c2287c3a18954 (patch)
treeb6e45b8f0d529d60ea16c411a55774aaf98e9585
parentf958537e55008f79977acc17ef006640537ed91b (diff)
parent82907b0a0921f6b7657f70f142c5f30032ec7131 (diff)
downloadroundcubemail-plugins-kolab-08332b5238d4fa0357c3e24cc18c2287c3a18954.tar.gz
Merge branch 'master' of ssh://git.kolab.org/git/roundcube
-rw-r--r--plugins/calendar/calendar_ui.js11
-rw-r--r--plugins/calendar/drivers/kolab/kolab_calendar.php14
-rw-r--r--plugins/calendar/drivers/kolab/kolab_driver.php3
-rw-r--r--plugins/tasklist/tasklist.js10
4 files changed, 23 insertions, 15 deletions
diff --git a/plugins/calendar/calendar_ui.js b/plugins/calendar/calendar_ui.js
index 4099776..64210f8 100644
--- a/plugins/calendar/calendar_ui.js
+++ b/plugins/calendar/calendar_ui.js
@@ -44,7 +44,7 @@ function rcube_calendar_ui(settings)
var client_timezone = new Date().getTimezoneOffset();
var day_clicked = day_clicked_ts = 0;
var ignore_click = false;
- var event_defaults = { free_busy:'busy' };
+ var event_defaults = { free_busy:'busy', alarms:'' };
var event_attendees = [];
var attendees_list;
var freebusy_ui = { workinhoursonly:false, needsupdate:false };
@@ -446,12 +446,13 @@ function rcube_calendar_ui(settings)
// set alarm(s)
// TODO: support multiple alarm entries
- if (event.alarms) {
+ if (event.alarms || action != 'new') {
if (typeof event.alarms == 'string')
event.alarms = event.alarms.split(';');
- for (var alarm, i=0; i < event.alarms.length; i++) {
- alarm = String(event.alarms[i]).split(':');
+ var valarms = event.alarms || [''];
+ for (var alarm, i=0; i < valarms.length; i++) {
+ alarm = String(valarms[i]).split(':');
if (!alarm[1] && alarm[0]) alarm[1] = 'DISPLAY';
$('#eventedit select.edit-alarm-type').val(alarm[1]);
@@ -523,7 +524,7 @@ function rcube_calendar_ui(settings)
// show warning if editing a recurring event
if (event.id && event.recurrence) {
- var sel = event.thisandfuture ? 'future' : 'all';
+ var sel = event.thisandfuture ? 'future' : (event.isexception ? 'current' : 'all');
$('#edit-recurring-warning').show();
$('input.edit-recurring-savemode[value="'+sel+'"]').prop('checked', true);
}
diff --git a/plugins/calendar/drivers/kolab/kolab_calendar.php b/plugins/calendar/drivers/kolab/kolab_calendar.php
index 764f619..590bb55 100644
--- a/plugins/calendar/drivers/kolab/kolab_calendar.php
+++ b/plugins/calendar/drivers/kolab/kolab_calendar.php
@@ -434,6 +434,7 @@ class kolab_calendar
$rec_event['recurrence_id'] = $event['uid'];
$rec_event['recurrence'] = $recurrence_rule;
$rec_event['_instance'] = $i;
+ $rec_event['isexception'] = 1;
$events[] = $rec_event;
// found the specifically requested instance, exiting...
@@ -579,10 +580,8 @@ class kolab_calendar
*/
private function _from_rcube_event($event, $old = array())
{
- $object = &$event;
-
// in kolab_storage attachments are indexed by content-id
- $object['_attachments'] = array();
+ $event['_attachments'] = array();
if (is_array($event['attachments'])) {
foreach ($event['attachments'] as $idx => $attachment) {
$key = null;
@@ -599,15 +598,15 @@ class kolab_calendar
// flagged for deletion => set to false
if ($attachment['_deleted']) {
- $object['_attachments'][$key] = false;
+ $event['_attachments'][$key] = false;
}
// replace existing entry
else if ($key) {
- $object['_attachments'][$key] = $attachment;
+ $event['_attachments'][$key] = $attachment;
}
// append as new attachment
else {
- $object['_attachments'][] = $attachment;
+ $event['_attachments'][] = $attachment;
}
}
@@ -624,6 +623,9 @@ class kolab_calendar
$event['_owner'] = $identity['email'];
+ // remove some internal properties which should not be saved
+ unset($event['_savemode'], $event['_fromcalendar'], $event['_identity']);
+
// copy meta data (starting with _) from old object
foreach ((array)$old as $key => $val) {
if (!isset($event[$key]) && $key[0] == '_')
diff --git a/plugins/calendar/drivers/kolab/kolab_driver.php b/plugins/calendar/drivers/kolab/kolab_driver.php
index 12d60c2..6b980cd 100644
--- a/plugins/calendar/drivers/kolab/kolab_driver.php
+++ b/plugins/calendar/drivers/kolab/kolab_driver.php
@@ -610,6 +610,9 @@ class kolab_driver extends calendar_driver
$event['recurrence'] = array();
$event['thisandfuture'] = $savemode == 'future';
+ // remove some internal properties which should not be saved
+ unset($event['_savemode'], $event['_fromcalendar'], $event['_identity']);
+
// save properties to a recurrence exception instance
if ($old['recurrence_id']) {
$i = $old['_instance'] - 1;
diff --git a/plugins/tasklist/tasklist.js b/plugins/tasklist/tasklist.js
index 7a10484..530bb25 100644
--- a/plugins/tasklist/tasklist.js
+++ b/plugins/tasklist/tasklist.js
@@ -966,7 +966,8 @@ function rcube_tasklist_ui(settings)
if (rcmail.busy || !list.editable || (action == 'edit' && (!rec || rec.readonly)))
return false;
- me.selected_task = $.extend({}, rec); // clone task object
+ me.selected_task = $.extend({ alarms:'' }, rec); // clone task object
+ rec = me.selected_task;
// assign temporary id
if (!me.selected_task.id)
@@ -1006,12 +1007,13 @@ function rcube_tasklist_ui(settings)
});
// set alarm(s)
- if (rec.alarms) {
+ if (rec.alarms || action != 'new') {
if (typeof rec.alarms == 'string')
rec.alarms = rec.alarms.split(';');
- for (var alarm, i=0; i < rec.alarms.length; i++) {
- alarm = String(rec.alarms[i]).split(':');
+ var valarms = rec.alarms || [''];
+ for (var alarm, i=0; i < valarms.length; i++) {
+ alarm = String(valarms[i]).split(':');
if (!alarm[1] && alarm[0]) alarm[1] = 'DISPLAY';
$('#taskedit select.edit-alarm-type').val(alarm[1]);