mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-05-21 19:35:38 +00:00
activeTasks updates dynamically
This commit is contained in:
@@ -480,7 +480,7 @@ static NSArray *tasksFields = nil;
|
||||
return infos;
|
||||
}
|
||||
|
||||
- (WOResponse *) _responseWithData: (NSArray *) data
|
||||
- (WOResponse *) _responseWithData: (id) data
|
||||
{
|
||||
WOResponse *response;
|
||||
|
||||
@@ -1208,4 +1208,26 @@ _computeBlocksPosition (NSArray *blocks)
|
||||
return [self _responseWithData: filteredTasks];
|
||||
}
|
||||
|
||||
- (WOResponse *) activeTasksAction
|
||||
{
|
||||
SOGoAppointmentFolders *co;
|
||||
SOGoAppointmentFolder *folder;
|
||||
NSArray *folders;
|
||||
NSNumber *tasksCount, *foldersCount;
|
||||
NSString *calendarID;
|
||||
NSMutableDictionary *activeTasksByCalendars;
|
||||
|
||||
co = [self clientObject];
|
||||
folders = [co subFolders];
|
||||
foldersCount = [folders count];
|
||||
activeTasksByCalendars = [NSMutableDictionary dictionaryWithCapacity:foldersCount];
|
||||
for (folder in folders) {
|
||||
tasksCount = [folder activeTasks];
|
||||
calendarID = [folder nameInContainer];
|
||||
[activeTasksByCalendars setObject:tasksCount forKey:calendarID];
|
||||
}
|
||||
|
||||
return [self _responseWithData: activeTasksByCalendars];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user