Code cleanups

pull/75/merge
Ludovic Marcotte 2015-03-24 08:34:29 -04:00
parent 26d876e67a
commit d75fb0722a
4 changed files with 10 additions and 81 deletions

View File

@ -1,8 +1,6 @@
/* UIxAttendeesEditor.h - this file is part of SOGo /* UIxAttendeesEditor.h - this file is part of SOGo
* *
* Copyright (C) 2007-2012 Inverse inc. * Copyright (C) 2007-2015 Inverse inc.
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
* *
* This file is free software; you can redistribute it and/or modify * This file is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View File

@ -1,8 +1,6 @@
/* UIxAttendeesEditor.m - this file is part of SOGo /* UIxAttendeesEditor.m - this file is part of SOGo
* *
* Copyright (C) 2007-2012 Inverse inc. * Copyright (C) 2007-2015 Inverse inc.
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
* *
* This file is free software; you can redistribute it and/or modify * This file is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View File

@ -1,6 +1,6 @@
/* UIxComponentEditor.h - this file is part of SOGo /* UIxComponentEditor.h - this file is part of SOGo
* *
* Copyright (C) 2006-2014 Inverse inc. * Copyright (C) 2006-2015 Inverse inc.
* *
* This file is free software; you can redistribute it and/or modify * This file is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View File

@ -176,7 +176,6 @@ iRANGE(2);
[self setIsCycleEndNever]; [self setIsCycleEndNever];
componentOwner = @""; componentOwner = @"";
organizer = nil; organizer = nil;
//organizerIdentity = nil;
organizerProfile = nil; organizerProfile = nil;
ownerAsAttendee = nil; ownerAsAttendee = nil;
attendee = nil; attendee = nil;
@ -213,7 +212,6 @@ iRANGE(2);
[title release]; [title release];
[location release]; [location release];
[organizer release]; [organizer release];
//[organizerIdentity release];
[organizerProfile release]; [organizerProfile release];
[ownerAsAttendee release]; [ownerAsAttendee release];
[comment release]; [comment release];
@ -820,25 +818,27 @@ iRANGE(2);
uid = email; uid = email;
[profile setObject: name [profile setObject: name
forKey: @"name"]; forKey: @"name"];
[profile setObject: email [profile setObject: email
forKey: @"email"]; forKey: @"email"];
if (partstat == nil || ![partstat length]) if (partstat == nil || ![partstat length])
partstat = @"accepted"; partstat = @"accepted";
[profile setObject: partstat [profile setObject: partstat
forKey: @"partstat"]; forKey: @"partstat"];
if (role == nil || ![role length]) if (role == nil || ![role length])
role = @"chair"; role = @"chair";
[profile setObject: role [profile setObject: role
forKey: @"role"]; forKey: @"role"];
organizerProfile = [NSDictionary dictionaryWithObject: profile forKey: uid]; organizerProfile = [NSDictionary dictionaryWithObject: profile forKey: uid];
[organizerProfile retain]; [organizerProfile retain];
} }
return organizerProfile; return organizerProfile;
} }
@ -897,30 +897,6 @@ iRANGE(2);
return [[[[self organizerProfile] allValues] lastObject] jsonRepresentation]; return [[[[self organizerProfile] allValues] lastObject] jsonRepresentation];
} }
// - (BOOL) canBeOrganizer
// {
// NSString *owner;
// SOGoObject <SOGoComponentOccurence> *co;
// SOGoUser *currentUser;
// BOOL hasOrganizer;
// SoSecurityManager *sm;
// co = [self clientObject];
// owner = [co ownerInContext: context];
// currentUser = [context activeUser];
// hasOrganizer = ([[organizer value: 0] length] > 0);
// sm = [SoSecurityManager sharedSecurityManager];
// return ([co isNew]
// || (([owner isEqualToString: [currentUser login]]
// || ![sm validatePermission: SOGoCalendarPerm_ModifyComponent
// onObject: co
// inContext: context])
// && (!hasOrganizer || [component userIsOrganizer: currentUser])));
// }
- (BOOL) hasOrganizer - (BOOL) hasOrganizer
{ {
// We check if there's an organizer and if it's not ourself // We check if there's an organizer and if it's not ourself
@ -948,51 +924,8 @@ iRANGE(2);
} }
return NO; return NO;
//return ([[organizer value: 0] length] && ![self canBeOrganizer]);
} }
//- (void) setOrganizerIdentity: (NSDictionary *) newOrganizerIdentity
//{
// ASSIGN (organizerIdentity, newOrganizerIdentity);
//}
// - (NSDictionary *) organizerIdentity
// {
// NSArray *allIdentities;
// NSEnumerator *identities;
// NSDictionary *currentIdentity;
// NSString *orgEmail;
// orgEmail = [organizer rfc822Email];
// if (!organizerIdentity)
// {
// if ([orgEmail length])
// {
// allIdentities = [[context activeUser] allIdentities];
// identities = [allIdentities objectEnumerator];
// while (!organizerIdentity
// && ((currentIdentity = [identities nextObject])))
// if ([[currentIdentity objectForKey: @"email"]
// caseInsensitiveCompare: orgEmail]
// == NSOrderedSame)
// ASSIGN (organizerIdentity, currentIdentity);
// }
// }
// return organizerIdentity;
// }
//- (NSArray *) organizerList
//{
// return [[context activeUser] allIdentities];
//}
//- (NSString *) itemOrganizerText
//{
// return [item keysWithFormat: @"%{fullName} <%{email}>"];
//}
- (BOOL) hasAttendees - (BOOL) hasAttendees
{ {
return ([[component attendees] count] > 0); return ([[component attendees] count] > 0);