mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-09-16 02:48:00 +00:00
feat(calendar(web)): allow to change the classification of an event
This commit is contained in:
@@ -285,27 +285,35 @@
|
||||
* @apiParam {String} alarm.relation Either START or END
|
||||
* @apiParam {Boolean} [alarm.attendees] Alert attendees by email if 1 and action is email
|
||||
* @apiParam {Boolean} [alarm.organizer] Alert organizer by email if 1 and action is email
|
||||
* @apiParam {String} [classification] Either public, confidential or private
|
||||
*/
|
||||
- (id <WOActionResults>) rsvpAction
|
||||
{
|
||||
static NSArray *validClassifications = nil;
|
||||
iCalPerson *delegatedAttendee;
|
||||
NSDictionary *params, *jsonResponse;
|
||||
WOResponse *response;
|
||||
WORequest *request;
|
||||
iCalAlarm *anAlarm;
|
||||
iCalEvent *event;
|
||||
NSException *ex;
|
||||
NSString *status;
|
||||
id alarm;
|
||||
id alarm, classification;
|
||||
|
||||
int replyList;
|
||||
|
||||
if (!validClassifications)
|
||||
validClassifications = [[NSArray alloc] initWithObjects: @"PUBLIC", @"CONFIDENTIAL", @"PRIVATE", nil];
|
||||
|
||||
request = [context request];
|
||||
params = [[request contentAsString] objectFromJSONString];
|
||||
event = [self event];
|
||||
|
||||
delegatedAttendee = nil;
|
||||
anAlarm = nil;
|
||||
status = nil;
|
||||
|
||||
// Set invitation reply
|
||||
replyList = [[params objectForKey: @"reply"] intValue];
|
||||
|
||||
switch (replyList)
|
||||
@@ -368,6 +376,25 @@
|
||||
break;
|
||||
}
|
||||
|
||||
// Update classification
|
||||
classification = [params objectForKey: @"classification"];
|
||||
if (classification &&
|
||||
[classification isKindOfClass: [NSString class]] &&
|
||||
[validClassifications containsObject: [classification uppercaseString]] &&
|
||||
![[classification uppercaseString] isEqualToString: [event accessClass]])
|
||||
{
|
||||
[event setAccessClass: [classification uppercaseString]];
|
||||
ex = [[self clientObject] saveComponent: event force: NO];
|
||||
if (ex)
|
||||
{
|
||||
jsonResponse = [NSDictionary dictionaryWithObjectsAndKeys:
|
||||
[ex reason], @"message",
|
||||
nil];
|
||||
return [self responseWithStatus: [ex httpStatus]
|
||||
andString: [jsonResponse jsonRepresentation]];
|
||||
}
|
||||
}
|
||||
|
||||
// Set an alarm for the user
|
||||
alarm = [params objectForKey: @"alarm"];
|
||||
if ([alarm isKindOfClass: [NSDictionary class]])
|
||||
|
||||
Reference in New Issue
Block a user