mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-05-21 11:25:24 +00:00
Monotone-Parent: d82fb8d772781e04d5580932b0fd265f31ee1e3b
Monotone-Revision: f4e3cbe3387384c78112b9db5195de5649161cac Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-03-19T14:33:33 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -1,3 +1,10 @@
|
||||
2007-03-19 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* UI/Scheduler/UIxComponentEditor.m ([UIxComponentEditor
|
||||
-_handleAttendeesEdition]): make sure "attendeesNames" has a
|
||||
length > 0 before computing the attendees. Otherwise there will be
|
||||
an invalid empty entry.
|
||||
|
||||
2007-03-18 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* UI/Scheduler/UIxAttendeesEditor.m): new component.
|
||||
|
||||
@@ -761,29 +761,57 @@
|
||||
iCalPerson *currentAttendee;
|
||||
|
||||
newAttendees = [NSMutableArray new];
|
||||
names = [attendeesNames componentsSeparatedByString: @","];
|
||||
emails = [attendeesEmails componentsSeparatedByString: @","];
|
||||
max = [emails count];
|
||||
for (count = 0; count < max; count++)
|
||||
if ([attendeesNames length] > 0)
|
||||
{
|
||||
currentEmail = [emails objectAtIndex: count];
|
||||
currentAttendee = [component findParticipantWithEmail: currentEmail];
|
||||
if (!currentAttendee)
|
||||
{
|
||||
currentAttendee = [iCalPerson elementWithTag: @"attendee"];
|
||||
[currentAttendee setCn: [names objectAtIndex: count]];
|
||||
[currentAttendee setEmail: currentEmail];
|
||||
[currentAttendee setRole: @"REQ-PARTICIPANT"];
|
||||
[currentAttendee
|
||||
setParticipationStatus: iCalPersonPartStatNeedsAction];
|
||||
}
|
||||
[newAttendees addObject: currentAttendee];
|
||||
names = [attendeesNames componentsSeparatedByString: @","];
|
||||
emails = [attendeesEmails componentsSeparatedByString: @","];
|
||||
max = [emails count];
|
||||
for (count = 0; count < max; count++)
|
||||
{
|
||||
currentEmail = [emails objectAtIndex: count];
|
||||
currentAttendee = [component findParticipantWithEmail: currentEmail];
|
||||
if (!currentAttendee)
|
||||
{
|
||||
currentAttendee = [iCalPerson elementWithTag: @"attendee"];
|
||||
[currentAttendee setCn: [names objectAtIndex: count]];
|
||||
[currentAttendee setEmail: currentEmail];
|
||||
[currentAttendee setRole: @"REQ-PARTICIPANT"];
|
||||
[currentAttendee
|
||||
setParticipationStatus: iCalPersonPartStatNeedsAction];
|
||||
}
|
||||
[newAttendees addObject: currentAttendee];
|
||||
}
|
||||
}
|
||||
|
||||
[component setAttendees: newAttendees];
|
||||
[newAttendees release];
|
||||
}
|
||||
|
||||
- (void) _handleOrganizer
|
||||
{
|
||||
NSString *organizerEmail;
|
||||
|
||||
organizerEmail = [[component organizer] email];
|
||||
if ([organizerEmail length] == 0)
|
||||
{
|
||||
if ([[component attendees] count] > 0)
|
||||
{
|
||||
ASSIGN (organizer, [iCalPerson elementWithTag: @"organizer"]);
|
||||
[organizer setCn: [self cnForUser]];
|
||||
[organizer setEmail: [self emailForUser]];
|
||||
[component setOrganizer: organizer];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ([[component attendees] count] == 0)
|
||||
{
|
||||
ASSIGN (organizer, [iCalPerson elementWithTag: @"organizer"]);
|
||||
[component setOrganizer: organizer];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (void) takeValuesFromRequest: (WORequest *) _rq
|
||||
inContext: (WOContext *) _ctx
|
||||
{
|
||||
@@ -796,18 +824,15 @@
|
||||
[component setLocation: location];
|
||||
[component setComment: comment];
|
||||
[component setUrl: url];
|
||||
[self _handleAttendeesEdition];
|
||||
[self _handleOrganizer];
|
||||
if ([[self clientObject] isNew])
|
||||
{
|
||||
ASSIGN (organizer, [iCalPerson elementWithTag: @"organizer"]);
|
||||
[organizer setCn: [self cnForUser]];
|
||||
[organizer setEmail: [self emailForUser]];
|
||||
[component setOrganizer: organizer];
|
||||
[component setCreated: now];
|
||||
[component setTimeStampAsDate: now];
|
||||
[component setPriority: @"0"];
|
||||
}
|
||||
[component setLastModified: now];
|
||||
[self _handleAttendeesEdition];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user