From: wolfgang Date: Thu, 29 Nov 2007 19:45:45 +0000 (+0000) Subject: git-svn-id: http://svn.opengroupware.org/SOGo/inverse/trunk@1284 d1b88da0-ebda-0310... X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9e3d5303a216882ae60204c48cb5d7c4c10cf4e4;p=scalable-opengroupware.org git-svn-id: http://svn.opengroupware.org/SOGo/inverse/trunk@1284 d1b88da0-ebda-0310-925b-ed51d893ca5b --- diff --git a/ChangeLog b/ChangeLog index 716be005..d508c9f1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,13 @@ 2007-11-29 Wolfgang Sourdeau + * SoObjects/SOGo/SOGoContentObject.m ([SOGoContentObject + -ocsPathOfContainer]): return the intended value, not that of + ocsPath... + + * SoObjects/Appointments/SOGoCalendarComponent.m + ([SOGoCalendarComponent -sendResponseToOrganizer]): send the + message only of sendEMailNotifications is set. + * SoObjects/SOGo/SOGoObject.m ([SOGoObject -subscriptionRoles]): new method that returns the roles that qualifies for adding the special "authorized subscribed" sogo role. diff --git a/SOPE/NGCards/ChangeLog b/SOPE/NGCards/ChangeLog index e13917d6..3ddc7293 100644 --- a/SOPE/NGCards/ChangeLog +++ b/SOPE/NGCards/ChangeLog @@ -1,3 +1,8 @@ +2007-11-29 Wolfgang Sourdeau + + * iCalDateTime.m ([iCalDateTime -timeZone]): log a message if the + corresponding timezone isn't found. + 2007-11-26 Wolfgang Sourdeau * iCalCalendar.m ([iCalCalendar -versitString]): same as below, diff --git a/SOPE/NGCards/iCalDateTime.m b/SOPE/NGCards/iCalDateTime.m index 127be961..159545e8 100644 --- a/SOPE/NGCards/iCalDateTime.m +++ b/SOPE/NGCards/iCalDateTime.m @@ -23,6 +23,8 @@ #import #import +#import + #import "NSCalendarDate+NGCards.h" #import "NSString+NGCards.h" @@ -76,13 +78,17 @@ NSString *tzId; iCalTimeZone *timeZone; + timeZone = nil; + tzId = [self value: 0 ofAttribute: @"tzid"]; - calendar - = (iCalCalendar *) [self searchParentOfClass: [iCalCalendar class]]; - if ([tzId length] && calendar) - timeZone = [calendar timeZoneWithId: tzId]; - else - timeZone = nil; + if ([tzId length]) + { + calendar + = (iCalCalendar *) [self searchParentOfClass: [iCalCalendar class]]; + timeZone = [calendar timeZoneWithId: tzId]; + if (!timeZone) + [self logWithFormat: @"timezone '%@' not found in calendar", tzId]; + } return timeZone; } diff --git a/SoObjects/Appointments/SOGoCalendarComponent.m b/SoObjects/Appointments/SOGoCalendarComponent.m index 10274987..4236a620 100644 --- a/SoObjects/Appointments/SOGoCalendarComponent.m +++ b/SoObjects/Appointments/SOGoCalendarComponent.m @@ -364,79 +364,82 @@ static BOOL sendEMailNotifications = NO; NGMimeMultipartBody *body; NSData *bodyData; - event = [[self component: NO secure: NO] itipEntryWithMethod: @"reply"]; - if (![event userIsOrganizer: [context activeUser]]) + if (sendEMailNotifications) { - organizer = [event organizer]; - attendee = [event findParticipant: [context activeUser]]; - [event setAttendees: [NSArray arrayWithObject: attendee]]; - - /* get WOApplication instance */ - app = [WOApplication application]; - - language = [[context activeUser] language]; - /* create page name */ - pageName - = [NSString stringWithFormat: @"SOGoAptMail%@ICalReply", language]; - /* construct message content */ - p = [app pageWithName: pageName inContext: context]; - [p setApt: event]; - [p setAttendee: attendee]; - - /* construct message */ - headerMap = [NGMutableHashMap hashMapWithCapacity: 5]; + event = [[self component: NO secure: NO] itipEntryWithMethod: @"reply"]; + if (![event userIsOrganizer: [context activeUser]]) + { + organizer = [event organizer]; + attendee = [event findParticipant: [context activeUser]]; + [event setAttendees: [NSArray arrayWithObject: attendee]]; + + /* get WOApplication instance */ + app = [WOApplication application]; + + language = [[context activeUser] language]; + /* create page name */ + pageName + = [NSString stringWithFormat: @"SOGoAptMail%@ICalReply", language]; + /* construct message content */ + p = [app pageWithName: pageName inContext: context]; + [p setApt: event]; + [p setAttendee: attendee]; + + /* construct message */ + headerMap = [NGMutableHashMap hashMapWithCapacity: 5]; - /* NOTE: multipart/alternative seems like the correct choice but - * unfortunately Thunderbird doesn't offer the rich content alternative - * at all. Mail.app shows the rich content alternative _only_ - * so we'll stick with multipart/mixed for the time being. - */ - [headerMap setObject: @"multipart/mixed" forKey: @"content-type"]; - [headerMap setObject: [attendee mailAddress] forKey: @"From"]; - [headerMap setObject: [organizer mailAddress] forKey: @"To"]; - mailDate = [[NSCalendarDate date] rfc822DateString]; - [headerMap setObject: mailDate forKey: @"date"]; - [headerMap setObject: [p getSubject] forKey: @"Subject"]; - msg = [NGMimeMessage messageWithHeader: headerMap]; - - NSLog (@"sending 'REPLY' from %@ to %@", - [attendee mailAddress], [organizer mailAddress]); - - /* multipart body */ - body = [[NGMimeMultipartBody alloc] initWithPart: msg]; - - /* text part */ - headerMap = [NGMutableHashMap hashMapWithCapacity: 1]; - [headerMap setObject: @"text/plain; charset=utf-8" - forKey: @"content-type"]; - bodyPart = [NGMimeBodyPart bodyPartWithHeader: headerMap]; - bodyData = [[p getBody] dataUsingEncoding: NSUTF8StringEncoding]; - [bodyPart setBody: bodyData]; - - /* attach text part to multipart body */ - [body addBodyPart: bodyPart]; - - /* calendar part */ - headerMap = [NGMutableHashMap hashMapWithCapacity: 1]; - [headerMap setObject: @"text/calendar; method=REPLY; charset=utf-8" - forKey: @"content-type"]; - bodyPart = [NGMimeBodyPart bodyPartWithHeader: headerMap]; - iCalString = [[event parent] versitString]; - [bodyPart setBody: [iCalString dataUsingEncoding: NSUTF8StringEncoding]]; - - /* attach calendar part to multipart body */ - [body addBodyPart: bodyPart]; - - /* attach multipart body to message */ - [msg setBody: body]; - [body release]; - - /* send the damn thing */ - email = [organizer rfc822Email]; - [[SOGoMailer sharedMailer] - sendMimePart: msg - toRecipients: [NSArray arrayWithObject: email] - sender: [attendee rfc822Email]]; + /* NOTE: multipart/alternative seems like the correct choice but + * unfortunately Thunderbird doesn't offer the rich content alternative + * at all. Mail.app shows the rich content alternative _only_ + * so we'll stick with multipart/mixed for the time being. + */ + [headerMap setObject: @"multipart/mixed" forKey: @"content-type"]; + [headerMap setObject: [attendee mailAddress] forKey: @"From"]; + [headerMap setObject: [organizer mailAddress] forKey: @"To"]; + mailDate = [[NSCalendarDate date] rfc822DateString]; + [headerMap setObject: mailDate forKey: @"date"]; + [headerMap setObject: [p getSubject] forKey: @"Subject"]; + msg = [NGMimeMessage messageWithHeader: headerMap]; + + NSLog (@"sending 'REPLY' from %@ to %@", + [attendee mailAddress], [organizer mailAddress]); + + /* multipart body */ + body = [[NGMimeMultipartBody alloc] initWithPart: msg]; + + /* text part */ + headerMap = [NGMutableHashMap hashMapWithCapacity: 1]; + [headerMap setObject: @"text/plain; charset=utf-8" + forKey: @"content-type"]; + bodyPart = [NGMimeBodyPart bodyPartWithHeader: headerMap]; + bodyData = [[p getBody] dataUsingEncoding: NSUTF8StringEncoding]; + [bodyPart setBody: bodyData]; + + /* attach text part to multipart body */ + [body addBodyPart: bodyPart]; + + /* calendar part */ + headerMap = [NGMutableHashMap hashMapWithCapacity: 1]; + [headerMap setObject: @"text/calendar; method=REPLY; charset=utf-8" + forKey: @"content-type"]; + bodyPart = [NGMimeBodyPart bodyPartWithHeader: headerMap]; + iCalString = [[event parent] versitString]; + [bodyPart setBody: [iCalString dataUsingEncoding: NSUTF8StringEncoding]]; + + /* attach calendar part to multipart body */ + [body addBodyPart: bodyPart]; + + /* attach multipart body to message */ + [msg setBody: body]; + [body release]; + + /* send the damn thing */ + email = [organizer rfc822Email]; + [[SOGoMailer sharedMailer] + sendMimePart: msg + toRecipients: [NSArray arrayWithObject: email] + sender: [attendee rfc822Email]]; + } } } diff --git a/SoObjects/SOGo/SOGoContentObject.m b/SoObjects/SOGo/SOGoContentObject.m index 1e1d0f79..c82fc589 100644 --- a/SoObjects/SOGo/SOGoContentObject.m +++ b/SoObjects/SOGo/SOGoContentObject.m @@ -118,7 +118,7 @@ else ocsPathOfContainer = nil; - return ocsPath; + return ocsPathOfContainer; } - (GCSFolder *) ocsFolder