From e307ee23d2115982ad021b5be30adb6941a68bbe Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Thu, 3 May 2007 16:13:51 +0000 Subject: [PATCH] Monotone-Parent: 78d012bb528bcbf5295b1d5241415fcb6465a307 Monotone-Revision: b521f340498a0489a0b9c81b91374570890a80fa Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-05-03T16:13:51 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 14 ++++++++++++ UI/Scheduler/UIxComponentEditor.h | 1 + UI/Scheduler/UIxComponentEditor.m | 38 +++++++++++++++++++++++++++++++ 3 files changed, 53 insertions(+) diff --git a/ChangeLog b/ChangeLog index a79f5dc96..168248ebb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,19 @@ 2007-05-03 Wolfgang Sourdeau + * UI/Scheduler/UIxComponentEditor.m ([UIxComponentEditor + -toolbar]): method replacing the one with the same name in the + task and appointment editor classes. This method makes also use of + the new method "isOrganizerOrOwner:" and "participant:" in + SOGoCalendarComponent. + + * UI/Scheduler/UIxAppointmentEditor.m ([UIxAppointmentEditor + -toolbar]): removed method, replaced with a method with the same + name in UIxComponentEditor. + + * UI/Scheduler/UIxTaskEditor.m ([UIxTaskEditor -toolbar]): removed + method, replaced with a method with the same name in + UIxComponentEditor. + * SoObjects/SOGo/AgenorUserDefaults.m ([AgenorUserDefaults -primaryFetchProfile]): the values returned from the database are converted to a put dictionary first, since the dictionary returned diff --git a/UI/Scheduler/UIxComponentEditor.h b/UI/Scheduler/UIxComponentEditor.h index 72bf704ba..087fc1f0f 100644 --- a/UI/Scheduler/UIxComponentEditor.h +++ b/UI/Scheduler/UIxComponentEditor.h @@ -62,6 +62,7 @@ NSString *attendeesEmails; } +- (NSString *) toolbar; - (void) setComponent: (iCalRepeatableEntityObject *) newComponent; - (void) setSaveURL: (NSString *) newSaveURL; diff --git a/UI/Scheduler/UIxComponentEditor.m b/UI/Scheduler/UIxComponentEditor.m index 9684e36b9..a84b1ca67 100644 --- a/UI/Scheduler/UIxComponentEditor.m +++ b/UI/Scheduler/UIxComponentEditor.m @@ -843,4 +843,42 @@ [component setLastModified: now]; } +- (NSString *) toolbar +{ + SOGoUser *currentUser; + SOGoCalendarComponent *clientObject; + NSString *toolbarFilename; + iCalPerson *person; + iCalPersonPartStat participationStatus; + + clientObject = [self clientObject]; + currentUser = [[self context] activeUser]; + if ([clientObject isOrganizerOrOwner: currentUser]) + { + if ([[clientObject componentTag] isEqualToString: @"vevent"]) + toolbarFilename = @"SOGoAppointmentObject.toolbar"; + else + toolbarFilename = @"SOGoTaskObject.toolbar"; + } + else + { + /* Lightning does not manage participation status within tasks */ + person = [clientObject participant: currentUser]; + if (person) + { + participationStatus = [person participationStatus]; + if (participationStatus == iCalPersonPartStatAccepted) + toolbarFilename = @"SOGoAppointmentObjectDecline.toolbar"; + else if (participationStatus == iCalPersonPartStatDeclined) + toolbarFilename = @"SOGoAppointmentObjectAccept.toolbar"; + else + toolbarFilename = @"SOGoAppointmentObjectAcceptOrDecline.toolbar"; + } + else + toolbarFilename = @"SOGoComponentClose.toolbar"; + } + + return toolbarFilename; +} + @end