From ec2b52bf7b98e38af150cc2385cfe93f6631c13a Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Thu, 14 May 2015 11:36:21 -0400 Subject: [PATCH] (fix) Save event to a different calendar --- UI/Scheduler/UIxAppointmentEditor.m | 1 + UI/Scheduler/UIxComponentEditor.m | 13 +++++++++++++ .../SchedulerUI/UIxAppointmentEditorTemplate.wox | 2 +- .../js/Scheduler/Component.service.js | 1 + 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/UI/Scheduler/UIxAppointmentEditor.m b/UI/Scheduler/UIxAppointmentEditor.m index fc9c7e39e..d32d35ffa 100644 --- a/UI/Scheduler/UIxAppointmentEditor.m +++ b/UI/Scheduler/UIxAppointmentEditor.m @@ -430,6 +430,7 @@ * * Save in [UIxComponentEditor setAttributes:] * + * @apiParam {String} [destinationCalendar] ID of destination calendar * @apiParam {Object} [organizer] Appointment organizer * @apiParam {String} organizer.name Organizer's name * @apiParam {String} organizer.email Organizer's email address diff --git a/UI/Scheduler/UIxComponentEditor.m b/UI/Scheduler/UIxComponentEditor.m index 9de1eb26f..f0cb47377 100644 --- a/UI/Scheduler/UIxComponentEditor.m +++ b/UI/Scheduler/UIxComponentEditor.m @@ -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]) diff --git a/UI/Templates/SchedulerUI/UIxAppointmentEditorTemplate.wox b/UI/Templates/SchedulerUI/UIxAppointmentEditorTemplate.wox index 88e2a7b91..adad9ff80 100644 --- a/UI/Templates/SchedulerUI/UIxAppointmentEditorTemplate.wox +++ b/UI/Templates/SchedulerUI/UIxAppointmentEditorTemplate.wox @@ -39,7 +39,7 @@
- {{calendar.name}} diff --git a/UI/WebServerResources/js/Scheduler/Component.service.js b/UI/WebServerResources/js/Scheduler/Component.service.js index bc77cd9de..6b7c8f6f3 100644 --- a/UI/WebServerResources/js/Scheduler/Component.service.js +++ b/UI/WebServerResources/js/Scheduler/Component.service.js @@ -242,6 +242,7 @@ Component.prototype.init = function(data) { this.categories = []; angular.extend(this, data); + this.destinationCalendar = this.pid; }; /**