diff --git a/ChangeLog b/ChangeLog index e7201c9e0..b258aa194 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2006-10-30 Wolfgang Sourdeau + * SoObjects/Appointments/SOGoAppointmentFolder.m + ([SOGoAppointmentFolder + -fetchFields:_fieldsfromFolder:_folderfrom:_startDateto:_endDatecomponent:_component]): reverted to search algorithm to search for events happening outside 0 or 1 (at most) boundary of the timerange. + * UI/Scheduler/UIxFreeBusyUserSelectorTable.[hm]: new subcomponent derived and taken as a subset of UIxFreeBusyUserSelector that implements the table part of the FreeBusy view. Most of the diff --git a/SoObjects/Appointments/SOGoAppointmentFolder.m b/SoObjects/Appointments/SOGoAppointmentFolder.m index 7e1e9156c..df72be3e7 100644 --- a/SoObjects/Appointments/SOGoAppointmentFolder.m +++ b/SoObjects/Appointments/SOGoAppointmentFolder.m @@ -633,6 +633,19 @@ static NSNumber *sharedYes = nil; return sqlString; } +- (NSString *) _sqlStringRangeFrom: (NSCalendarDate *) _startDate + to: (NSCalendarDate *) _endDate +{ + unsigned int start, end; + + start = (unsigned int) [_startDate timeIntervalSince1970]; + end = (unsigned int) [_endDate timeIntervalSince1970]; + + return [NSString stringWithFormat: + @" AND (startdate <= %d) AND (enddate >= %d)", + end, start]; +} + - (NSArray *) fetchFields: (NSArray *) _fields fromFolder: (GCSFolder *) _folder from: (NSCalendarDate *) _startDate @@ -655,10 +668,7 @@ static NSNumber *sharedYes = nil; { r = [NGCalendarDateRange calendarDateRangeWithStartDate: _startDate endDate: _endDate]; - dateSqlString - = [NSString stringWithFormat: @" AND (startdate >= %d) AND (enddate <= %d)", - (unsigned int) [_startDate timeIntervalSince1970], - (unsigned int) [_endDate timeIntervalSince1970]]; + dateSqlString = [self _sqlStringRangeFrom: _startDate to: _endDate]; } else {