From decbce9f27f2b81ab3a2b42aceb696833fa55d43 Mon Sep 17 00:00:00 2001 From: Ludovic Marcotte Date: Tue, 5 Jul 2011 13:24:25 +0000 Subject: [PATCH] See ChangeLog Monotone-Parent: eec300be835f03b3e7780d528e6c75977cf6254b Monotone-Revision: 0a26aa3104394fc27aedec6025fb6d01075058b4 Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2011-07-05T13:24:25 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 8 +++ .../Appointments/SOGoAppointmentObject.m | 8 +-- .../Appointments/SOGoCalendarComponent.h | 1 + .../Appointments/SOGoCalendarComponent.m | 7 +++ .../French.lproj/Localizable.strings | 2 +- UI/MailPartViewers/UIxMailPartICalActions.m | 59 ++++++++++--------- UI/MailPartViewers/UIxMailPartICalViewer.m | 8 +-- 7 files changed, 53 insertions(+), 40 deletions(-) diff --git a/ChangeLog b/ChangeLog index 81eee4a90..5d54c092d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2011-07-05 Ludovic Marcotte + + * UI/MailPartViewers/UIxMailPartICalActions.m + (_setupChosenEventAndEventObject:) we now correctly + update the right event in the database in order to + update major properties coming from external invitations + during updates. + 2011-07-02 Ludovic Marcotte * SoObjects/Appointments/SOGoAppointmentObject.m (-PUTAction:) diff --git a/SoObjects/Appointments/SOGoAppointmentObject.m b/SoObjects/Appointments/SOGoAppointmentObject.m index 747ff8713..d4e5f3ca8 100644 --- a/SoObjects/Appointments/SOGoAppointmentObject.m +++ b/SoObjects/Appointments/SOGoAppointmentObject.m @@ -736,13 +736,7 @@ } [super saveComponent: newEvent]; - - [fullCalendar release]; - fullCalendar = nil; - [safeCalendar release]; - safeCalendar = nil; - [originalCalendar release]; - originalCalendar = nil; + [self flush]; return nil; } diff --git a/SoObjects/Appointments/SOGoCalendarComponent.h b/SoObjects/Appointments/SOGoCalendarComponent.h index 84ab6034f..c20bf8b5a 100644 --- a/SoObjects/Appointments/SOGoCalendarComponent.h +++ b/SoObjects/Appointments/SOGoCalendarComponent.h @@ -47,6 +47,7 @@ NSString *componentTag; } +- (void) flush; - (NSString *) componentTag; - (void) setComponentTag: (NSString *) theTag; diff --git a/SoObjects/Appointments/SOGoCalendarComponent.m b/SoObjects/Appointments/SOGoCalendarComponent.m index 8a295c3aa..eeef92092 100644 --- a/SoObjects/Appointments/SOGoCalendarComponent.m +++ b/SoObjects/Appointments/SOGoCalendarComponent.m @@ -160,6 +160,13 @@ [super dealloc]; } +- (void) flush +{ + DESTROY(fullCalendar); + DESTROY(safeCalendar); + DESTROY(originalCalendar); +} + - (NSString *) davContentType { return @"text/calendar"; diff --git a/UI/MailPartViewers/French.lproj/Localizable.strings b/UI/MailPartViewers/French.lproj/Localizable.strings index e462a4801..4154c3e21 100644 --- a/UI/MailPartViewers/French.lproj/Localizable.strings +++ b/UI/MailPartViewers/French.lproj/Localizable.strings @@ -21,7 +21,7 @@ request_info = "vous invite à une réunion."; "Delete from calendar" = "Effacer de l'agenda"; "Update status" = "Intégrer les modifications"; Accept = "Accepter"; -Decline = "Decliner"; +Decline = "Décliner"; Tentative = "Tentatif"; "Delegate ..." = "Déléguer ..."; "Delegated to" = "Délégué à"; diff --git a/UI/MailPartViewers/UIxMailPartICalActions.m b/UI/MailPartViewers/UIxMailPartICalActions.m index 3805dc64c..d68ed9acb 100644 --- a/UI/MailPartViewers/UIxMailPartICalActions.m +++ b/UI/MailPartViewers/UIxMailPartICalActions.m @@ -1,6 +1,6 @@ /* UIxMailPartICalActions.m - this file is part of SOGo * - * Copyright (C) 2007-2009 Inverse inc. + * Copyright (C) 2007-2011 Inverse inc. * * Author: Wolfgang Sourdeau * @@ -73,6 +73,9 @@ return (iCalEvent *) [emailCalendar firstChildWithTag: @"vevent"]; } +// +// +// - (SOGoAppointmentObject *) _eventObjectWithUID: (NSString *) uid forUser: (SOGoUser *) user { @@ -114,12 +117,18 @@ return eventObject; } +// +// +// - (SOGoAppointmentObject *) _eventObjectWithUID: (NSString *) uid { #warning this will not work if Bob reads emails of Alice and accepts events for her return [self _eventObjectWithUID: uid forUser: [context activeUser]]; } +// +// +// - (void) _fixOrganizerInEvent: (iCalEvent *) brokenEvent { iCalPerson *organizer; @@ -155,8 +164,10 @@ @" if the user replies"]; } -- (iCalEvent *) - _setupChosenEventAndEventObject: (SOGoAppointmentObject **) eventObject +// +// +// +- (iCalEvent *) _setupChosenEventAndEventObject: (SOGoAppointmentObject **) eventObject { iCalEvent *emailEvent, *calendarEvent, *chosenEvent; iCalPerson *organizer; @@ -183,15 +194,25 @@ calendarEvent = (iCalEvent *)[*eventObject lookupOccurence: recurrenceTime]; } else - calendarEvent = (iCalEvent *) [*eventObject component: NO - secure: NO]; + calendarEvent = (iCalEvent *) [*eventObject component: NO secure: NO]; if (calendarEvent != nil) { // Calendar event still exists -- verify which of the calendar - // and email events is the most recent. + // and email events is the most recent. We must also update + // the event (or recurrence-id) with the email's content, otherwise + // we would never get major properties updates if ([calendarEvent compare: emailEvent] == NSOrderedAscending) - chosenEvent = emailEvent; + { + iCalCalendar *parent; + + parent = [calendarEvent parent]; + [parent removeChild: calendarEvent]; + [parent addChild: emailEvent]; + [*eventObject saveContentString: [parent versitString]]; + [*eventObject flush]; + chosenEvent = emailEvent; + } else { chosenEvent = calendarEvent; @@ -213,6 +234,9 @@ return chosenEvent; } +// +// +// - (WOResponse *) _changePartStatusAction: (NSString *) newStatus withDelegate: (iCalPerson *) delegate { @@ -242,12 +266,6 @@ return response; } -//- (BOOL) shouldTakeValuesFromRequest: (WORequest *) request -// inContext: (WOContext*) localContext -//{ -// return YES; -//} - - (WOResponse *) acceptAction { return [self _changePartStatusAction: @"ACCEPTED" @@ -440,19 +458,4 @@ return response; } -// - (WOResponse *) markTentativeAction -// { -// return [self _changePartStatusAction: @"TENTATIVE"]; -// } - -// - (WOResponse *) addToCalendarAction -// { -// return [self responseWithStatus: 404]; -// } - -// - (WOResponse *) deleteFromCalendarAction -// { -// return [self responseWithStatus: 404]; -// } - @end diff --git a/UI/MailPartViewers/UIxMailPartICalViewer.m b/UI/MailPartViewers/UIxMailPartICalViewer.m index 80f8e62d6..37a78aaac 100644 --- a/UI/MailPartViewers/UIxMailPartICalViewer.m +++ b/UI/MailPartViewers/UIxMailPartICalViewer.m @@ -1,20 +1,20 @@ /* Copyright (C) 2004-2005 SKYRIX Software AG - This file is part of OpenGroupware.org. + This file is part of SOGo. - OGo is free software; you can redistribute it and/or modify it under + SOGo is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. - OGo is distributed in the hope that it will be useful, but WITHOUT ANY + SOGo is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with OGo; see the file COPYING. If not, write to the + License along with SOGo; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */