diff --git a/UI/Scheduler/UIxAppointmentEditor.m b/UI/Scheduler/UIxAppointmentEditor.m index e270ccf6c..bae95d80f 100644 --- a/UI/Scheduler/UIxAppointmentEditor.m +++ b/UI/Scheduler/UIxAppointmentEditor.m @@ -350,10 +350,10 @@ [self setICalString:ical]; [self loadValuesFromAppointment: [self appointmentFromString: ical]]; - if (![self canEditComponent]) { - /* TODO: we need proper ACLs */ - return [self redirectToLocation: [self completeURIForMethod: @"../view"]]; - } +// if (![self canEditComponent]) { +// /* TODO: we need proper ACLs */ +// return [self redirectToLocation: [self completeURIForMethod: @"../view"]]; +// } return self; } @@ -452,8 +452,9 @@ _accept ? @"ACCEPTED" : @"DECLINED" inContext:[self context]]; if (ex != nil) return ex; - - return [self redirectToLocation: [self completeURIForMethod: @"../view"]]; + + return self; +// return [self redirectToLocation: [self completeURIForMethod: @"../view"]]; } @end /* UIxAppointmentEditor */ diff --git a/UI/Scheduler/UIxComponentEditor.m b/UI/Scheduler/UIxComponentEditor.m index 6adbafd58..b80ad4d9a 100644 --- a/UI/Scheduler/UIxComponentEditor.m +++ b/UI/Scheduler/UIxComponentEditor.m @@ -42,6 +42,8 @@ #import #import #import +#import +#import #import "UIxComponent+Agenor.h" @@ -567,8 +569,7 @@ - (BOOL) isMyComponent { // TODO: this should check a set of emails against the SoUser - return (![[organizer email] length] - || [[organizer rfc822Email] isEqualToString: [self emailForUser]]); + return ([[organizer rfc822Email] isEqualToString: [self emailForUser]]); } - (BOOL) canAccessComponent @@ -810,4 +811,48 @@ return classes; } +- (NSString *) toolbar +{ + NSString *filename, *myEmail; + iCalEntityObject *calObject; + iCalPersonPartStat myParticipationStatus; + id co; + BOOL isEditable; + + co = [self clientObject]; + isEditable = YES; + if ([co isKindOfClass: [SOGoAppointmentObject class]]) + calObject = (iCalEntityObject *) [co event]; + else if ([co isKindOfClass: [SOGoTaskObject class]]) + calObject = (iCalEntityObject *) [co task]; + else + isEditable = NO; + if (isEditable) + { + myEmail = [[[self context] activeUser] email]; + if ([self canEditComponent]) + filename = @"SOGoAppointmentObject.toolbar"; + else + { + if ([calObject isParticipant: myEmail]) + { + myParticipationStatus + = [[calObject findParticipantWithEmail: myEmail] participationStatus]; + if (myParticipationStatus == iCalPersonPartStatAccepted) + filename = @"SOGoAppointmentObjectDecline.toolbar"; + else if (myParticipationStatus == iCalPersonPartStatDeclined) + filename = @"SOGoAppointmentObjectAccept.toolbar"; + else + filename = @"SOGoAppointmentObjectAcceptOrDecline.toolbar"; + } + else + filename = @""; + } + } + else + filename = @""; + + return filename; +} + @end diff --git a/UI/Scheduler/UIxTaskEditor.m b/UI/Scheduler/UIxTaskEditor.m index 02f60c692..726744ede 100644 --- a/UI/Scheduler/UIxTaskEditor.m +++ b/UI/Scheduler/UIxTaskEditor.m @@ -321,10 +321,10 @@ [self setICalString:ical]; [self loadValuesFromTask: [self taskFromString: ical]]; - if (![self canEditComponent]) { - /* TODO: we need proper ACLs */ - return [self redirectToLocation: [self completeURIForMethod: @"../view"]]; - } +// if (![self canEditComponent]) { +// /* TODO: we need proper ACLs */ +// return [self redirectToLocation: [self completeURIForMethod: @"../view"]]; +// } return self; } @@ -460,7 +460,8 @@ inContext:[self context]]; if (ex != nil) return ex; - return [self redirectToLocation: [self completeURIForMethod:@"../view"]]; + return self; +// return [self redirectToLocation: [self completeURIForMethod:@"../view"]]; } - (void) setHasStartDate: (BOOL) aBool