See ChangeLog.
Monotone-Parent: ef272f61d0caedee9632010cd4b3ce928a2da43e Monotone-Revision: 6ed6359462b26ed18e75361bf078fb93cda23519 Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2012-01-13T17:20:58maint-2.0.2
parent
2688dd85d6
commit
0fffe85b9b
21
ChangeLog
21
ChangeLog
|
@ -1,3 +1,24 @@
|
||||||
|
2012-01-13 Francis Lachapelle <flachapelle@inverse.ca>
|
||||||
|
|
||||||
|
* SoObjects/Appointments/SOGoAppointmentFolder.m
|
||||||
|
(-caldavFreeBusyRequestOnRecipient:withUID:andOrganizer:from:to:):
|
||||||
|
if the recipient is not associated to a user (from an
|
||||||
|
authentication source), verify if it is a contact (from an
|
||||||
|
addressbook source). If it is, SOGoFreeBusyObject will take care
|
||||||
|
of fetching the freebusy information if the contact is associated
|
||||||
|
to a MS Exchange server.
|
||||||
|
|
||||||
|
* SoObjects/Appointments/SOGoFreeBusyObject.m
|
||||||
|
(-iCalPersonWithUID:): if no user is found from an authentication
|
||||||
|
source, verify if it matches a contact from an addressbook
|
||||||
|
source.
|
||||||
|
(-contentAsStringWithMethod:andUID:andOrganizer:andContact:from:to:):
|
||||||
|
added new parameter "contactID".
|
||||||
|
|
||||||
|
* SoObjects/Appointments/iCalPerson+SOGo.m (-contactIDInContext:):
|
||||||
|
new method that tries to associated the person's email address to
|
||||||
|
a contact ID.
|
||||||
|
|
||||||
2012-01-12 Francis Lachapelle <flachapelle@inverse.ca>
|
2012-01-12 Francis Lachapelle <flachapelle@inverse.ca>
|
||||||
|
|
||||||
* SoObjects/SOGo/SOGoSource.h (-bindDN, -bindPassword)
|
* SoObjects/SOGo/SOGoSource.h (-bindDN, -bindPassword)
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2007-2011 Inverse inc.
|
Copyright (C) 2007-2012 Inverse inc.
|
||||||
Copyright (C) 2004-2005 SKYRIX Software AG
|
Copyright (C) 2004-2005 SKYRIX Software AG
|
||||||
|
|
||||||
This file is part of SOGo.
|
This file is part of SOGo.
|
||||||
|
@ -1820,7 +1820,7 @@ firstInstanceCalendarDateRange: (NGCalendarDateRange *) fir
|
||||||
to: (NSCalendarDate *) to
|
to: (NSCalendarDate *) to
|
||||||
{
|
{
|
||||||
SOGoUser *user;
|
SOGoUser *user;
|
||||||
NSString *login, *calendarData;
|
NSString *login, *contactId, *calendarData;
|
||||||
SOGoFreeBusyObject *freebusy;
|
SOGoFreeBusyObject *freebusy;
|
||||||
|
|
||||||
login = [recipient uid];
|
login = [recipient uid];
|
||||||
|
@ -1833,8 +1833,21 @@ firstInstanceCalendarDateRange: (NGCalendarDateRange *) fir
|
||||||
calendarData = [freebusy contentAsStringWithMethod: @"REPLY"
|
calendarData = [freebusy contentAsStringWithMethod: @"REPLY"
|
||||||
andUID: uid
|
andUID: uid
|
||||||
andOrganizer: organizer
|
andOrganizer: organizer
|
||||||
|
andContact: nil
|
||||||
from: start to: to];
|
from: start to: to];
|
||||||
}
|
}
|
||||||
|
else if ((contactId = [recipient contactIDInContext: context]))
|
||||||
|
{
|
||||||
|
user = [context activeUser];
|
||||||
|
freebusy = [[user homeFolderInContext: context]
|
||||||
|
freeBusyObject: @"freebusy.ifb"
|
||||||
|
inContext: context];
|
||||||
|
calendarData = [freebusy contentAsStringWithMethod: @"REPLY"
|
||||||
|
andUID: uid
|
||||||
|
andOrganizer: organizer
|
||||||
|
andContact: contactId
|
||||||
|
from: start to: to];
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
user = nil;
|
user = nil;
|
||||||
|
@ -1947,8 +1960,8 @@ firstInstanceCalendarDateRange: (NGCalendarDateRange *) fir
|
||||||
tags = [self caldavFreeBusyRequest: (iCalFreeBusy *) element];
|
tags = [self caldavFreeBusyRequest: (iCalFreeBusy *) element];
|
||||||
else if ([tag isEqualToString: @"VEVENT"])
|
else if ([tag isEqualToString: @"VEVENT"])
|
||||||
tags = [self caldavEventRequest: (iCalEvent *) element
|
tags = [self caldavEventRequest: (iCalEvent *) element
|
||||||
withContent: iCalString
|
withContent: iCalString
|
||||||
from: originator to: recipients];
|
from: originator to: recipients];
|
||||||
else
|
else
|
||||||
tags = nil;
|
tags = nil;
|
||||||
|
|
||||||
|
|
|
@ -48,6 +48,7 @@
|
||||||
- (NSString *) contentAsStringWithMethod: (NSString *) method
|
- (NSString *) contentAsStringWithMethod: (NSString *) method
|
||||||
andUID: (NSString *) uid
|
andUID: (NSString *) uid
|
||||||
andOrganizer: (iCalPerson *) organizer
|
andOrganizer: (iCalPerson *) organizer
|
||||||
|
andContact: (NSString *) contactID
|
||||||
from: (NSCalendarDate *) _startDate
|
from: (NSCalendarDate *) _startDate
|
||||||
to: (NSCalendarDate *) _endDate;
|
to: (NSCalendarDate *) _endDate;
|
||||||
|
|
||||||
|
@ -55,7 +56,7 @@
|
||||||
to: (NSCalendarDate *) _endDate;
|
to: (NSCalendarDate *) _endDate;
|
||||||
- (NSArray *) fetchFreeBusyInfosFrom: (NSCalendarDate *) startDate
|
- (NSArray *) fetchFreeBusyInfosFrom: (NSCalendarDate *) startDate
|
||||||
to: (NSCalendarDate *) endDate
|
to: (NSCalendarDate *) endDate
|
||||||
forUser: (NSString *) uid;
|
forContact: (NSString *) uid;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
#endif /* __Appointments_SOGoFreeBusyObject_H_ */
|
#endif /* __Appointments_SOGoFreeBusyObject_H_ */
|
||||||
|
|
|
@ -61,10 +61,20 @@
|
||||||
{
|
{
|
||||||
iCalPerson *person;
|
iCalPerson *person;
|
||||||
SOGoUserManager *um;
|
SOGoUserManager *um;
|
||||||
|
NSString *domain;
|
||||||
NSDictionary *contactInfos;
|
NSDictionary *contactInfos;
|
||||||
|
NSArray *contacts;
|
||||||
|
|
||||||
um = [SOGoUserManager sharedUserManager];
|
um = [SOGoUserManager sharedUserManager];
|
||||||
contactInfos = [um contactInfosForUserWithUIDorEmail: uid];
|
contactInfos = [um contactInfosForUserWithUIDorEmail: uid];
|
||||||
|
if (contactInfos == nil)
|
||||||
|
{
|
||||||
|
domain = [[context activeUser] domain];
|
||||||
|
[um fetchContactsMatching: uid inDomain: domain];
|
||||||
|
contacts = [um fetchContactsMatching: uid inDomain: domain];
|
||||||
|
if ([contacts count] == 1)
|
||||||
|
contactInfos = [contacts lastObject];
|
||||||
|
}
|
||||||
|
|
||||||
/* iCal.app compatibility:
|
/* iCal.app compatibility:
|
||||||
- don't add "cn"; */
|
- don't add "cn"; */
|
||||||
|
@ -96,6 +106,7 @@
|
||||||
withMethod: (NSString *) method
|
withMethod: (NSString *) method
|
||||||
andUID: (NSString *) uid
|
andUID: (NSString *) uid
|
||||||
andOrganizer: (iCalPerson *) organizer
|
andOrganizer: (iCalPerson *) organizer
|
||||||
|
andContact: (NSString *) contactID
|
||||||
from: (NSCalendarDate *) _startDate
|
from: (NSCalendarDate *) _startDate
|
||||||
to: (NSCalendarDate *) _endDate
|
to: (NSCalendarDate *) _endDate
|
||||||
{
|
{
|
||||||
|
@ -125,7 +136,10 @@
|
||||||
[freebusy setUid: uid];
|
[freebusy setUid: uid];
|
||||||
if (organizer)
|
if (organizer)
|
||||||
[freebusy setOrganizer: organizer];
|
[freebusy setOrganizer: organizer];
|
||||||
[freebusy addToAttendees: [self iCalPersonWithUID: login]];
|
if (contactID)
|
||||||
|
[freebusy addToAttendees: [self iCalPersonWithUID: contactID]];
|
||||||
|
else
|
||||||
|
[freebusy addToAttendees: [self iCalPersonWithUID: login]];
|
||||||
[freebusy setTimeStampAsDate: [NSCalendarDate calendarDate]];
|
[freebusy setTimeStampAsDate: [NSCalendarDate calendarDate]];
|
||||||
[freebusy setStartDate: _startDate];
|
[freebusy setStartDate: _startDate];
|
||||||
[freebusy setEndDate: _endDate];
|
[freebusy setEndDate: _endDate];
|
||||||
|
@ -223,16 +237,19 @@
|
||||||
- (NSString *) contentAsStringWithMethod: (NSString *) method
|
- (NSString *) contentAsStringWithMethod: (NSString *) method
|
||||||
andUID: (NSString *) UID
|
andUID: (NSString *) UID
|
||||||
andOrganizer: (iCalPerson *) organizer
|
andOrganizer: (iCalPerson *) organizer
|
||||||
|
andContact: (NSString *) contactID
|
||||||
from: (NSCalendarDate *) _startDate
|
from: (NSCalendarDate *) _startDate
|
||||||
to: (NSCalendarDate *) _endDate
|
to: (NSCalendarDate *) _endDate
|
||||||
{
|
{
|
||||||
NSArray *infos;
|
NSArray *infos;
|
||||||
|
|
||||||
infos = [self fetchFreeBusyInfosFrom: _startDate to: _endDate];
|
infos = [self fetchFreeBusyInfosFrom: _startDate to: _endDate
|
||||||
|
forContact: contactID];
|
||||||
|
|
||||||
return [self iCalStringForFreeBusyInfos: infos
|
return [self iCalStringForFreeBusyInfos: infos
|
||||||
withMethod: method
|
withMethod: method
|
||||||
andUID: UID andOrganizer: organizer
|
andUID: UID andOrganizer: organizer
|
||||||
|
andContact: contactID
|
||||||
from: _startDate to: _endDate];
|
from: _startDate to: _endDate];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -241,6 +258,7 @@
|
||||||
{
|
{
|
||||||
return [self contentAsStringWithMethod: nil andUID: nil
|
return [self contentAsStringWithMethod: nil andUID: nil
|
||||||
andOrganizer: nil
|
andOrganizer: nil
|
||||||
|
andContact: nil
|
||||||
from: _startDate
|
from: _startDate
|
||||||
to: _endDate];
|
to: _endDate];
|
||||||
}
|
}
|
||||||
|
@ -251,31 +269,31 @@
|
||||||
* (currently limited to a Microsoft Exchange server with Web Services enabled).
|
* (currently limited to a Microsoft Exchange server with Web Services enabled).
|
||||||
* @param startDate the beginning of the covered period
|
* @param startDate the beginning of the covered period
|
||||||
* @param endDate the ending of the covered period
|
* @param endDate the ending of the covered period
|
||||||
* @param uid the ID of the user within the current domain
|
* @param uid the ID of the contact within the current domain
|
||||||
* @return an array of dictionaries containing the start and end dates of each busy period
|
* @return an array of dictionaries containing the start and end dates of each busy period
|
||||||
* @see MSExchangeFreeBusy.m
|
* @see MSExchangeFreeBusy.m
|
||||||
*/
|
*/
|
||||||
- (NSArray *) fetchFreeBusyInfosFrom: (NSCalendarDate *) startDate
|
- (NSArray *) fetchFreeBusyInfosFrom: (NSCalendarDate *) startDate
|
||||||
to: (NSCalendarDate *) endDate
|
to: (NSCalendarDate *) endDate
|
||||||
forUser: (NSString *) uid
|
forContact: (NSString *) uid
|
||||||
{
|
{
|
||||||
if ([uid length])
|
if ([uid length])
|
||||||
{
|
{
|
||||||
SOGoUserManager *um;
|
SOGoUserManager *um;
|
||||||
NSArray *users;
|
NSArray *contacts;
|
||||||
NSString *domain, *email;
|
NSString *domain, *email;
|
||||||
NSDictionary *user;
|
NSDictionary *contact;
|
||||||
MSExchangeFreeBusy *exchangeFreeBusy;
|
MSExchangeFreeBusy *exchangeFreeBusy;
|
||||||
NSObject <SOGoDNSource> *source;
|
NSObject <SOGoDNSource> *source;
|
||||||
|
|
||||||
um = [SOGoUserManager sharedUserManager];
|
um = [SOGoUserManager sharedUserManager];
|
||||||
domain = [[context activeUser] domain];
|
domain = [[context activeUser] domain];
|
||||||
users = [um fetchContactsMatching: uid inDomain: domain];
|
contacts = [um fetchContactsMatching: uid inDomain: domain];
|
||||||
if ([users count] == 1)
|
if ([contacts count] == 1)
|
||||||
{
|
{
|
||||||
user = [users lastObject];
|
contact = [contacts lastObject];
|
||||||
email = [user valueForKey: @"c_email"];
|
email = [contact valueForKey: @"c_email"];
|
||||||
source = [user objectForKey: @"source"];
|
source = [contact objectForKey: @"source"];
|
||||||
if ([email length])
|
if ([email length])
|
||||||
{
|
{
|
||||||
exchangeFreeBusy = [[MSExchangeFreeBusy alloc] init];
|
exchangeFreeBusy = [[MSExchangeFreeBusy alloc] init];
|
||||||
|
|
|
@ -31,6 +31,7 @@
|
||||||
|
|
||||||
- (NSString *) mailAddress;
|
- (NSString *) mailAddress;
|
||||||
- (NSString *) uid;
|
- (NSString *) uid;
|
||||||
|
- (NSString *) contactIDInContext: (WOContext *) context;
|
||||||
- (BOOL) hasSentBy;
|
- (BOOL) hasSentBy;
|
||||||
- (NSString *) sentBy;
|
- (NSString *) sentBy;
|
||||||
|
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
|
|
||||||
#import <Foundation/NSString.h>
|
#import <Foundation/NSString.h>
|
||||||
#import <SOGo/SOGoUserManager.h>
|
#import <SOGo/SOGoUserManager.h>
|
||||||
|
#import <NGObjWeb/WOContext+SoObjects.h>
|
||||||
|
|
||||||
#import "iCalPerson+SOGo.h"
|
#import "iCalPerson+SOGo.h"
|
||||||
|
|
||||||
|
@ -51,6 +52,27 @@ static SOGoUserManager *um = nil;
|
||||||
return [um getUIDForEmail: [self rfc822Email]];
|
return [um getUIDForEmail: [self rfc822Email]];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (NSString *) contactIDInContext: (WOContext *) context
|
||||||
|
{
|
||||||
|
NSString *domain, *uid;
|
||||||
|
NSArray *contacts;
|
||||||
|
NSDictionary *contact;
|
||||||
|
|
||||||
|
if (!um)
|
||||||
|
um = [SOGoUserManager sharedUserManager];
|
||||||
|
|
||||||
|
uid = nil;
|
||||||
|
domain = [[context activeUser] domain];
|
||||||
|
contacts = [um fetchContactsMatching: [self rfc822Email] inDomain: domain];
|
||||||
|
if ([contacts count] == 1)
|
||||||
|
{
|
||||||
|
contact = [contacts lastObject];
|
||||||
|
uid = [contact valueForKey: @"c_uid"];
|
||||||
|
}
|
||||||
|
|
||||||
|
return uid;
|
||||||
|
}
|
||||||
|
|
||||||
- (BOOL) hasSentBy
|
- (BOOL) hasSentBy
|
||||||
{
|
{
|
||||||
NSString *mail;
|
NSString *mail;
|
||||||
|
|
Loading…
Reference in New Issue