Monotone-Parent: e83eef1534d09f346a018e039db3a6c578d0b4d3

Monotone-Revision: 709114ee2583e1d5dd3a0b7418932cc584f38d0f

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2006-10-31T18:54:56
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2006-10-31 18:54:56 +00:00
parent 1f1a83ab7e
commit 6eb08e6939
2 changed files with 40 additions and 0 deletions

View File

@@ -1,5 +1,13 @@
2006-10-31 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* SoObjects/Appointments/SOGoAppointmentObject.m
([SOGoAppointmentObject
-saveContentString:contentStringbaseVersion:baseVersion]):
overloaded method that parse new events and detects if they have
an organizer or not. If they are new and have no organizer set
(Sunbird/Lightning...), the owner of the event is set as
organizer.
* SoObjects/Appointments/iCalEntityObject+Agenor.[hm]: new
category that provides facility methods and interfaces to the
AgenorUserManager.

View File

@@ -29,7 +29,10 @@
#import <NGMime/NGMime.h>
#import <NGMail/NGMail.h>
#import <NGMail/NGSendMail.h>
#import "SOGoAptMailNotification.h"
#import "iCalEntityObject+Agenor.h"
#import "common.h"
#import "NSArray+Appointments.h"
@@ -507,6 +510,7 @@ static NSString *mailTemplateDefaultLanguage = nil;
- (NSException *)saveContentString:(NSString *)_iCalString {
return [self saveContentString:_iCalString baseSequence:0];
}
- (NSException *)delete {
return [self deleteWithBaseSequence:0];
}
@@ -610,6 +614,34 @@ static NSString *mailTemplateDefaultLanguage = nil;
return [self serverTimeZone];
}
- (NSException *) saveContentString: (NSString *) contentString
baseVersion: (unsigned int) baseVersion
{
NSString *newContentString, *oldContentString;
iCalCalendar *eventCalendar;
iCalEvent *event;
NSArray *organizers;
oldContentString = [self iCalString];
if (oldContentString)
newContentString = contentString;
else
{
eventCalendar = [iCalCalendar parseSingleFromSource: contentString];
event = [self firstEventFromCalendar: eventCalendar];
organizers = [event childrenWithTag: @"organizer"];
if ([organizers count])
newContentString = contentString;
else
{
[event setOrganizerWithUid: [self ownerInContext: nil]];
newContentString = [eventCalendar versitString];
}
}
return [super saveContentString: newContentString
baseVersion: baseVersion];
}
- (void)sendEMailUsingTemplateNamed:(NSString *)_pageName
forOldAppointment:(iCalEvent *)_oldApt