mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-07-07 09:25:09 +00:00
The multiColumns view
This commit is contained in:
@@ -542,6 +542,12 @@ vtodo_class2 = "(Confidential task)";
|
||||
"tagWasRemoved" = "If you remove this calendar from synchronization, you'll need to reload the data on your mobile device.\nContinue?";
|
||||
"DestinationCalendarError" = "The source and destination calendars are the same. Please try to copy to a different calendar.";
|
||||
"EventCopyError" = "The copy failed. Please try to copy to a difference calendar.";
|
||||
"Please select at least one calendar" = "Please select at least one calendar";
|
||||
"notice:" = "notice:";
|
||||
"error:" = "error:";
|
||||
"success:" = "success:";
|
||||
"warning:" = "warning:";
|
||||
|
||||
|
||||
"Open Task..." = "Open Task...";
|
||||
"Mark Completed" = "Mark Completed";
|
||||
|
||||
@@ -21,12 +21,11 @@
|
||||
onclick = "return onDayOverview();";
|
||||
image = "day-view.png";
|
||||
tooltip = "Switch to day view"; },
|
||||
/* disabled until we fix the view */
|
||||
/* { link = "#";
|
||||
label="Multicolumn Day View";
|
||||
onclick = "return onMulticolumnDayOverview();";
|
||||
image = "day-view-multicolumn.png";
|
||||
tooltip = ""; }, */
|
||||
{ link = "#";
|
||||
label="Multi-Columns View";
|
||||
onclick = "return onMulticolumnDayOverview();";
|
||||
image = "day-view-multicolumn.png";
|
||||
tooltip = "Switch to multi-columns day view"; },
|
||||
{ link = "#";
|
||||
label="Week View";
|
||||
onclick = "return onWeekOverview();";
|
||||
|
||||
@@ -35,27 +35,27 @@
|
||||
|
||||
@interface UIxCalDayTable : UIxCalView
|
||||
{
|
||||
unsigned int numberOfDays;
|
||||
NSCalendarDate *startDate;
|
||||
NSCalendarDate *currentTableDay;
|
||||
NSString *currentTableHour;
|
||||
NSMutableArray *daysToDisplay;
|
||||
NSMutableArray *hoursToDisplay;
|
||||
NSArray *weekDays;
|
||||
SOGoDateFormatter *dateFormatter;
|
||||
NSString *timeFormat;
|
||||
NSArray *weekDays;
|
||||
NSString *currentView, *timeFormat, *currentTableHour;
|
||||
NSCalendarDate *startDate, *currentTableDay;
|
||||
NSMutableArray *daysToDisplay, *calendarsToDisplay, *currentCalendar, *hoursToDisplay;
|
||||
unsigned int numberOfDays;
|
||||
}
|
||||
|
||||
- (void) setNumberOfDays: (NSNumber *) aNumber;
|
||||
- (NSNumber *) numberOfDays;
|
||||
- (NSString *) currentView;
|
||||
|
||||
- (void) setStartDate: (NSCalendarDate *) aStartDate;
|
||||
- (NSCalendarDate *) startDate;
|
||||
- (NSCalendarDate *) endDate;
|
||||
|
||||
- (NSArray *) daysToDisplay;
|
||||
- (NSArray *) calendarsToDisplay;
|
||||
- (void) setCurrentTableDay: (NSCalendarDate *) aTableDay;
|
||||
- (NSCalendarDate *) currentTableDay;
|
||||
- (NSMutableArray *) currentCalendar;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
+132
-17
@@ -55,9 +55,12 @@
|
||||
ASSIGN (timeFormat, [ud timeFormat]);
|
||||
|
||||
daysToDisplay = nil;
|
||||
calendarsToDisplay = nil;
|
||||
hoursToDisplay = nil;
|
||||
numberOfDays = 1;
|
||||
startDate = nil;
|
||||
currentView = nil;
|
||||
currentCalendar = nil;
|
||||
currentTableDay = nil;
|
||||
currentTableHour = nil;
|
||||
weekDays = [locale objectForKey: NSShortWeekDayNameArray];
|
||||
@@ -75,6 +78,9 @@
|
||||
// [allAppointments release];
|
||||
[weekDays release];
|
||||
[daysToDisplay release];
|
||||
[calendarsToDisplay release];
|
||||
[currentView release];
|
||||
[currentCalendar release];
|
||||
[hoursToDisplay release];
|
||||
[dateFormatter release];
|
||||
[timeFormat release];
|
||||
@@ -119,6 +125,16 @@
|
||||
return [endDate endOfDay];
|
||||
}
|
||||
|
||||
- (void) setCurrentView: (NSString *) aView
|
||||
{
|
||||
currentView = [NSString stringWithString:aView];
|
||||
}
|
||||
|
||||
- (NSString *) currentView
|
||||
{
|
||||
return currentView;
|
||||
}
|
||||
|
||||
- (NSArray *) hoursToDisplay
|
||||
{
|
||||
unsigned int currentHour, lastHour;
|
||||
@@ -148,22 +164,67 @@
|
||||
{
|
||||
NSCalendarDate *currentDate;
|
||||
int count;
|
||||
|
||||
|
||||
if (!daysToDisplay)
|
||||
{
|
||||
daysToDisplay = [NSMutableArray new];
|
||||
currentDate = [[self startDate] hour: [self dayStartHour]
|
||||
minute: 0];
|
||||
|
||||
for (count = 0; count < numberOfDays; count++)
|
||||
{
|
||||
daysToDisplay = [NSMutableArray new];
|
||||
currentDate = [[self startDate] hour: [self dayStartHour]
|
||||
minute: 0];
|
||||
for (count = 0; count < numberOfDays; count++)
|
||||
{
|
||||
[daysToDisplay addObject: currentDate];
|
||||
currentDate = [currentDate tomorrow];
|
||||
}
|
||||
[daysToDisplay addObject: currentDate];
|
||||
currentDate = [currentDate tomorrow];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return daysToDisplay;
|
||||
}
|
||||
|
||||
- (NSArray *) calendarsToDisplay
|
||||
{
|
||||
if (!calendarsToDisplay) {
|
||||
int max=0, i;
|
||||
NSArray *folders;
|
||||
SOGoAppointmentFolders *co;
|
||||
SOGoAppointmentFolder *folder;
|
||||
NSMutableDictionary *calendar;
|
||||
unsigned int count, foldersCount;
|
||||
NSString *folderName, *fDisplayName;
|
||||
NSNumber *isActive;
|
||||
|
||||
co = [self clientObject];
|
||||
folders = [co subFolders];
|
||||
foldersCount = [folders count];
|
||||
calendarsToDisplay = [[NSMutableArray alloc] initWithCapacity: foldersCount];
|
||||
for (count = 0; count < foldersCount; count++)
|
||||
{
|
||||
folder = [folders objectAtIndex: count];
|
||||
isActive = [NSNumber numberWithBool: [folder isActive]];
|
||||
if ([isActive intValue] != 0) {
|
||||
calendar = [NSMutableDictionary dictionary];
|
||||
folderName = [folder nameInContainer];
|
||||
fDisplayName = [folder displayName];
|
||||
if (fDisplayName == nil)
|
||||
fDisplayName = @"";
|
||||
if ([fDisplayName isEqualToString: [co defaultFolderName]])
|
||||
fDisplayName = [self labelForKey: fDisplayName];
|
||||
[calendar setObject: [NSString stringWithFormat: @"/%@", folderName]
|
||||
forKey: @"id"];
|
||||
[calendar setObject: fDisplayName forKey: @"displayName"];
|
||||
[calendar setObject: folderName forKey: @"folder"];
|
||||
[calendar setObject: [folder calendarColor] forKey: @"color"];
|
||||
[calendar setObject: isActive forKey: @"active"];
|
||||
[calendar setObject: [folder ownerInContext: context]
|
||||
forKey: @"owner"];
|
||||
[calendarsToDisplay addObject: calendar];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return calendarsToDisplay;
|
||||
}
|
||||
|
||||
- (void) setCurrentTableDay: (NSCalendarDate *) aTableDay
|
||||
{
|
||||
currentTableDay = aTableDay;
|
||||
@@ -174,6 +235,16 @@
|
||||
return currentTableDay;
|
||||
}
|
||||
|
||||
- (void) setCurrentCalendar: (NSMutableArray *) aCalendar
|
||||
{
|
||||
currentCalendar = aCalendar;
|
||||
}
|
||||
|
||||
- (NSMutableArray *) currentCalendar
|
||||
{
|
||||
return currentCalendar;
|
||||
}
|
||||
|
||||
- (void) setCurrentTableHour: (NSString *) aTableHour
|
||||
{
|
||||
currentTableHour = aTableHour;
|
||||
@@ -226,6 +297,16 @@
|
||||
return [dateFormatter shortFormattedDate: currentTableDay];
|
||||
}
|
||||
|
||||
- (NSString *) labelForCalendar
|
||||
{
|
||||
return [NSString stringWithFormat:[currentCalendar objectForKey:@"displayName"]];
|
||||
}
|
||||
|
||||
- (NSString *) colorForCalendar
|
||||
{
|
||||
return [NSString stringWithFormat:[currentCalendar objectForKey:@"color"]];
|
||||
}
|
||||
|
||||
// - (NSDictionary *) _adjustedAppointment: (NSDictionary *) anAppointment
|
||||
// forStart: (NSCalendarDate *) start
|
||||
// andEnd: (NSCalendarDate *) end
|
||||
@@ -318,7 +399,15 @@
|
||||
|
||||
- (NSString *) daysViewClasses
|
||||
{
|
||||
return [NSString stringWithFormat: @"daysView daysViewFor%dDays", numberOfDays];
|
||||
NSString *daysView;
|
||||
|
||||
if ([currentView isEqualToString:@"multicolumndayview"])
|
||||
daysView = @"daysView daysViewForMultipleDays";
|
||||
|
||||
else
|
||||
daysView = [NSString stringWithFormat: @"daysView daysViewFor%dDays", numberOfDays];
|
||||
|
||||
return daysView;
|
||||
}
|
||||
|
||||
- (NSString *) dayClasses
|
||||
@@ -326,19 +415,25 @@
|
||||
NSMutableString *classes;
|
||||
unsigned int currentDayNbr, realDayOfWeek;
|
||||
|
||||
currentDayNbr = [daysToDisplay indexOfObject: currentTableDay];
|
||||
realDayOfWeek = [currentTableDay dayOfWeek];
|
||||
|
||||
classes = [NSMutableString string];
|
||||
[classes appendFormat: @"day day%d", currentDayNbr];
|
||||
if (numberOfDays > 1)
|
||||
if ([currentView isEqualToString:@"multicolumndayview"])
|
||||
[classes appendFormat:@"day dayColumn"];
|
||||
|
||||
else {
|
||||
currentDayNbr = [daysToDisplay indexOfObject: currentTableDay];
|
||||
realDayOfWeek = [currentTableDay dayOfWeek];
|
||||
|
||||
[classes appendFormat: @"day day%d", currentDayNbr];
|
||||
|
||||
if (numberOfDays > 1)
|
||||
{
|
||||
if (realDayOfWeek == 0 || realDayOfWeek == 6)
|
||||
[classes appendString: @" weekEndDay"];
|
||||
if ([currentTableDay isToday])
|
||||
[classes appendString: @" dayOfToday"];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return classes;
|
||||
}
|
||||
|
||||
@@ -358,4 +453,24 @@
|
||||
return cellClass;
|
||||
}
|
||||
|
||||
- (BOOL) isMultiColumnView
|
||||
{
|
||||
BOOL flag = NO;
|
||||
|
||||
if ([currentView isEqualToString:@"multicolumndayview"])
|
||||
flag = YES;
|
||||
|
||||
return flag;
|
||||
}
|
||||
|
||||
- (BOOL) isNotMultiColumnView
|
||||
{
|
||||
BOOL flag = NO;
|
||||
|
||||
if ([currentView isEqualToString:@"dayview"] || [currentView isEqualToString:@"weekview"])
|
||||
flag = YES;
|
||||
|
||||
return flag;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -43,6 +43,7 @@
|
||||
NSString *value;
|
||||
NSString *criteria;
|
||||
NSString *userLogin;
|
||||
NSString *currentView;
|
||||
BOOL dayBasedView;
|
||||
WORequest *request;
|
||||
SOGoDateFormatter *dateFormatter;
|
||||
|
||||
@@ -78,6 +78,8 @@ static NSArray *tasksFields = nil;
|
||||
#define maxBlocks (offsetBlocks * 2) // maximum number of blocks to search
|
||||
// for a free slot (10 days)
|
||||
|
||||
@class SOGoAppointment;
|
||||
|
||||
@implementation UIxCalListingActions
|
||||
|
||||
+ (void) initialize
|
||||
@@ -121,6 +123,7 @@ static NSArray *tasksFields = nil;
|
||||
ASSIGN (dateFormatter, [user dateFormatterInContext: context]);
|
||||
ASSIGN (userTimeZone, [[user userDefaults] timeZone]);
|
||||
dayBasedView = NO;
|
||||
currentView = nil;
|
||||
}
|
||||
|
||||
return self;
|
||||
@@ -239,6 +242,7 @@ static NSArray *tasksFields = nil;
|
||||
endDate = nil;
|
||||
|
||||
param = [request formValueForKey: @"view"];
|
||||
currentView = param;
|
||||
dayBasedView = ![param isEqualToString: @"monthview"];
|
||||
}
|
||||
}
|
||||
@@ -1044,47 +1048,116 @@ _computeBlocksPosition (NSArray *blocks)
|
||||
/* ... _computeBlocksMultiplier() ... */
|
||||
}
|
||||
|
||||
- (NSArray *) _selectedCalendars {
|
||||
SOGoAppointmentFolders *co;
|
||||
SOGoAppointmentFolder *folder;
|
||||
NSMutableArray *selectedCalendars;
|
||||
NSArray *folders;
|
||||
NSString *fDisplayName;
|
||||
NSNumber *isActive;
|
||||
unsigned int count, foldersCount;
|
||||
int max=0, i;
|
||||
|
||||
co = [self clientObject];
|
||||
folders = [co subFolders];
|
||||
foldersCount = [folders count];
|
||||
selectedCalendars = [[NSMutableArray alloc] initWithCapacity: foldersCount];
|
||||
for (count = 0; count < foldersCount; count++)
|
||||
{
|
||||
folder = [folders objectAtIndex: count];
|
||||
isActive = [NSNumber numberWithBool: [folder isActive]];
|
||||
if ([isActive intValue] != 0) {
|
||||
fDisplayName = [folder displayName];
|
||||
if (fDisplayName == nil)
|
||||
fDisplayName = @"";
|
||||
if ([fDisplayName isEqualToString: [co defaultFolderName]])
|
||||
fDisplayName = [self labelForKey: fDisplayName];
|
||||
[selectedCalendars addObject: fDisplayName];
|
||||
}
|
||||
}
|
||||
return selectedCalendars;
|
||||
}
|
||||
|
||||
- (WOResponse *) eventsBlocksAction
|
||||
{
|
||||
int count, max;
|
||||
NSArray *events, *event, *eventsBlocks;
|
||||
NSMutableArray *allDayBlocks, *blocks, *currentDay;
|
||||
NSMutableArray *allDayBlocks, *blocks, *currentDay, *calendars, *eventsByCalendars, *eventsForCalendar;
|
||||
NSNumber *eventNbr;
|
||||
BOOL isAllDay;
|
||||
int i, j;
|
||||
|
||||
[self _setupContext];
|
||||
|
||||
[self _prepareEventBlocks: &blocks withAllDays: &allDayBlocks];
|
||||
events = [self _fetchFields: eventsFields
|
||||
forComponentOfType: @"vevent"];
|
||||
eventsBlocks = [NSArray arrayWithObjects: events, allDayBlocks, blocks, nil];
|
||||
max = [events count];
|
||||
for (count = 0; count < max; count++)
|
||||
{
|
||||
event = [events objectAtIndex: count];
|
||||
// NSLog(@"***[UIxCalListingActions eventsBlocksAction] %i = %@ : %@ / %@ / %@", count,
|
||||
// [event objectAtIndex: eventTitleIndex],
|
||||
// [event objectAtIndex: eventStartDateIndex],
|
||||
// [event objectAtIndex: eventEndDateIndex],
|
||||
// [event objectAtIndex: eventRecurrenceIdIndex]);
|
||||
eventNbr = [NSNumber numberWithUnsignedInt: count];
|
||||
isAllDay = [[event objectAtIndex: eventIsAllDayIndex] boolValue];
|
||||
if (dayBasedView && isAllDay)
|
||||
[self _fillBlocks: allDayBlocks withEvent: event withNumber: eventNbr];
|
||||
else
|
||||
[self _fillBlocks: blocks withEvent: event withNumber: eventNbr];
|
||||
}
|
||||
events = [self _fetchFields: eventsFields forComponentOfType: @"vevent"];
|
||||
|
||||
max = [blocks count];
|
||||
for (count = 0; count < max; count++)
|
||||
if ([currentView isEqualToString: @"multicolumndayview"])
|
||||
{
|
||||
currentDay = [blocks objectAtIndex: count];
|
||||
[currentDay sortUsingSelector: @selector (compareEventByStart:)];
|
||||
[self _addBlocksWidth: currentDay];
|
||||
calendars = [self _selectedCalendars];
|
||||
eventsByCalendars = [NSMutableArray arrayWithCapacity:[calendars count]];
|
||||
for (i = 0; i < [calendars count]; i++) // For each calendar
|
||||
{
|
||||
eventsForCalendar = [NSMutableArray array];
|
||||
[self _prepareEventBlocks: &blocks withAllDays: &allDayBlocks];
|
||||
for (j = 0; j < [events count]; j++) {
|
||||
if ([[[events objectAtIndex:j] objectAtIndex:2] isEqualToString:[calendars objectAtIndex:i]]) {
|
||||
[eventsForCalendar addObject: [events objectAtIndex:j]];
|
||||
}
|
||||
}
|
||||
eventsBlocks = [NSArray arrayWithObjects:eventsForCalendar, allDayBlocks, blocks, nil];
|
||||
max = [eventsForCalendar count];
|
||||
for (count = 0; count < max; count++)
|
||||
{
|
||||
event = [eventsForCalendar objectAtIndex: count];
|
||||
eventNbr = [NSNumber numberWithUnsignedInt: count];
|
||||
isAllDay = [[event objectAtIndex: eventIsAllDayIndex] boolValue];
|
||||
if (dayBasedView && isAllDay)
|
||||
[self _fillBlocks: allDayBlocks withEvent: event withNumber: eventNbr];
|
||||
else
|
||||
[self _fillBlocks: blocks withEvent: event withNumber: eventNbr];
|
||||
}
|
||||
max = [blocks count];
|
||||
for (count = 0; count < max; count++)
|
||||
{
|
||||
currentDay = [blocks objectAtIndex: count];
|
||||
[currentDay sortUsingSelector: @selector (compareEventByStart:)];
|
||||
[self _addBlocksWidth: currentDay];
|
||||
}
|
||||
|
||||
[eventsByCalendars insertObject:eventsBlocks atIndex:i];
|
||||
}
|
||||
return [self _responseWithData: eventsByCalendars];
|
||||
}
|
||||
else
|
||||
{
|
||||
[self _prepareEventBlocks: &blocks withAllDays: &allDayBlocks];
|
||||
eventsBlocks = [NSArray arrayWithObjects: events, allDayBlocks, blocks, nil];
|
||||
max = [events count];
|
||||
for (count = 0; count < max; count++)
|
||||
{
|
||||
event = [events objectAtIndex: count];
|
||||
// NSLog(@"***[UIxCalListingActions eventsBlocksAction] %i = %@ : %@ / %@ / %@", count,
|
||||
// [event objectAtIndex: eventTitleIndex],
|
||||
// [event objectAtIndex: eventStartDateIndex],
|
||||
// [event objectAtIndex: eventEndDateIndex],
|
||||
// [event objectAtIndex: eventRecurrenceIdIndex]);
|
||||
eventNbr = [NSNumber numberWithUnsignedInt: count];
|
||||
isAllDay = [[event objectAtIndex: eventIsAllDayIndex] boolValue];
|
||||
if (dayBasedView && isAllDay)
|
||||
[self _fillBlocks: allDayBlocks withEvent: event withNumber: eventNbr];
|
||||
else
|
||||
[self _fillBlocks: blocks withEvent: event withNumber: eventNbr];
|
||||
}
|
||||
|
||||
max = [blocks count];
|
||||
for (count = 0; count < max; count++)
|
||||
{
|
||||
currentDay = [blocks objectAtIndex: count];
|
||||
[currentDay sortUsingSelector: @selector (compareEventByStart:)];
|
||||
[self _addBlocksWidth: currentDay];
|
||||
}
|
||||
return [self _responseWithData: eventsBlocks];
|
||||
}
|
||||
|
||||
return [self _responseWithData: eventsBlocks];
|
||||
// timeIntervalSinceDate:
|
||||
}
|
||||
|
||||
- (NSString *) _getStatusClassForStatusCode: (int) statusCode
|
||||
|
||||
@@ -39,25 +39,25 @@
|
||||
- (id) init
|
||||
{
|
||||
if ((self = [super init]))
|
||||
{
|
||||
// allAppointments = nil;
|
||||
subscriptionUsers = nil;
|
||||
hoursToDisplay = nil;
|
||||
currentTableUser = nil;
|
||||
currentTableHour = nil;
|
||||
// dateFormatter = [[SOGoDateFormatter alloc]
|
||||
// initWithLocale: [self locale]];
|
||||
}
|
||||
|
||||
{
|
||||
// allAppointments = nil;
|
||||
subscriptionUsers = nil;
|
||||
hoursToDisplay = nil;
|
||||
currentTableUser = nil;
|
||||
currentTableHour = nil;
|
||||
// dateFormatter = [[SOGoDateFormatter alloc]
|
||||
// initWithLocale: [self locale]];
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void) dealloc
|
||||
{
|
||||
// [allAppointments release];
|
||||
// [allAppointments release];
|
||||
[subscriptionUsers release];
|
||||
[hoursToDisplay release];
|
||||
// [dateFormatter release];
|
||||
// [dateFormatter release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
@@ -188,16 +188,6 @@
|
||||
|
||||
/* fetching */
|
||||
|
||||
// - (NSCalendarDate *) startDate
|
||||
// {
|
||||
// return [[self selectedDate] beginOfDay];
|
||||
// }
|
||||
|
||||
// - (NSCalendarDate *) endDate
|
||||
// {
|
||||
// return [[self selectedDate] endOfDay];
|
||||
// }
|
||||
|
||||
// - (NSArray *) appointmentsForCurrentUser
|
||||
// {
|
||||
// NSMutableArray *filteredAppointments;
|
||||
@@ -292,4 +282,11 @@
|
||||
* (100.0 / [users count]))];
|
||||
}
|
||||
|
||||
- (id <WOActionResults>) defaultAction
|
||||
{
|
||||
[super setCurrentView: @"multicolumndayview"];
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -96,34 +96,34 @@ _intValueFromHex (NSString *hexString)
|
||||
NSNumber *isActive;
|
||||
|
||||
if (!calendars)
|
||||
{
|
||||
co = [self clientObject];
|
||||
folders = [co subFolders];
|
||||
max = [folders count];
|
||||
calendars = [[NSMutableArray alloc] initWithCapacity: max];
|
||||
for (count = 0; count < max; count++)
|
||||
{
|
||||
co = [self clientObject];
|
||||
folders = [co subFolders];
|
||||
max = [folders count];
|
||||
calendars = [[NSMutableArray alloc] initWithCapacity: max];
|
||||
for (count = 0; count < max; count++)
|
||||
{
|
||||
folder = [folders objectAtIndex: count];
|
||||
calendar = [NSMutableDictionary dictionary];
|
||||
folderName = [folder nameInContainer];
|
||||
fDisplayName = [folder displayName];
|
||||
if (fDisplayName == nil)
|
||||
fDisplayName = @"";
|
||||
if ([fDisplayName isEqualToString: [co defaultFolderName]])
|
||||
fDisplayName = [self labelForKey: fDisplayName];
|
||||
[calendar setObject: [NSString stringWithFormat: @"/%@", folderName]
|
||||
forKey: @"id"];
|
||||
[calendar setObject: fDisplayName forKey: @"displayName"];
|
||||
[calendar setObject: folderName forKey: @"folder"];
|
||||
[calendar setObject: [folder calendarColor] forKey: @"color"];
|
||||
isActive = [NSNumber numberWithBool: [folder isActive]];
|
||||
[calendar setObject: isActive forKey: @"active"];
|
||||
[calendar setObject: [folder ownerInContext: context]
|
||||
forKey: @"owner"];
|
||||
[calendars addObject: calendar];
|
||||
}
|
||||
folder = [folders objectAtIndex: count];
|
||||
calendar = [NSMutableDictionary dictionary];
|
||||
folderName = [folder nameInContainer];
|
||||
fDisplayName = [folder displayName];
|
||||
if (fDisplayName == nil)
|
||||
fDisplayName = @"";
|
||||
if ([fDisplayName isEqualToString: [co defaultFolderName]])
|
||||
fDisplayName = [self labelForKey: fDisplayName];
|
||||
[calendar setObject: [NSString stringWithFormat: @"/%@", folderName]
|
||||
forKey: @"id"];
|
||||
[calendar setObject: fDisplayName forKey: @"displayName"];
|
||||
[calendar setObject: folderName forKey: @"folder"];
|
||||
[calendar setObject: [folder calendarColor] forKey: @"color"];
|
||||
isActive = [NSNumber numberWithBool: [folder isActive]];
|
||||
[calendar setObject: isActive forKey: @"active"];
|
||||
[calendar setObject: [folder ownerInContext: context]
|
||||
forKey: @"owner"];
|
||||
[calendars addObject: calendar];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return calendars;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user