(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

View File

@@ -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

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])

View File

@@ -39,7 +39,7 @@
<!-- calendar -->
<div class="pseudo-input-container">
<label class="pseudo-input-label"><var:string label:value="Calendar"/></label>
<md-select ng-model="editor.event.pid" class="pseudo-input-field"
<md-select ng-model="editor.event.destinationCalendar" class="pseudo-input-field"
label:placeholder="Calendar">
<md-option ng-repeat="calendar in ::editor.calendars"
ng-value="calendar.id">{{calendar.name}}</md-option>

View File

@@ -242,6 +242,7 @@
Component.prototype.init = function(data) {
this.categories = [];
angular.extend(this, data);
this.destinationCalendar = this.pid;
};
/**