Monotone-Parent: 8af16d6a8834b3a737ae5b5b69c3f222bd5671dd
Monotone-Revision: affe7d2d4111c2a72ec7f3cb14b36af674fcc41c Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-03-18T15:08:41 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
parent
33600bbcd0
commit
aae5e42b94
10
ChangeLog
10
ChangeLog
|
@ -1,3 +1,13 @@
|
|||
2007-03-18 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* SoObjects/Appointments/SOGoCalendarComponent.m
|
||||
([SOGoCalendarComponent -isOrganizer:emailorOwner:login]): new
|
||||
method.
|
||||
([SOGoCalendarComponent -isParticipant:email]): new method.
|
||||
([SOGoCalendarComponent -calendar:create]): takes one parameter
|
||||
"create" which is a boolean indicating whether we want to create
|
||||
the calendar if it does not exist.
|
||||
|
||||
2007-03-12 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* UI/Scheduler/UIxCalMonthView.m: changed view to use divs instead
|
||||
|
|
|
@ -35,11 +35,13 @@
|
|||
{
|
||||
iCalCalendar *calendar;
|
||||
NSString *calContent;
|
||||
BOOL isNew;
|
||||
}
|
||||
|
||||
- (NSString *) componentTag;
|
||||
- (iCalCalendar *) calendar;
|
||||
- (iCalRepeatableEntityObject *) component;
|
||||
- (iCalCalendar *) calendar: (BOOL) create;
|
||||
- (iCalRepeatableEntityObject *) component: (BOOL) create;
|
||||
- (BOOL) isNew;
|
||||
|
||||
- (NSException *) primarySaveContentString: (NSString *) _iCalString;
|
||||
- (NSException *) primaryDelete;
|
||||
|
@ -53,6 +55,10 @@
|
|||
andNewObject: (iCalRepeatableEntityObject *) _newObject
|
||||
toAttendees: (NSArray *) _attendees;
|
||||
|
||||
- (BOOL) isOrganizer: (NSString *) email
|
||||
orOwner: (NSString *) login;
|
||||
- (BOOL) isParticipant: (NSString *) email;
|
||||
|
||||
@end
|
||||
|
||||
#endif /* SOGOCALENDARCOMPONENT_H */
|
||||
|
|
|
@ -69,6 +69,7 @@ static BOOL sendEMailNotifications = NO;
|
|||
{
|
||||
calendar = nil;
|
||||
calContent = nil;
|
||||
isNew = NO;
|
||||
}
|
||||
|
||||
return self;
|
||||
|
@ -158,30 +159,49 @@ static BOOL sendEMailNotifications = NO;
|
|||
return result;
|
||||
}
|
||||
|
||||
- (iCalCalendar *) calendar
|
||||
- (iCalCalendar *) calendar: (BOOL) create
|
||||
{
|
||||
NSString *iCalString;
|
||||
NSString *iCalString, *componentTag;
|
||||
CardGroup *newComponent;
|
||||
|
||||
if (!calendar)
|
||||
{
|
||||
iCalString = [self contentAsString];
|
||||
if (iCalString)
|
||||
{
|
||||
if ([iCalString length] > 0)
|
||||
calendar = [iCalCalendar parseSingleFromSource: iCalString];
|
||||
[calendar retain];
|
||||
else
|
||||
{
|
||||
if (create)
|
||||
{
|
||||
calendar = [iCalCalendar groupWithTag: @"vcalendar"];
|
||||
[calendar setVersion: @"2.0"];
|
||||
[calendar setProdID: @"-//Inverse groupe conseil//SOGo 0.9//EN"];
|
||||
componentTag = [[self componentTag] uppercaseString];
|
||||
newComponent = [[calendar classForTag: componentTag]
|
||||
groupWithTag: componentTag];
|
||||
[calendar addChild: newComponent];
|
||||
isNew = YES;
|
||||
}
|
||||
}
|
||||
if (calendar)
|
||||
[calendar retain];
|
||||
}
|
||||
|
||||
return calendar;
|
||||
}
|
||||
|
||||
- (iCalRepeatableEntityObject *) component
|
||||
- (iCalRepeatableEntityObject *) component: (BOOL) create
|
||||
{
|
||||
return (iCalRepeatableEntityObject *)
|
||||
[[self calendar]
|
||||
[[self calendar: create]
|
||||
firstChildWithTag: [self componentTag]];
|
||||
}
|
||||
|
||||
- (BOOL) isNew
|
||||
{
|
||||
return isNew;
|
||||
}
|
||||
|
||||
/* raw saving */
|
||||
|
||||
- (NSException *) primarySaveContentString: (NSString *) _iCalString
|
||||
|
@ -376,7 +396,7 @@ static BOOL sendEMailNotifications = NO;
|
|||
um = [AgenorUserManager sharedUserManager];
|
||||
email = [um getEmailForUID: login];
|
||||
|
||||
component = [self component];
|
||||
component = [self component: NO];
|
||||
if (component)
|
||||
{
|
||||
if ([component isOrganizer: email])
|
||||
|
@ -397,4 +417,36 @@ static BOOL sendEMailNotifications = NO;
|
|||
return sogoRoles;
|
||||
}
|
||||
|
||||
- (BOOL) isOrganizer: (NSString *) email
|
||||
orOwner: (NSString *) login
|
||||
{
|
||||
BOOL isOrganizerOrOwner;
|
||||
iCalRepeatableEntityObject *component;
|
||||
|
||||
component = [self component: NO];
|
||||
if (component)
|
||||
isOrganizerOrOwner
|
||||
= ([component isOrganizer: email]
|
||||
|| [[container ownerInContext: nil] isEqualToString: login]);
|
||||
else
|
||||
isOrganizerOrOwner
|
||||
= [[container ownerInContext: nil] isEqualToString: login];
|
||||
|
||||
return isOrganizerOrOwner;
|
||||
}
|
||||
|
||||
- (BOOL) isParticipant: (NSString *) email
|
||||
{
|
||||
BOOL isParticipant;
|
||||
iCalRepeatableEntityObject *component;
|
||||
|
||||
component = [self component: NO];
|
||||
if (component)
|
||||
isParticipant = [component isParticipant: email];
|
||||
else
|
||||
isParticipant = NO;
|
||||
|
||||
return isParticipant;
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
Loading…
Reference in a new issue