Monotone-Parent: c7c2186348790bb64c08730ba255f908ac68cfa9

Monotone-Revision: c646d0cb24c5b2d251fb7736020445cd76631da3

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2007-11-21T17:23:51
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2007-11-21 17:23:51 +00:00
parent 3391161a12
commit e414ebafc6
9 changed files with 59 additions and 22 deletions
+10
View File
@@ -1,5 +1,15 @@
2007-11-21 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* SoObjects/Appointments/SOGoAppointmentFolder.m
([SOGoAppointmentFolder
-fetchFields:_fieldsfromFolder:_folderfrom:_startDateto:_endDatetitle:titlecomponent:_component]):
added search on the c_title column too.
* UI/Scheduler/UIxCalListingActions.m ([UIxCalListingActions
-eventsListAction]): take the "search" url parameter into account.
([UIxCalListingActions -eventsListAction]): fetch events matching
the title filter too.
* UI/MainUI/SOGoRootPage.m ([SOGoRootPage -connectAction]): the
user infos are now posted as "application/x-www-form-urlencoded".
So we have to have like a form has been posted.
@@ -70,15 +70,18 @@
fromFolder: (GCSFolder *) _folder
from: (NSCalendarDate *) _startDate
to: (NSCalendarDate *) _endDate
title: (NSString *) title
component: (id) _component;
- (NSArray * ) fetchFields: (NSArray *) _fields
from: (NSCalendarDate *) _startDate
to: (NSCalendarDate *) _endDate
title: (NSString *) title
component: (id) _component;
- (NSArray *) fetchCoreInfosFrom: (NSCalendarDate *) _startDate
to: (NSCalendarDate *) _endDate
title: (NSString *) title
component: (id) _component;
- (NSArray *) fetchFreeBusyInfosFrom: (NSCalendarDate *) _startDate
+20 -5
View File
@@ -266,6 +266,7 @@ static NSNumber *sharedYes = nil;
currentFilter = [filters objectAtIndex: 0];
apts = [self fetchCoreInfosFrom: [currentFilter objectForKey: @"start"]
to: [currentFilter objectForKey: @"end"]
title: [currentFilter objectForKey: @"title"]
component: [currentFilter objectForKey: @"name"]];
appointments = [apts objectEnumerator];
appointment = [appointments nextObject];
@@ -801,12 +802,14 @@ static NSNumber *sharedYes = nil;
fromFolder: (GCSFolder *) _folder
from: (NSCalendarDate *) _startDate
to: (NSCalendarDate *) _endDate
title: (NSString *) title
component: (id) _component
{
EOQualifier *qualifier;
NSMutableArray *fields, *ma = nil;
NSArray *records;
NSString *sql, *dateSqlString, *componentSqlString, *privacySqlString;
NSString *sql, *dateSqlString, *titleSqlString, *componentSqlString,
*privacySqlString;
NGCalendarDateRange *r;
if (_folder == nil) {
@@ -827,6 +830,12 @@ static NSNumber *sharedYes = nil;
dateSqlString = @"";
}
if ([title length])
titleSqlString = [NSString stringWithFormat: @"AND (c_title"
@" isCaseInsensitiveLike: '%%%@%%')", title];
else
titleSqlString = @"";
componentSqlString = [self _sqlStringForComponent: _component];
privacySqlString = [self _privacySqlString];
@@ -840,8 +849,9 @@ static NSNumber *sharedYes = nil;
if (logger)
[self debugWithFormat:@"should fetch (%@=>%@) ...", _startDate, _endDate];
sql = [NSString stringWithFormat: @"(c_iscycle = 0)%@%@%@",
dateSqlString, componentSqlString, privacySqlString];
sql = [NSString stringWithFormat: @"(c_iscycle = 0)%@%@%@%@",
dateSqlString, titleSqlString,
componentSqlString, privacySqlString];
/* fetch non-recurrent apts first */
qualifier = [EOQualifier qualifierWithQualifierFormat: sql];
@@ -860,7 +870,8 @@ static NSNumber *sharedYes = nil;
/* fetch recurrent apts now. we do NOT consider the date range when doing that
as the c_startdate/c_enddate of a recurring event is always set to the first
recurrence - others are generated on the fly */
sql = [NSString stringWithFormat: @"(c_iscycle = 1)%@%@", componentSqlString, privacySqlString];
sql = [NSString stringWithFormat: @"(c_iscycle = 1)%@%@%@", titleSqlString,
componentSqlString, privacySqlString];
qualifier = [EOQualifier qualifierWithQualifierFormat: sql];
@@ -896,6 +907,7 @@ static NSNumber *sharedYes = nil;
- (NSArray *) fetchFields: (NSArray *) _fields
from: (NSCalendarDate *) _startDate
to: (NSCalendarDate *) _endDate
title: (NSString *) title
component: (id) _component
{
GCSFolder *folder;
@@ -908,6 +920,7 @@ static NSNumber *sharedYes = nil;
return [self fetchFields: _fields fromFolder: folder
from: _startDate to: _endDate
title: title
component: _component];
}
@@ -921,11 +934,13 @@ static NSNumber *sharedYes = nil;
@"c_isopaque", @"c_status", nil];
return [self fetchFields: infos from: _startDate to: _endDate
title: nil
component: @"vevent"];
}
- (NSArray *) fetchCoreInfosFrom: (NSCalendarDate *) _startDate
to: (NSCalendarDate *) _endDate
title: (NSString *) title
component: (id) _component
{
static NSArray *infos = nil; // TODO: move to a plist file
@@ -940,7 +955,7 @@ static NSNumber *sharedYes = nil;
@"c_partstates", @"c_sequence", @"c_priority", @"c_cycleinfo",
nil];
return [self fetchFields: infos from: _startDate to: _endDate
return [self fetchFields: infos from: _startDate to: _endDate title: title
component: _component];
}
@@ -180,6 +180,7 @@
results = [aptFolder fetchFields: _fields
from: _startDate
to: _endDate
title: nil
component: _component];
if (![results isNotNull]) continue;
+1
View File
@@ -41,6 +41,7 @@
NSMutableDictionary *componentsData;
NSCalendarDate *startDate;
NSCalendarDate *endDate;
NSString *title;
NSString *userLogin;
WORequest *request;
SOGoDateFormatter *dateFormatter;
+5 -1
View File
@@ -161,7 +161,10 @@
param = [request formValueForKey: @"filterpopup"];
if ([param length] > 0)
[self _setupDatesWithPopup: param andUserTZ: userTZ];
{
[self _setupDatesWithPopup: param andUserTZ: userTZ];
title = [request formValueForKey: @"search"];
}
else
{
param = [request formValueForKey: @"sd"];
@@ -241,6 +244,7 @@
{
currentInfos = [[currentFolder fetchCoreInfosFrom: startDate
to: endDate
title: title
component: component] objectEnumerator];
while ((newInfo = [currentInfos nextObject]))
+1 -1
View File
@@ -452,7 +452,7 @@ function onFolderSelectionChange() {
}
function refreshCurrentFolder() {
openContactsFolder(currentContactFolder, true);
openContactsFolder(currentContactFolder, true);
}
function onConfirmContactSelection(event) {
+18 -11
View File
@@ -660,7 +660,8 @@ function refreshCalendarEvents(scrollEvent) {
var url = ApplicationBaseURL + "eventslist?sd=" + sd + "&ed=" + ed;
document.refreshCalendarEventsAjaxRequest
= triggerAjaxRequest(url, refreshCalendarEventsCallback,
{"startDate": sd, "endDate": ed, "scrollEvent": scrollEvent});
{"startDate": sd, "endDate": ed,
"scrollEvent": scrollEvent});
}
function refreshCalendarEventsCallback(http) {
@@ -1005,11 +1006,23 @@ function onHeaderClick(event) {
preventDefault(event);
}
function refreshCurrentFolder() {
refreshEvents();
}
function refreshEvents() {
return _loadEventHref("eventslist?desc=" + sortOrder
+ "&sort=" + sortKey
+ "&day=" + currentDay
+ "&filterpopup=" + listFilter);
var titleSearch;
var value = search["value"];
if (value && value.length)
titleSearch = "&search=" + value;
else
titleSearch = "";
return _loadEventHref("eventslist?desc=" + sortOrder
+ "&sort=" + sortKey
+ "&day=" + currentDay
+ titleSearch
+ "&filterpopup=" + listFilter);
}
function refreshTasks() {
@@ -1097,12 +1110,6 @@ function onYearMenuItemClick(event) {
changeDateSelectorDisplay(year + month + "01", true);
}
function onSearchFormSubmit() {
log ("search not implemented");
return false;
}
function selectCalendarEvent(div) {
// Select event in calendar view
if (selectedCalendarCell)
-4
View File
@@ -843,10 +843,6 @@ function checkSearchValue(event) {
searchValue.value = "";
}
function onSearchChange() {
log ("onSearchChange()...");
}
function configureSearchField() {
var searchValue = $("searchValue");
var searchOptions = $("searchOptions");