Monotone-Parent: e93a01f806a40f4a4ff41e64bf05eae122e0eb6a
Monotone-Revision: 605af413c10fbef80e5952f773c4450ffface034 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2012-04-19T13:17:16maint-2.0.2
parent
3713513e51
commit
d2d1c1e104
|
@ -1,3 +1,10 @@
|
||||||
|
2012-04-19 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||||
|
|
||||||
|
* SoObjects/Appointments/SOGoAppointmentFolder.m
|
||||||
|
(-fetchFields:from:to:title:component:additionalFilters:includeProtectedInformation:):
|
||||||
|
fix the date condition for cycle record, by using c_cycleenddate
|
||||||
|
instead of c_enddate.
|
||||||
|
|
||||||
2012-04-18 Ludovic Marcotte <lmarcotte@inverse.ca>
|
2012-04-18 Ludovic Marcotte <lmarcotte@inverse.ca>
|
||||||
|
|
||||||
* SoObjects/Appointments/SOGoAppointmentObject.m (-_handleResourcesConflicts: ...):
|
* SoObjects/Appointments/SOGoAppointmentObject.m (-_handleResourcesConflicts: ...):
|
||||||
|
|
|
@ -450,16 +450,23 @@ static NSNumber *sharedYes = nil;
|
||||||
|
|
||||||
- (NSString *) _sqlStringRangeFrom: (NSCalendarDate *) _startDate
|
- (NSString *) _sqlStringRangeFrom: (NSCalendarDate *) _startDate
|
||||||
to: (NSCalendarDate *) _endDate
|
to: (NSCalendarDate *) _endDate
|
||||||
|
cycle: (BOOL) _isCycle
|
||||||
{
|
{
|
||||||
|
NSString *format;
|
||||||
unsigned int start, end;
|
unsigned int start, end;
|
||||||
|
|
||||||
start = (unsigned int) [_startDate timeIntervalSince1970];
|
start = (unsigned int) [_startDate timeIntervalSince1970];
|
||||||
end = (unsigned int) [_endDate timeIntervalSince1970];
|
end = (unsigned int) [_endDate timeIntervalSince1970];
|
||||||
|
|
||||||
// vTODOs don't necessarily have start/end dates
|
// vTODOs don't necessarily have start/end dates
|
||||||
return [NSString stringWithFormat:
|
if (_isCycle)
|
||||||
@"(c_startdate = NULL OR c_startdate <= %u) AND (c_enddate = NULL OR c_enddate >= %u)",
|
format = (@"(c_startdate = NULL OR c_startdate <= %u)"
|
||||||
end, start];
|
@" AND (c_cycleenddate = NULL OR c_cycleenddate >= %u)");
|
||||||
|
else
|
||||||
|
format = (@"(c_startdate = NULL OR c_startdate <= %u)"
|
||||||
|
@" AND (c_enddate = NULL OR c_enddate >= %u)");
|
||||||
|
|
||||||
|
return [NSString stringWithFormat: format, end, start];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSString *) aclSQLListingFilter
|
- (NSString *) aclSQLListingFilter
|
||||||
|
@ -549,7 +556,8 @@ static NSNumber *sharedYes = nil;
|
||||||
|
|
||||||
baseWhere = [NSMutableArray arrayWithCapacity: 32];
|
baseWhere = [NSMutableArray arrayWithCapacity: 32];
|
||||||
if (startDate && endDate)
|
if (startDate && endDate)
|
||||||
[baseWhere addObject: [self _sqlStringRangeFrom: startDate to: endDate]];
|
[baseWhere addObject: [self _sqlStringRangeFrom: startDate to: endDate
|
||||||
|
cycle: NO]];
|
||||||
|
|
||||||
if ([title length])
|
if ([title length])
|
||||||
[baseWhere
|
[baseWhere
|
||||||
|
@ -1134,7 +1142,8 @@ firstInstanceCalendarDateRange: (NGCalendarDateRange *) fir
|
||||||
endDate = [NSCalendarDate distantFuture];
|
endDate = [NSCalendarDate distantFuture];
|
||||||
r = [NGCalendarDateRange calendarDateRangeWithStartDate: _startDate
|
r = [NGCalendarDateRange calendarDateRangeWithStartDate: _startDate
|
||||||
endDate: endDate];
|
endDate: endDate];
|
||||||
dateSqlString = [self _sqlStringRangeFrom: _startDate to: endDate];
|
dateSqlString = [self _sqlStringRangeFrom: _startDate to: endDate
|
||||||
|
cycle: NO];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1193,6 +1202,16 @@ firstInstanceCalendarDateRange: (NGCalendarDateRange *) fir
|
||||||
/* we know the last element of "baseWhere" is the c_iscycle
|
/* we know the last element of "baseWhere" is the c_iscycle
|
||||||
condition */
|
condition */
|
||||||
[baseWhere removeLastObject];
|
[baseWhere removeLastObject];
|
||||||
|
|
||||||
|
/* replace the date range */
|
||||||
|
if (r)
|
||||||
|
{
|
||||||
|
[baseWhere removeLastObject];
|
||||||
|
dateSqlString = [self _sqlStringRangeFrom: _startDate
|
||||||
|
to: endDate
|
||||||
|
cycle: YES];
|
||||||
|
[baseWhere addObject: dateSqlString];
|
||||||
|
}
|
||||||
[baseWhere addObject: @"c_iscycle = 1"];
|
[baseWhere addObject: @"c_iscycle = 1"];
|
||||||
where = [baseWhere componentsJoinedByString: @" AND "];
|
where = [baseWhere componentsJoinedByString: @" AND "];
|
||||||
qualifier = [EOQualifier qualifierWithQualifierFormat: where];
|
qualifier = [EOQualifier qualifierWithQualifierFormat: where];
|
||||||
|
|
Loading…
Reference in New Issue