diff --git a/ChangeLog b/ChangeLog index 7f082141e..912c9c482 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2007-05-15 Wolfgang Sourdeau + * SoObjects/Appointments/SOGoAppointmentFolder.m + ([SOGoAppointmentFolder -fetchContentObjectNames]): override + method to return the events in the range of 2 weeks ago up to 4 + weeks from "now". + * UI/MailPartViewers/UIxMailPartTextViewer.m ([UIxMailPartTextViewer -flatContentAsString]): use the new "stringByDetectingURLs" method to offer clickable urls. diff --git a/SoObjects/Appointments/SOGoAppointmentFolder.m b/SoObjects/Appointments/SOGoAppointmentFolder.m index f07b81bf6..2300c7e15 100644 --- a/SoObjects/Appointments/SOGoAppointmentFolder.m +++ b/SoObjects/Appointments/SOGoAppointmentFolder.m @@ -1257,6 +1257,33 @@ static NSNumber *sharedYes = nil; return calendarFolders; } +- (NSArray *) fetchContentObjectNames +{ + NSMutableArray *objectNames; + NSArray *records; + NSCalendarDate *today, *startDate, *endDate; + +#warning this should be user-configurable + objectNames = [NSMutableArray array]; + today = [[NSCalendarDate calendarDate] beginOfDay]; + [today setTimeZone: timeZone]; + + startDate = [today dateByAddingYears: 0 months: 0 days: -14 + hours: 0 minutes: 0 seconds: 0]; + endDate = [startDate dateByAddingYears: 0 months: 1 days: 0 + hours: 0 minutes: 0 seconds: 0]; + records = [self fetchFields: [NSArray arrayWithObject: @"c_name"] + from: startDate to: endDate + component: @"vevent"]; + [objectNames addObjectsFromArray: [records valueForKey: @"c_name"]]; + records = [self fetchFields: [NSArray arrayWithObject: @"c_name"] + from: startDate to: endDate + component: @"vtodo"]; + [objectNames addObjectsFromArray: [records valueForKey: @"c_name"]]; + + return objectNames; +} + /* folder type */ - (NSString *) folderType