mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-06-24 03:14:17 +00:00
Monotone-Parent: d2e4731dde2d6d07f3c17c2438ce006ce1a226c6
Monotone-Revision: 97ab5f0d32e07a5298592a95662eb11098a1290a Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-06-11T21:29:07 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
2007-06-11 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* UI/Scheduler/UIxCalView.m ([-fetchCoreAppointmentsInfos]):
|
||||
removed method.
|
||||
([-fetchCoreTasksInfos]): removed method.
|
||||
|
||||
* UI/Scheduler/UIxCalListingActions.m ([UIxCalListingActions
|
||||
-init]): initialize an instance of SOGoDateFormatter.
|
||||
([UIxCalListingActions -eventsListAction]): the display start and
|
||||
|
||||
@@ -98,8 +98,6 @@
|
||||
|
||||
- (NSCalendarDate *) startDate;
|
||||
- (NSCalendarDate *) endDate;
|
||||
- (NSArray *) fetchCoreAppointmentsInfos;
|
||||
- (NSArray *) fetchCoreTasksInfos;
|
||||
|
||||
/* date selection */
|
||||
|
||||
|
||||
@@ -451,135 +451,6 @@ static BOOL shouldDisplayWeekend = NO;
|
||||
return [[self startDate] tomorrow];
|
||||
}
|
||||
|
||||
- (SOGoAppointmentFolder *) _aptFolder: (NSString *) folder
|
||||
withClientObject: (SOGoAppointmentFolder *) clientObject
|
||||
{
|
||||
SOGoAppointmentFolder *aptFolder;
|
||||
NSArray *folderParts;
|
||||
|
||||
if ([folder isEqualToString: @"/"])
|
||||
aptFolder = clientObject;
|
||||
else
|
||||
{
|
||||
folderParts = [folder componentsSeparatedByString: @":"];
|
||||
aptFolder
|
||||
= [clientObject lookupCalendarFolderForUID:
|
||||
[folderParts objectAtIndex: 0]];
|
||||
}
|
||||
|
||||
return aptFolder;
|
||||
}
|
||||
|
||||
- (NSArray *) _activeCalendarFolders
|
||||
{
|
||||
NSMutableArray *activeFolders;
|
||||
NSEnumerator *folders;
|
||||
NSDictionary *currentFolderDict;
|
||||
SOGoAppointmentFolder *currentFolder, *clientObject;
|
||||
|
||||
activeFolders = [NSMutableArray new];
|
||||
[activeFolders autorelease];
|
||||
|
||||
clientObject = [self clientObject];
|
||||
|
||||
folders = [[clientObject calendarFolders] objectEnumerator];
|
||||
currentFolderDict = [folders nextObject];
|
||||
while (currentFolderDict)
|
||||
{
|
||||
if ([[currentFolderDict objectForKey: @"active"] boolValue])
|
||||
{
|
||||
currentFolder
|
||||
= [self _aptFolder: [currentFolderDict objectForKey: @"folder"]
|
||||
withClientObject: clientObject];
|
||||
[activeFolders addObject: currentFolder];
|
||||
}
|
||||
|
||||
currentFolderDict = [folders nextObject];
|
||||
}
|
||||
|
||||
return activeFolders;
|
||||
}
|
||||
|
||||
- (void) _updatePrivacyInObjects: (NSArray *) objectInfos
|
||||
fromFolder: (SOGoAppointmentFolder *) folder
|
||||
{
|
||||
int hideDetails[] = {-1, -1, -1};
|
||||
NSMutableDictionary *currentRecord;
|
||||
int privacyFlag;
|
||||
NSString *roleString, *userLogin;
|
||||
NSEnumerator *infos;
|
||||
|
||||
userLogin = [[context activeUser] login];
|
||||
infos = [objectInfos objectEnumerator];
|
||||
currentRecord = [infos nextObject];
|
||||
while (currentRecord)
|
||||
{
|
||||
privacyFlag = [[currentRecord objectForKey: @"classification"] intValue];
|
||||
if (hideDetails[privacyFlag] == -1)
|
||||
{
|
||||
roleString = [folder roleForComponentsWithAccessClass: privacyFlag
|
||||
forUser: userLogin];
|
||||
hideDetails[privacyFlag] = ([roleString isEqualToString: @"ComponentDAndTViewer"]
|
||||
? 1 : 0);
|
||||
}
|
||||
if (hideDetails[privacyFlag])
|
||||
{
|
||||
[currentRecord setObject: [self labelForKey: @"(Private Event)"]
|
||||
forKey: @"title"];
|
||||
[currentRecord setObject: @"" forKey: @"location"];
|
||||
}
|
||||
currentRecord = [infos nextObject];
|
||||
}
|
||||
}
|
||||
|
||||
- (NSArray *) _fetchCoreInfosForComponent: (NSString *) component
|
||||
{
|
||||
NSArray *currentInfos;
|
||||
NSMutableArray *infos;
|
||||
NSEnumerator *folders;
|
||||
SOGoAppointmentFolder *currentFolder;
|
||||
|
||||
infos = [componentsData objectForKey: component];
|
||||
if (!infos)
|
||||
{
|
||||
infos = [NSMutableArray array];
|
||||
folders = [[self _activeCalendarFolders] objectEnumerator];
|
||||
currentFolder = [folders nextObject];
|
||||
while (currentFolder)
|
||||
{
|
||||
currentInfos = [currentFolder fetchCoreInfosFrom: [[self startDate] beginOfDay]
|
||||
to: [[self endDate] endOfDay]
|
||||
component: component];
|
||||
[currentInfos makeObjectsPerform: @selector (setObject:forKey:)
|
||||
withObject: [currentFolder ownerInContext: nil]
|
||||
withObject: @"owner"];
|
||||
[self _updatePrivacyInObjects: currentInfos
|
||||
fromFolder: currentFolder];
|
||||
[infos addObjectsFromArray: currentInfos];
|
||||
currentFolder = [folders nextObject];
|
||||
}
|
||||
[componentsData setObject: infos forKey: component];
|
||||
}
|
||||
|
||||
return infos;
|
||||
}
|
||||
|
||||
- (NSArray *) fetchCoreAppointmentsInfos
|
||||
{
|
||||
if (!appointments)
|
||||
[self setAppointments: [self _fetchCoreInfosForComponent: @"vevent"]];
|
||||
|
||||
return appointments;
|
||||
}
|
||||
|
||||
- (NSArray *) fetchCoreTasksInfos
|
||||
{
|
||||
if (!tasks)
|
||||
[self setTasks: [self _fetchCoreInfosForComponent: @"vtodo"]];
|
||||
|
||||
return tasks;
|
||||
}
|
||||
|
||||
/* query parameters */
|
||||
|
||||
- (BOOL) shouldDisplayRejectedAppointments
|
||||
|
||||
Reference in New Issue
Block a user