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