mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-05-22 03:45:25 +00:00
Monotone-Parent: 383ee921a819c519f6f0303f90a0c3b887974b85
Monotone-Revision: eab6dcca819997db03071b70fa3cb43b3b72b73a Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2006-11-07T18:15:29 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -42,6 +42,8 @@
|
||||
#import <SOGo/AgenorUserManager.h>
|
||||
#import <SOGo/SOGoUser.h>
|
||||
#import <SOGoUI/SOGoDateFormatter.h>
|
||||
#import <SoObjects/Appointments/SOGoAppointmentObject.h>
|
||||
#import <SoObjects/Appointments/SOGoTaskObject.h>
|
||||
|
||||
#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
|
||||
|
||||
Reference in New Issue
Block a user