Monotone-Parent: d964b6374c8b995e67d8bce06f4be5855ceb1428
Monotone-Revision: b1fef274eded93af1afedb293db6a9921fadf828 Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2009-02-17T14:30:49 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
parent
9af71076f9
commit
72592597ca
12
ChangeLog
12
ChangeLog
|
@ -1,3 +1,15 @@
|
||||||
|
2009-02-17 Francis Lachapelle <flachapelle@inverse.ca>
|
||||||
|
|
||||||
|
* UI/Contacts/UIxContactFoldersView.m ([UIxContactFoldersView
|
||||||
|
-allContactSearchAction]): replaced references to "displayName" by
|
||||||
|
"c_cn", following changes made on 2009-02-06.
|
||||||
|
|
||||||
|
* SoObjects/Contacts/SOGoContactGCSFolder.m ([SOGoContactGCSFolder
|
||||||
|
-_qualifierForFilter:]): changed search in email address to match
|
||||||
|
search behavior of Thunderbird.
|
||||||
|
|
||||||
|
* SoObjects/SOGo/LDAPSource.m ([LDAPSource -_qualifierForFilter:]): idem.
|
||||||
|
|
||||||
2009-02-09 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
2009-02-09 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||||
|
|
||||||
* SoObjects/Contacts/SOGoContactLDAPFolder.m
|
* SoObjects/Contacts/SOGoContactLDAPFolder.m
|
||||||
|
|
|
@ -221,7 +221,7 @@
|
||||||
@"(c_sn isCaseInsensitiveLike: '%@%%') OR "
|
@"(c_sn isCaseInsensitiveLike: '%@%%') OR "
|
||||||
@"(c_givenname isCaseInsensitiveLike: '%@%%') OR "
|
@"(c_givenname isCaseInsensitiveLike: '%@%%') OR "
|
||||||
@"(c_cn isCaseInsensitiveLike: '%@%%') OR "
|
@"(c_cn isCaseInsensitiveLike: '%@%%') OR "
|
||||||
@"(c_mail isCaseInsensitiveLike: '%%%@%%') OR "
|
@"(c_mail isCaseInsensitiveLike: '%@%%') OR "
|
||||||
@"(c_telephonenumber isCaseInsensitiveLike: '%%%@%%')",
|
@"(c_telephonenumber isCaseInsensitiveLike: '%%%@%%')",
|
||||||
filter, filter, filter, filter, filter];
|
filter, filter, filter, filter, filter];
|
||||||
qualifier = [EOQualifier qualifierWithQualifierFormat: qs];
|
qualifier = [EOQualifier qualifierWithQualifierFormat: qs];
|
||||||
|
|
|
@ -363,7 +363,7 @@ static NSLock *lock;
|
||||||
NSString *qs, *mailFormat, *fieldFormat;
|
NSString *qs, *mailFormat, *fieldFormat;
|
||||||
EOQualifier *qualifier;
|
EOQualifier *qualifier;
|
||||||
|
|
||||||
fieldFormat = [NSString stringWithFormat: @"(%%@='*%@*')", filter];
|
fieldFormat = [NSString stringWithFormat: @"(%%@='%@*')", filter];
|
||||||
mailFormat = [[mailFields stringsWithFormat: fieldFormat]
|
mailFormat = [[mailFields stringsWithFormat: fieldFormat]
|
||||||
componentsJoinedByString: @" OR "];
|
componentsJoinedByString: @" OR "];
|
||||||
|
|
||||||
|
|
|
@ -196,7 +196,7 @@ withSearchOn: (NSString *) contact
|
||||||
NSMutableArray *sortedFolders;
|
NSMutableArray *sortedFolders;
|
||||||
NSMutableDictionary *uniqueContacts;
|
NSMutableDictionary *uniqueContacts;
|
||||||
unsigned int i, j;
|
unsigned int i, j;
|
||||||
NSSortDescriptor *displayNameDescriptor;
|
NSSortDescriptor *commonNameDescriptor;
|
||||||
|
|
||||||
searchText = [self queryParameterForKey: @"search"];
|
searchText = [self queryParameterForKey: @"search"];
|
||||||
if ([searchText length] > 0)
|
if ([searchText length] > 0)
|
||||||
|
@ -219,23 +219,23 @@ withSearchOn: (NSString *) contact
|
||||||
folder = [sortedFolders objectAtIndex: i];
|
folder = [sortedFolders objectAtIndex: i];
|
||||||
//NSLog(@" Address book: %@ (%@)", [folder displayName], [folder class]);
|
//NSLog(@" Address book: %@ (%@)", [folder displayName], [folder class]);
|
||||||
contacts = [folder lookupContactsWithFilter: searchText
|
contacts = [folder lookupContactsWithFilter: searchText
|
||||||
sortBy: @"displayName"
|
sortBy: @"c_cn"
|
||||||
ordering: NSOrderedAscending];
|
ordering: NSOrderedAscending];
|
||||||
for (j = 0; j < [contacts count]; j++)
|
for (j = 0; j < [contacts count]; j++)
|
||||||
{
|
{
|
||||||
contact = [contacts objectAtIndex: j];
|
contact = [contacts objectAtIndex: j];
|
||||||
mail = [contact objectForKey: @"mail"];
|
mail = [contact objectForKey: @"c_mail"];
|
||||||
//NSLog(@" found %@ (%@)", [contact objectForKey: @"displayName"], mail);
|
//NSLog(@" found %@ (%@)", [contact objectForKey: @"displayName"], mail);
|
||||||
if ([mail isNotNull] && [uniqueContacts objectForKey: mail] == nil)
|
if ([mail isNotNull] && [uniqueContacts objectForKey: mail] == nil)
|
||||||
[uniqueContacts setObject: contact forKey: [contact objectForKey: @"mail"]];
|
[uniqueContacts setObject: contact forKey: mail];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ([uniqueContacts count] > 0)
|
if ([uniqueContacts count] > 0)
|
||||||
{
|
{
|
||||||
// Sort the contacts by display name
|
// Sort the contacts by display name
|
||||||
displayNameDescriptor = [[[NSSortDescriptor alloc] initWithKey: @"displayName"
|
commonNameDescriptor = [[[NSSortDescriptor alloc] initWithKey: @"c_cn"
|
||||||
ascending:YES] autorelease];
|
ascending:YES] autorelease];
|
||||||
descriptors = [NSArray arrayWithObjects: displayNameDescriptor, nil];
|
descriptors = [NSArray arrayWithObjects: commonNameDescriptor, nil];
|
||||||
sortedContacts = [[uniqueContacts allValues] sortedArrayUsingDescriptors: descriptors];
|
sortedContacts = [[uniqueContacts allValues] sortedArrayUsingDescriptors: descriptors];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -438,14 +438,14 @@ function performSearchCallback(http) {
|
||||||
// Populate popup menu
|
// Populate popup menu
|
||||||
for (var i = 0; i < data.contacts.length; i++) {
|
for (var i = 0; i < data.contacts.length; i++) {
|
||||||
var contact = data.contacts[i];
|
var contact = data.contacts[i];
|
||||||
var completeEmail = contact["displayName"] + " <" + contact["mail"] + ">";
|
var completeEmail = contact["c_cn"] + " <" + contact["c_mail"] + ">";
|
||||||
var node = new Element('li', { 'address': completeEmail });
|
var node = new Element('li', { 'address': completeEmail });
|
||||||
var matchPosition = completeEmail.toLowerCase().indexOf(data.searchText.toLowerCase());
|
var matchPosition = completeEmail.toLowerCase().indexOf(data.searchText.toLowerCase());
|
||||||
var matchBefore = completeEmail.substring(0, matchPosition);
|
var matchBefore = completeEmail.substring(0, matchPosition);
|
||||||
var matchText = completeEmail.substring(matchPosition, matchPosition + data.searchText.length);
|
var matchText = completeEmail.substring(matchPosition, matchPosition + data.searchText.length);
|
||||||
var matchAfter = completeEmail.substring(matchPosition + data.searchText.length);
|
var matchAfter = completeEmail.substring(matchPosition + data.searchText.length);
|
||||||
list.appendChild(node);
|
list.appendChild(node);
|
||||||
node.uid = contact["c_uid"];
|
node.uid = contact["c_name"];
|
||||||
node.appendChild(document.createTextNode(matchBefore));
|
node.appendChild(document.createTextNode(matchBefore));
|
||||||
node.appendChild(new Element('strong').update(matchText));
|
node.appendChild(new Element('strong').update(matchText));
|
||||||
node.appendChild(document.createTextNode(matchAfter));
|
node.appendChild(document.createTextNode(matchAfter));
|
||||||
|
@ -482,10 +482,9 @@ function performSearchCallback(http) {
|
||||||
if (data.contacts.length == 1) {
|
if (data.contacts.length == 1) {
|
||||||
// Single result
|
// Single result
|
||||||
var contact = data.contacts[0];
|
var contact = data.contacts[0];
|
||||||
if (contact["c_uid"].length > 0)
|
input.uid = contact["c_name"];
|
||||||
input.uid = contact["c_uid"];
|
var completeEmail = contact["c_cn"] + " <" + contact["c_mail"] + ">";
|
||||||
var completeEmail = contact["displayName"] + " <" + contact["mail"] + ">";
|
if (contact["c_cn"].substring(0, input.value.length).toUpperCase()
|
||||||
if (contact["displayName"].substring(0, input.value.length).toUpperCase()
|
|
||||||
== input.value.toUpperCase())
|
== input.value.toUpperCase())
|
||||||
input.value = completeEmail;
|
input.value = completeEmail;
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue