display the number of active tasks in calendar view

This commit is contained in:
Alexandre Cloutier
2014-06-10 16:18:12 -04:00
parent 19a95a1818
commit 43ac57b671
4 changed files with 61 additions and 32 deletions
@@ -80,6 +80,8 @@ typedef enum {
- (NSArray *) calendarUIDs;
- (NSString *) activeTasks;
/* vevent UID handling */
- (NSString *) resourceNameForEventUID: (NSString *) _uid;
+21 -1
View File
@@ -522,7 +522,6 @@ static iCalEvent *iCalEventK = nil;
{
/* this is used for group calendars (this folder just returns itself) */
NSString *s;
s = [[self container] nameInContainer];
// [self logWithFormat:@"CAL UID: %@", s];
return [s isNotNull] ? [NSArray arrayWithObjects:&s count:1] : nil;
@@ -3270,4 +3269,25 @@ firstInstanceCalendarDateRange: (NGCalendarDateRange *) fir
return users;
}
- (NSString *) activeTasks
{
NSArray *tasksList;
NSString *activeTasks;
NSMutableArray *fields;
fields = [NSMutableArray arrayWithObjects: @"c_component", @"c_status", nil];
tasksList = [self bareFetchFields: fields
from: nil
to: nil
title: nil
component: @"vtodo"
additionalFilters: @"c_status != 2 AND c_status != 3"];
activeTasks = [NSString stringWithFormat:@"(%d)", [tasksList count]];
return activeTasks;
}
@end /* SOGoAppointmentFolder */