mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-04-14 09:48:51 +00:00
(fix) Save event to a different calendar
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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])
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -242,6 +242,7 @@
|
||||
Component.prototype.init = function(data) {
|
||||
this.categories = [];
|
||||
angular.extend(this, data);
|
||||
this.destinationCalendar = this.pid;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user