mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-05-26 05:45:24 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user