Monotone-Parent: 40cfb51f338c3f1f6fe8239f0856243055c457e5

Monotone-Revision: 0d1504b25805aa0a62ce9ead611227d57b4d4f75

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2007-03-07T22:32:01
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2007-03-07 22:32:01 +00:00
parent eea6afeb12
commit 1e8864e12c
2 changed files with 42 additions and 3 deletions
+41 -2
View File
@@ -25,6 +25,7 @@
#import <Foundation/NSDictionary.h>
#import <NGObjWeb/NGObjWeb.h>
#import <SOGo/SOGoAuthenticator.h>
#import <NGCards/iCalEntityObject.h>
@interface UIxCalInlineAptView : WOComponent
@@ -273,9 +274,47 @@
referenceDate: [self referenceDate]];
}
- (BOOL) isConfidential
- (BOOL) _userIsInTheCard: (NSString *) email
{
return ([[appointment objectForKey: @"classification"] intValue] == iCalAccessConfidential);
NSString *orgMailString, *partMailsString;
NSArray *partMails;
BOOL userIsInTheCard;
orgMailString = [appointment objectForKey: @"orgmail"];
if ([orgMailString isNotNull] && [orgMailString isEqualToString: email])
userIsInTheCard = YES;
else
{
partMailsString = [appointment objectForKey: @"partmails"];
if ([partMailsString isNotNull])
{
partMails = [partMailsString componentsSeparatedByString: @"\n"];
userIsInTheCard = [partMails containsObject: email];
}
else
userIsInTheCard = NO;
}
return userIsInTheCard;
}
- (BOOL) titleShouldBeHidden
{
BOOL shouldBeHidden;
SOGoUser *user;
SOGoAuthenticator *sAuth;
sAuth = [SOGoAuthenticator sharedSOGoAuthenticator];
user = [sAuth userInContext: context];
if ([[appointment objectForKey: @"owner"] isEqualToString: [user login]]
|| ([[appointment objectForKey: @"classification"] intValue]
!= iCalAccessConfidential))
shouldBeHidden = NO;
else
shouldBeHidden = ![self _userIsInTheCard: [user email]];
return shouldBeHidden;
}
@end
@@ -26,7 +26,7 @@
><img rsrc:src="alarm.png" class="gradient"
/></var:if
></span
><var:if condition="isConfidential" const:negate="YES"
><var:if condition="titleShouldBeHidden" const:negate="YES"
><br
/><var:string value="appointment.title" const:escapeHTML="NO"
/></var:if