Monotone-Parent: d964b6374c8b995e67d8bce06f4be5855ceb1428
Monotone-Revision: b1fef274eded93af1afedb293db6a9921fadf828 Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2009-02-17T14:30:49 Monotone-Branch: ca.inverse.sogomaint-2.0.2
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>
|
||||
|
||||
* SoObjects/Contacts/SOGoContactLDAPFolder.m
|
||||
|
|
|
@ -221,7 +221,7 @@
|
|||
@"(c_sn isCaseInsensitiveLike: '%@%%') OR "
|
||||
@"(c_givenname isCaseInsensitiveLike: '%@%%') OR "
|
||||
@"(c_cn isCaseInsensitiveLike: '%@%%') OR "
|
||||
@"(c_mail isCaseInsensitiveLike: '%%%@%%') OR "
|
||||
@"(c_mail isCaseInsensitiveLike: '%@%%') OR "
|
||||
@"(c_telephonenumber isCaseInsensitiveLike: '%%%@%%')",
|
||||
filter, filter, filter, filter, filter];
|
||||
qualifier = [EOQualifier qualifierWithQualifierFormat: qs];
|
||||
|
|
|
@ -363,7 +363,7 @@ static NSLock *lock;
|
|||
NSString *qs, *mailFormat, *fieldFormat;
|
||||
EOQualifier *qualifier;
|
||||
|
||||
fieldFormat = [NSString stringWithFormat: @"(%%@='*%@*')", filter];
|
||||
fieldFormat = [NSString stringWithFormat: @"(%%@='%@*')", filter];
|
||||
mailFormat = [[mailFields stringsWithFormat: fieldFormat]
|
||||
componentsJoinedByString: @" OR "];
|
||||
|
||||
|
|
|
@ -196,7 +196,7 @@ withSearchOn: (NSString *) contact
|
|||
NSMutableArray *sortedFolders;
|
||||
NSMutableDictionary *uniqueContacts;
|
||||
unsigned int i, j;
|
||||
NSSortDescriptor *displayNameDescriptor;
|
||||
NSSortDescriptor *commonNameDescriptor;
|
||||
|
||||
searchText = [self queryParameterForKey: @"search"];
|
||||
if ([searchText length] > 0)
|
||||
|
@ -219,24 +219,24 @@ withSearchOn: (NSString *) contact
|
|||
folder = [sortedFolders objectAtIndex: i];
|
||||
//NSLog(@" Address book: %@ (%@)", [folder displayName], [folder class]);
|
||||
contacts = [folder lookupContactsWithFilter: searchText
|
||||
sortBy: @"displayName"
|
||||
sortBy: @"c_cn"
|
||||
ordering: NSOrderedAscending];
|
||||
for (j = 0; j < [contacts count]; j++)
|
||||
{
|
||||
contact = [contacts objectAtIndex: j];
|
||||
mail = [contact objectForKey: @"mail"];
|
||||
mail = [contact objectForKey: @"c_mail"];
|
||||
//NSLog(@" found %@ (%@)", [contact objectForKey: @"displayName"], mail);
|
||||
if ([mail isNotNull] && [uniqueContacts objectForKey: mail] == nil)
|
||||
[uniqueContacts setObject: contact forKey: [contact objectForKey: @"mail"]];
|
||||
[uniqueContacts setObject: contact forKey: mail];
|
||||
}
|
||||
}
|
||||
if ([uniqueContacts count] > 0)
|
||||
{
|
||||
// Sort the contacts by display name
|
||||
displayNameDescriptor = [[[NSSortDescriptor alloc] initWithKey: @"displayName"
|
||||
commonNameDescriptor = [[[NSSortDescriptor alloc] initWithKey: @"c_cn"
|
||||
ascending:YES] autorelease];
|
||||
descriptors = [NSArray arrayWithObjects: displayNameDescriptor, nil];
|
||||
sortedContacts = [[uniqueContacts allValues] sortedArrayUsingDescriptors: descriptors];
|
||||
descriptors = [NSArray arrayWithObjects: commonNameDescriptor, nil];
|
||||
sortedContacts = [[uniqueContacts allValues] sortedArrayUsingDescriptors: descriptors];
|
||||
}
|
||||
else
|
||||
sortedContacts = [NSArray array];
|
||||
|
@ -265,7 +265,7 @@ withSearchOn: (NSString *) contact
|
|||
if ([searchText length] > 0)
|
||||
{
|
||||
um = [LDAPUserManager sharedUserManager];
|
||||
contacts
|
||||
contacts
|
||||
= [self _responseForResults: [um fetchContactsMatching: searchText]];
|
||||
data = [NSDictionary dictionaryWithObjectsAndKeys: searchText, @"searchText",
|
||||
contacts, @"contacts",
|
||||
|
|
|
@ -438,14 +438,14 @@ function performSearchCallback(http) {
|
|||
// Populate popup menu
|
||||
for (var i = 0; i < data.contacts.length; 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 matchPosition = completeEmail.toLowerCase().indexOf(data.searchText.toLowerCase());
|
||||
var matchBefore = completeEmail.substring(0, matchPosition);
|
||||
var matchText = completeEmail.substring(matchPosition, matchPosition + data.searchText.length);
|
||||
var matchAfter = completeEmail.substring(matchPosition + data.searchText.length);
|
||||
list.appendChild(node);
|
||||
node.uid = contact["c_uid"];
|
||||
node.uid = contact["c_name"];
|
||||
node.appendChild(document.createTextNode(matchBefore));
|
||||
node.appendChild(new Element('strong').update(matchText));
|
||||
node.appendChild(document.createTextNode(matchAfter));
|
||||
|
@ -482,10 +482,9 @@ function performSearchCallback(http) {
|
|||
if (data.contacts.length == 1) {
|
||||
// Single result
|
||||
var contact = data.contacts[0];
|
||||
if (contact["c_uid"].length > 0)
|
||||
input.uid = contact["c_uid"];
|
||||
var completeEmail = contact["displayName"] + " <" + contact["mail"] + ">";
|
||||
if (contact["displayName"].substring(0, input.value.length).toUpperCase()
|
||||
input.uid = contact["c_name"];
|
||||
var completeEmail = contact["c_cn"] + " <" + contact["c_mail"] + ">";
|
||||
if (contact["c_cn"].substring(0, input.value.length).toUpperCase()
|
||||
== input.value.toUpperCase())
|
||||
input.value = completeEmail;
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue