Merge branch 'master' of ssh://git.kolab.org/git/roundcube
This commit is contained in:
commit
08332b5238
4 changed files with 23 additions and 15 deletions
|
@ -44,7 +44,7 @@ function rcube_calendar_ui(settings)
|
||||||
var client_timezone = new Date().getTimezoneOffset();
|
var client_timezone = new Date().getTimezoneOffset();
|
||||||
var day_clicked = day_clicked_ts = 0;
|
var day_clicked = day_clicked_ts = 0;
|
||||||
var ignore_click = false;
|
var ignore_click = false;
|
||||||
var event_defaults = { free_busy:'busy' };
|
var event_defaults = { free_busy:'busy', alarms:'' };
|
||||||
var event_attendees = [];
|
var event_attendees = [];
|
||||||
var attendees_list;
|
var attendees_list;
|
||||||
var freebusy_ui = { workinhoursonly:false, needsupdate:false };
|
var freebusy_ui = { workinhoursonly:false, needsupdate:false };
|
||||||
|
@ -446,12 +446,13 @@ function rcube_calendar_ui(settings)
|
||||||
|
|
||||||
// set alarm(s)
|
// set alarm(s)
|
||||||
// TODO: support multiple alarm entries
|
// TODO: support multiple alarm entries
|
||||||
if (event.alarms) {
|
if (event.alarms || action != 'new') {
|
||||||
if (typeof event.alarms == 'string')
|
if (typeof event.alarms == 'string')
|
||||||
event.alarms = event.alarms.split(';');
|
event.alarms = event.alarms.split(';');
|
||||||
|
|
||||||
for (var alarm, i=0; i < event.alarms.length; i++) {
|
var valarms = event.alarms || [''];
|
||||||
alarm = String(event.alarms[i]).split(':');
|
for (var alarm, i=0; i < valarms.length; i++) {
|
||||||
|
alarm = String(valarms[i]).split(':');
|
||||||
if (!alarm[1] && alarm[0]) alarm[1] = 'DISPLAY';
|
if (!alarm[1] && alarm[0]) alarm[1] = 'DISPLAY';
|
||||||
$('#eventedit select.edit-alarm-type').val(alarm[1]);
|
$('#eventedit select.edit-alarm-type').val(alarm[1]);
|
||||||
|
|
||||||
|
@ -523,7 +524,7 @@ function rcube_calendar_ui(settings)
|
||||||
|
|
||||||
// show warning if editing a recurring event
|
// show warning if editing a recurring event
|
||||||
if (event.id && event.recurrence) {
|
if (event.id && event.recurrence) {
|
||||||
var sel = event.thisandfuture ? 'future' : 'all';
|
var sel = event.thisandfuture ? 'future' : (event.isexception ? 'current' : 'all');
|
||||||
$('#edit-recurring-warning').show();
|
$('#edit-recurring-warning').show();
|
||||||
$('input.edit-recurring-savemode[value="'+sel+'"]').prop('checked', true);
|
$('input.edit-recurring-savemode[value="'+sel+'"]').prop('checked', true);
|
||||||
}
|
}
|
||||||
|
|
|
@ -434,6 +434,7 @@ class kolab_calendar
|
||||||
$rec_event['recurrence_id'] = $event['uid'];
|
$rec_event['recurrence_id'] = $event['uid'];
|
||||||
$rec_event['recurrence'] = $recurrence_rule;
|
$rec_event['recurrence'] = $recurrence_rule;
|
||||||
$rec_event['_instance'] = $i;
|
$rec_event['_instance'] = $i;
|
||||||
|
$rec_event['isexception'] = 1;
|
||||||
$events[] = $rec_event;
|
$events[] = $rec_event;
|
||||||
|
|
||||||
// found the specifically requested instance, exiting...
|
// found the specifically requested instance, exiting...
|
||||||
|
@ -579,10 +580,8 @@ class kolab_calendar
|
||||||
*/
|
*/
|
||||||
private function _from_rcube_event($event, $old = array())
|
private function _from_rcube_event($event, $old = array())
|
||||||
{
|
{
|
||||||
$object = &$event;
|
|
||||||
|
|
||||||
// in kolab_storage attachments are indexed by content-id
|
// in kolab_storage attachments are indexed by content-id
|
||||||
$object['_attachments'] = array();
|
$event['_attachments'] = array();
|
||||||
if (is_array($event['attachments'])) {
|
if (is_array($event['attachments'])) {
|
||||||
foreach ($event['attachments'] as $idx => $attachment) {
|
foreach ($event['attachments'] as $idx => $attachment) {
|
||||||
$key = null;
|
$key = null;
|
||||||
|
@ -599,15 +598,15 @@ class kolab_calendar
|
||||||
|
|
||||||
// flagged for deletion => set to false
|
// flagged for deletion => set to false
|
||||||
if ($attachment['_deleted']) {
|
if ($attachment['_deleted']) {
|
||||||
$object['_attachments'][$key] = false;
|
$event['_attachments'][$key] = false;
|
||||||
}
|
}
|
||||||
// replace existing entry
|
// replace existing entry
|
||||||
else if ($key) {
|
else if ($key) {
|
||||||
$object['_attachments'][$key] = $attachment;
|
$event['_attachments'][$key] = $attachment;
|
||||||
}
|
}
|
||||||
// append as new attachment
|
// append as new attachment
|
||||||
else {
|
else {
|
||||||
$object['_attachments'][] = $attachment;
|
$event['_attachments'][] = $attachment;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -624,6 +623,9 @@ class kolab_calendar
|
||||||
|
|
||||||
$event['_owner'] = $identity['email'];
|
$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
|
// copy meta data (starting with _) from old object
|
||||||
foreach ((array)$old as $key => $val) {
|
foreach ((array)$old as $key => $val) {
|
||||||
if (!isset($event[$key]) && $key[0] == '_')
|
if (!isset($event[$key]) && $key[0] == '_')
|
||||||
|
|
|
@ -610,6 +610,9 @@ class kolab_driver extends calendar_driver
|
||||||
$event['recurrence'] = array();
|
$event['recurrence'] = array();
|
||||||
$event['thisandfuture'] = $savemode == 'future';
|
$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
|
// save properties to a recurrence exception instance
|
||||||
if ($old['recurrence_id']) {
|
if ($old['recurrence_id']) {
|
||||||
$i = $old['_instance'] - 1;
|
$i = $old['_instance'] - 1;
|
||||||
|
|
|
@ -966,7 +966,8 @@ function rcube_tasklist_ui(settings)
|
||||||
if (rcmail.busy || !list.editable || (action == 'edit' && (!rec || rec.readonly)))
|
if (rcmail.busy || !list.editable || (action == 'edit' && (!rec || rec.readonly)))
|
||||||
return false;
|
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
|
// assign temporary id
|
||||||
if (!me.selected_task.id)
|
if (!me.selected_task.id)
|
||||||
|
@ -1006,12 +1007,13 @@ function rcube_tasklist_ui(settings)
|
||||||
});
|
});
|
||||||
|
|
||||||
// set alarm(s)
|
// set alarm(s)
|
||||||
if (rec.alarms) {
|
if (rec.alarms || action != 'new') {
|
||||||
if (typeof rec.alarms == 'string')
|
if (typeof rec.alarms == 'string')
|
||||||
rec.alarms = rec.alarms.split(';');
|
rec.alarms = rec.alarms.split(';');
|
||||||
|
|
||||||
for (var alarm, i=0; i < rec.alarms.length; i++) {
|
var valarms = rec.alarms || [''];
|
||||||
alarm = String(rec.alarms[i]).split(':');
|
for (var alarm, i=0; i < valarms.length; i++) {
|
||||||
|
alarm = String(valarms[i]).split(':');
|
||||||
if (!alarm[1] && alarm[0]) alarm[1] = 'DISPLAY';
|
if (!alarm[1] && alarm[0]) alarm[1] = 'DISPLAY';
|
||||||
$('#taskedit select.edit-alarm-type').val(alarm[1]);
|
$('#taskedit select.edit-alarm-type').val(alarm[1]);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue