mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-08-19 13:43:22 +00:00
Added invitation delegation support in Web interface. See ChangeLog.
Monotone-Parent: 4d711e074341810486c1842c6a345777cc3664bb Monotone-Revision: 2fc8598099b516f243935e73039200f1c004784e Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2009-09-10T18:31:20 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -46,6 +46,7 @@
|
||||
#import <SoObjects/SOGo/SOGoDateFormatter.h>
|
||||
#import <SoObjects/SOGo/SOGoContentObject.h>
|
||||
#import <SoObjects/SOGo/SOGoPermissions.h>
|
||||
#import <SoObjects/Appointments/iCalPerson+SOGo.h>
|
||||
#import <SoObjects/Appointments/SOGoAppointmentFolder.h>
|
||||
#import <SoObjects/Appointments/SOGoAppointmentObject.h>
|
||||
#import <SoObjects/Appointments/SOGoAppointmentOccurence.h>
|
||||
@@ -530,4 +531,52 @@
|
||||
return self;
|
||||
}
|
||||
|
||||
- (id) delegateAction
|
||||
{
|
||||
// BOOL receiveUpdates;
|
||||
NSString *delegatedEmail, *delegatedUid;
|
||||
iCalPerson *delegatedAttendee;
|
||||
SOGoUser *user;
|
||||
WORequest *request;
|
||||
WOResponse *response;
|
||||
|
||||
response = nil;
|
||||
request = [context request];
|
||||
delegatedEmail = [request formValueForKey: @"to"];
|
||||
if ([delegatedEmail length])
|
||||
{
|
||||
user = [context activeUser];
|
||||
delegatedAttendee = [iCalPerson new];
|
||||
[delegatedAttendee setEmail: delegatedEmail];
|
||||
delegatedUid = [delegatedAttendee uid];
|
||||
if (delegatedUid)
|
||||
{
|
||||
SOGoUser *delegatedUser;
|
||||
delegatedUser = [SOGoUser userWithLogin: delegatedUid];
|
||||
[delegatedAttendee setCn: [delegatedUser cn]];
|
||||
}
|
||||
|
||||
[delegatedAttendee setRole: @"REQ-PARTICIPANT"];
|
||||
[delegatedAttendee setRsvp: @"TRUE"];
|
||||
[delegatedAttendee setParticipationStatus: iCalPersonPartStatNeedsAction];
|
||||
[delegatedAttendee setDelegatedFrom:
|
||||
[NSString stringWithFormat: @"mailto:%@", [[user allEmails] objectAtIndex: 0]]];
|
||||
|
||||
// receiveUpdates = [[request formValueForKey: @"receiveUpdates"] boolValue];
|
||||
// if (receiveUpdates)
|
||||
// [delegatedAttendee setRole: @"NON-PARTICIPANT"];
|
||||
|
||||
response = (WOResponse*)[[self clientObject] changeParticipationStatus: @"DELEGATED"
|
||||
withDelegate: delegatedAttendee];
|
||||
}
|
||||
else
|
||||
response = [NSException exceptionWithHTTPStatus: 400
|
||||
reason: @"missing 'to' parameter"];
|
||||
|
||||
if (!response)
|
||||
response = [self responseWithStatus: 200];
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user