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 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);
|
||||
}
|
||||
|
|
|
@ -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] == '_')
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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]);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue