From 593b44ed01212d5ffb12dc513b9c1f5be8f4aca9 Mon Sep 17 00:00:00 2001 From: Alexandre Cloutier Date: Thu, 8 May 2014 17:53:20 -0400 Subject: [PATCH] forgotten code --- SoObjects/Appointments/SOGoAppointmentFolder.m | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/SoObjects/Appointments/SOGoAppointmentFolder.m b/SoObjects/Appointments/SOGoAppointmentFolder.m index 8552ae72f..42ff94462 100644 --- a/SoObjects/Appointments/SOGoAppointmentFolder.m +++ b/SoObjects/Appointments/SOGoAppointmentFolder.m @@ -1280,13 +1280,20 @@ firstInstanceCalendarDateRange: (NGCalendarDateRange *) fir [baseWhere addObject: privacySQLString]; if ([title length]) - [baseWhere - addObject: [NSString stringWithFormat: @"c_title isCaseInsensitiveLike: '%%%@%%'", + if ([filters length]) + { + if ([filters isEqualToString:@"title_Category_Location"] || [filters isEqualToString:@"entireContent"]) + { + [baseWhere addObject: [NSString stringWithFormat: @"(c_title isCaseInsensitiveLike: '%%%@%%' OR c_category isCaseInsensitiveLike: '%%%@%%' OR c_location isCaseInsensitiveLike: '%%%@%%')", + [title stringByReplacingString: @"'" withString: @"\\'\\'"], + [title stringByReplacingString: @"'" withString: @"\\'\\'"], + [title stringByReplacingString: @"'" withString: @"\\'\\'"]]]; + } + } + else + [baseWhere addObject: [NSString stringWithFormat: @"c_title isCaseInsensitiveLike: '%%%@%%'", [title stringByReplacingString: @"'" withString: @"\\'\\'"]]]; - if ([filters length]) - [baseWhere addObject: [NSString stringWithFormat: @"(%@)", filters]]; - /* prepare mandatory fields */ fields = [NSMutableArray arrayWithArray: _fields];