From 32f00e483999aa62305469751051da9ddfb94c6b Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Tue, 15 May 2007 21:49:50 +0000 Subject: [PATCH] Monotone-Parent: e0a0e733ec72e96531ad1b2538744ad47d1f3f4e Monotone-Revision: cdf891c19e0a872a6266d03991967a4aefb3ac82 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-05-15T21:49:50 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 5 ++++ .../Appointments/SOGoAppointmentFolder.m | 27 +++++++++++++++++++ 2 files changed, 32 insertions(+) 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