diff --git a/ChangeLog b/ChangeLog index 9288125f5..1078be7c9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2007-06-11 Wolfgang Sourdeau + * 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 diff --git a/UI/Scheduler/UIxCalView.h b/UI/Scheduler/UIxCalView.h index 396afe10e..6aa6ca243 100644 --- a/UI/Scheduler/UIxCalView.h +++ b/UI/Scheduler/UIxCalView.h @@ -98,8 +98,6 @@ - (NSCalendarDate *) startDate; - (NSCalendarDate *) endDate; -- (NSArray *) fetchCoreAppointmentsInfos; -- (NSArray *) fetchCoreTasksInfos; /* date selection */ diff --git a/UI/Scheduler/UIxCalView.m b/UI/Scheduler/UIxCalView.m index da409b0ee..351a21b52 100644 --- a/UI/Scheduler/UIxCalView.m +++ b/UI/Scheduler/UIxCalView.m @@ -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