diff --git a/ChangeLog b/ChangeLog index 20292c4ed..e6d330315 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,8 @@ (-fetchFields:from:to:title:component:additionalFilters:includeProtectedInformation:): make use of a mutable array to define the global WHERE clause, by joining the elements with " AND ". + (-additionalWebdavSyncFilters): don't include 'vtodo' components + when -[self showCalendarTasks] returns NO. 2012-04-11 Francis Lachapelle diff --git a/SoObjects/Appointments/SOGoAppointmentFolder.m b/SoObjects/Appointments/SOGoAppointmentFolder.m index 3dc88d746..2fade58f7 100644 --- a/SoObjects/Appointments/SOGoAppointmentFolder.m +++ b/SoObjects/Appointments/SOGoAppointmentFolder.m @@ -1675,21 +1675,25 @@ firstInstanceCalendarDateRange: (NGCalendarDateRange *) fir { NSCalendarDate *startDate; NSString *filter; + NSMutableArray *filters; int startDateSecs; + filters = [NSMutableArray arrayWithCapacity: 8]; startDate = [self _getMaxStartDate]; if (startDate) { startDateSecs = (int) [startDate timeIntervalSince1970]; - filter = [NSString stringWithFormat: @"c_enddate = NULL" + filter = [NSString stringWithFormat: @"(c_enddate = NULL" @" OR (c_enddate >= %d AND c_iscycle = 0)" - @" OR (c_cycleenddate >= %d AND c_iscycle = 1)", + @" OR (c_cycleenddate >= %d AND c_iscycle = 1))", startDateSecs, startDateSecs]; + [filters addObject: filter]; } - else - filter = @""; - return filter; + if (![self showCalendarTasks]) + [filters addObject: @"c_component != 'vtodo'"]; + + return [filters componentsJoinedByString: @" AND "]; } - (Class) objectClassForContent: (NSString *) content