diff --git a/ChangeLog b/ChangeLog index ad73f2cc1..9e308c492 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2009-06-30 Francis Lachapelle + + * UI/MailPartViewers/UIxMailPartICalActions.m + ([UIxMailPartICalActions -addToCalendarAction]): new method to add + a calendar from an invitation (used to work?!). + + * SoObjects/SOGo/NSString+Utilities.m ([NSString + -_handleURLs:textToMatch:prefix:inRanges:]): fixed offset + of range after replacement. + + * SoObjects/SOGo/NSArray+Utilities.m ([NSArray + -hasRangeIntersection:]): fixed error in range comparison. + 2009-06-30 Cyril Robert * UI/WebServerResources/MailerUI.js: Added drag & drop support! diff --git a/UI/MailPartViewers/UIxMailPartICalActions.h b/UI/MailPartViewers/UIxMailPartICalActions.h index 2e92c666a..4b254d62b 100644 --- a/UI/MailPartViewers/UIxMailPartICalActions.h +++ b/UI/MailPartViewers/UIxMailPartICalActions.h @@ -33,6 +33,8 @@ - (WOResponse *) acceptAction; - (WOResponse *) declineAction; +- (WOResponse *) addToCalendarAction; +- (WOResponse *) deleteFromCalendarAction; @end diff --git a/UI/MailPartViewers/UIxMailPartICalActions.m b/UI/MailPartViewers/UIxMailPartICalActions.m index 984384a26..fdf5a3444 100644 --- a/UI/MailPartViewers/UIxMailPartICalActions.m +++ b/UI/MailPartViewers/UIxMailPartICalActions.m @@ -378,6 +378,38 @@ return [self _changePartStatusAction: @"DECLINED"]; } +- (WOResponse *) addToCalendarAction +{ + iCalEvent *emailEvent; + SOGoAppointmentObject *eventObject; + NSString *iCalString; + WOResponse *response; + + emailEvent = [self _emailEvent]; + if (emailEvent) + { + eventObject = [self _eventObjectWithUID: [emailEvent uid]]; + if ([eventObject isNew]) + { + iCalString = [[emailEvent parent] versitString]; + [eventObject saveContentString: iCalString]; + response = [self responseWith204]; + } + else + { + response = [self responseWithStatus: 409]; + } + } + else + { + response = [context response]; + [response setStatus: 409]; + response = [self responseWithStatus: 404]; + } + + return response; +} + - (WOResponse *) deleteFromCalendarAction { iCalEvent *emailEvent; diff --git a/UI/MailPartViewers/product.plist b/UI/MailPartViewers/product.plist index c5c85df75..3dbb48bc7 100644 --- a/UI/MailPartViewers/product.plist +++ b/UI/MailPartViewers/product.plist @@ -37,12 +37,12 @@ protectedBy = "View"; actionClass = "UIxMailPartICalAction"; actionName = "markTentative"; - }; + }; */ addToCalendar = { protectedBy = "View"; - actionClass = "UIxMailPartICalAction"; + actionClass = "UIxMailPartICalActions"; actionName = "addToCalendar"; - }; */ + }; deleteFromCalendar = { protectedBy = "View"; actionClass = "UIxMailPartICalActions";