(fix) Save event to a different calendar

This commit is contained in:
Francis Lachapelle
2015-05-14 11:36:21 -04:00
parent ac705547e8
commit ec2b52bf7b
4 changed files with 16 additions and 1 deletions
+13
View File
@@ -617,6 +617,8 @@ static NSArray *reminderValues = nil;
NSCalendarDate *now;
NSMutableDictionary *dataWithOwner;
NSString *owner;
SOGoAppointmentFolders *folders;
id destinationCalendar;
now = [NSCalendarDate calendarDate];
owner = [componentCalendar ownerInContext: context];
@@ -626,6 +628,17 @@ static NSArray *reminderValues = nil;
[dataWithOwner setObject: owner forKey: @"owner"];
[component setAttributes: dataWithOwner inContext: context];
destinationCalendar = [data objectForKey: @"destinationCalendar"];
if ([destinationCalendar isKindOfClass: [NSString class]])
{
folders = [[context activeUser] calendarsFolderInContext: context];
componentCalendar = [folders lookupName: [destinationCalendar stringValue]
inContext: context
acquire: 0];
[componentCalendar retain];
}
[self _handleOrganizer];
if ([[self clientObject] isNew])