From bd362d7b29a611e253ebead9bbb9f1a3d880b9e1 Mon Sep 17 00:00:00 2001 From: wolfgang Date: Mon, 10 Sep 2007 22:25:52 +0000 Subject: [PATCH] git-svn-id: http://svn.opengroupware.org/SOGo/inverse/trunk@1172 d1b88da0-ebda-0310-925b-ed51d893ca5b --- ChangeLog | 4 ++ NEWS | 1 + SoObjects/SOGo/LDAPUserManager.m | 55 +++++++++-------- UI/Contacts/UIxContactFoldersView.m | 18 +++--- UI/MailerUI/UIxMailListView.m | 49 +++++++-------- .../English.lproj/Localizable.strings | 3 +- .../French.lproj/Localizable.strings | 3 +- .../German.lproj/Localizable.strings | 3 +- .../ContactsUI/UIxContactsListView.wox | 2 + UI/Templates/MailerUI/UIxMailEditor.wox | 2 +- UI/Templates/PreferencesUI/UIxPreferences.wox | 38 ++++++------ UI/WebServerResources/SOGoRootPage.js | 2 +- UI/WebServerResources/UIxMailEditor.css | 59 ++++++++++--------- UI/WebServerResources/UIxMailEditor.js | 41 +++++++++++-- UI/WebServerResources/UIxMailToSelection.js | 21 +------ UI/WebServerResources/UIxPreferences.css | 18 ++---- UI/WebServerResources/generic.css | 6 +- UI/WebServerResources/generic.js | 10 +++- 18 files changed, 178 insertions(+), 157 deletions(-) diff --git a/ChangeLog b/ChangeLog index c86e7a59..6cf4ed54 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2007-09-10 Wolfgang Sourdeau + * UI/Contacts/UIxContactFoldersView.m ([UIxContactFoldersView + -contactSearchAction]): only return the records which have an + email set. + * SoObjects/Mailer/SOGoMailObject.m ([SOGoMailObject -trashInContext:_ctx]): no longer expunge the mailbox after marking a message deleted. diff --git a/NEWS b/NEWS index 325e515b..f0c0a1b0 100644 --- a/NEWS +++ b/NEWS @@ -4,6 +4,7 @@ - fixed a bug where a false positive happening whenever a wrong user login was given during an indirect bind; - deleting a message no longer expunges its parent folder; +- fixed search in message content; - countless bugfixes; 0.9.0-20070824 diff --git a/SoObjects/SOGo/LDAPUserManager.m b/SoObjects/SOGo/LDAPUserManager.m index e79c1f29..01ab01a3 100644 --- a/SoObjects/SOGo/LDAPUserManager.m +++ b/SoObjects/SOGo/LDAPUserManager.m @@ -420,34 +420,37 @@ static NSString *defaultMailDomain = nil; while (userEntry) { uid = [userEntry objectForKey: @"c_uid"]; - returnContact = [compactContacts objectForKey: uid]; - if (!returnContact) + if ([uid length]) { - returnContact = [NSMutableDictionary dictionary]; - [returnContact setObject: uid forKey: @"c_uid"]; - [compactContacts setObject: returnContact forKey: uid]; - } - if (![[returnContact objectForKey: @"c_name"] length]) - [returnContact setObject: [userEntry objectForKey: @"c_name"] - forKey: @"c_name"]; - if (![[returnContact objectForKey: @"cn"] length]) - [returnContact setObject: [userEntry objectForKey: @"c_cn"] - forKey: @"cn"]; - emails = [returnContact objectForKey: @"emails"]; - if (!emails) - { - emails = [NSMutableArray array]; - [returnContact setObject: emails forKey: @"emails"]; + returnContact = [compactContacts objectForKey: uid]; + if (!returnContact) + { + returnContact = [NSMutableDictionary dictionary]; + [returnContact setObject: uid forKey: @"c_uid"]; + [compactContacts setObject: returnContact forKey: uid]; + } + if (![[returnContact objectForKey: @"c_name"] length]) + [returnContact setObject: [userEntry objectForKey: @"c_name"] + forKey: @"c_name"]; + if (![[returnContact objectForKey: @"cn"] length]) + [returnContact setObject: [userEntry objectForKey: @"c_cn"] + forKey: @"cn"]; + emails = [returnContact objectForKey: @"emails"]; + if (!emails) + { + emails = [NSMutableArray array]; + [returnContact setObject: emails forKey: @"emails"]; + } + email = [userEntry objectForKey: @"mail"]; + if (email && ![emails containsObject: email]) + [emails addObject: email]; + email = [userEntry objectForKey: @"mozillaSecondEmail"]; + if (email && ![emails containsObject: email]) + [emails addObject: email]; + email = [userEntry objectForKey: @"xmozillasecondemail"]; + if (email && ![emails containsObject: email]) + [emails addObject: email]; } - email = [userEntry objectForKey: @"mail"]; - if (email && ![emails containsObject: email]) - [emails addObject: email]; - email = [userEntry objectForKey: @"mozillaSecondEmail"]; - if (email && ![emails containsObject: email]) - [emails addObject: email]; - email = [userEntry objectForKey: @"xmozillasecondemail"]; - if (email && ![emails containsObject: email]) - [emails addObject: email]; userEntry = [contacts nextObject]; } diff --git a/UI/Contacts/UIxContactFoldersView.m b/UI/Contacts/UIxContactFoldersView.m index ed6dcd9d..1509f4a5 100644 --- a/UI/Contacts/UIxContactFoldersView.m +++ b/UI/Contacts/UIxContactFoldersView.m @@ -139,25 +139,29 @@ { WOResponse *response; NSEnumerator *contacts; - NSString *responseString; + NSString *responseString, *email; NSDictionary *contact; response = [context response]; if ([results count] > 0) { + [response setStatus: 200]; contacts = [results objectEnumerator]; contact = [contacts nextObject]; if (contact) { - responseString = [NSString stringWithFormat: @"%@:%@:%@", - [contact objectForKey: @"c_uid"], - [contact objectForKey: @"cn"], - [contact objectForKey: @"c_email"]]; - [response setStatus: 200]; + email = [contact objectForKey: @"c_email"]; + if ([email length]) + { + responseString = [NSString stringWithFormat: @"%@:%@:%@", + [contact objectForKey: @"c_uid"], + [contact objectForKey: @"cn"], + email]; // [response setHeader: @"text/plain; charset=iso-8859-1" // forKey: @"Content-Type"]; - [response appendContentString: responseString]; + [response appendContentString: responseString]; + } // contact = [contacts nextObject]; } } diff --git a/UI/MailerUI/UIxMailListView.m b/UI/MailerUI/UIxMailListView.m index c80f48e6..46f7505e 100644 --- a/UI/MailerUI/UIxMailListView.m +++ b/UI/MailerUI/UIxMailListView.m @@ -140,6 +140,7 @@ static int attachmentFlagSize = 8096; flags = [[self message] valueForKey:@"flags"]; return [flags containsObject:@"seen"]; } + - (NSString *) messageUidString { return [[[self message] valueForKey:@"uid"] stringValue]; @@ -457,29 +458,30 @@ static int attachmentFlagSize = 8096; - (void) _setQualifierForCriteria: (NSString *) criteria andValue: (NSString *) value { - NSMutableString *newQString; - [qualifier release]; - newQString = [NSMutableString stringWithString: @"(NOT flags doesContain: deleted)"]; - if ([value length] > 0) - { - if ([criteria isEqualToString: @"subject"]) - [newQString appendFormat: @" AND (subject doesContain: %@)", value]; - else if ([criteria isEqualToString: @"sender"]) - [newQString appendFormat: @" AND (sender doesContain: %@)", value]; - else if ([criteria isEqualToString: @"subject_or_sender"]) - [newQString appendFormat: @" AND ((sender doesContain: %@)" - @" OR (from doesContain: %@))", - value, value]; - else if ([criteria isEqualToString: @"to_or_cc"]) - [newQString appendFormat: @" AND ((to doesContain: %@)" - @" OR (cc doesContain: %@))", - value, value]; - else if ([criteria isEqualToString: @"entire_message"]) - [newQString appendFormat: @" AND (message doesContain: %@)", value]; - } - qualifier = [EOQualifier qualifierWithQualifierFormat: newQString]; + if ([criteria isEqualToString: @"subject"]) + qualifier = [EOQualifier qualifierWithQualifierFormat: + @"(subject doesContain: %@)", + value]; + else if ([criteria isEqualToString: @"sender"]) + qualifier = [EOQualifier qualifierWithQualifierFormat: + @"(sender doesContain: %@)", value]; + else if ([criteria isEqualToString: @"subject_or_sender"]) + qualifier = [EOQualifier qualifierWithQualifierFormat: + @"((sender doesContain: %@)" + @" OR (from doesContain: %@))", + value, value]; + else if ([criteria isEqualToString: @"to_or_cc"]) + qualifier = [EOQualifier qualifierWithQualifierFormat: + @"((to doesContain: %@)" + @" OR (cc doesContain: %@))", + value, value]; + else if ([criteria isEqualToString: @"entire_message"]) + qualifier = [EOQualifier qualifierWithQualifierFormat: + @"(body doesContain: %@)", value]; + else + qualifier = nil; [qualifier retain]; } @@ -496,8 +498,9 @@ static int attachmentFlagSize = 8096; specificMessage = [request formValueForKey: @"pageforuid"]; searchCriteria = [request formValueForKey: @"search"]; searchValue = [request formValueForKey: @"value"]; - [self _setQualifierForCriteria: searchCriteria - andValue: searchValue]; + if ([searchValue length]) + [self _setQualifierForCriteria: searchCriteria + andValue: searchValue]; firstMessageNumber = ((specificMessage) diff --git a/UI/PreferencesUI/English.lproj/Localizable.strings b/UI/PreferencesUI/English.lproj/Localizable.strings index 2e427554..64aa487e 100644 --- a/UI/PreferencesUI/English.lproj/Localizable.strings +++ b/UI/PreferencesUI/English.lproj/Localizable.strings @@ -3,8 +3,7 @@ "Close" = "Close"; /* tabs */ -"Out of Office" = "Out of Office"; -"Date and Time" = "Date and Time"; +"General" = "General"; "Calendar Options" = "Calendar Options"; "Mail Options" = "Mail Options"; "Password" = "Password"; diff --git a/UI/PreferencesUI/French.lproj/Localizable.strings b/UI/PreferencesUI/French.lproj/Localizable.strings index 3cf0d712..a3e625db 100644 --- a/UI/PreferencesUI/French.lproj/Localizable.strings +++ b/UI/PreferencesUI/French.lproj/Localizable.strings @@ -3,8 +3,7 @@ "Close" = "Fermer"; /* tabs */ -"Out of Office" = "Absence du bureau"; -"Date and Time" = "Date et heure"; +"General" = "Général"; "Calendar Options" = "Calendrier"; "Mail Options" = "Courrier"; "Password" = "Mot de passe"; diff --git a/UI/PreferencesUI/German.lproj/Localizable.strings b/UI/PreferencesUI/German.lproj/Localizable.strings index 1b0ff7ea..34ac1698 100644 --- a/UI/PreferencesUI/German.lproj/Localizable.strings +++ b/UI/PreferencesUI/German.lproj/Localizable.strings @@ -3,8 +3,7 @@ "Close" = "Schließen"; /* tabs */ -"Out of Office" = "Abwesenheit"; -"Date and Time" = "Datum und Zeit"; +"General" = "Allgemein"; "Calendar Options" = "Kalender"; "Mail Options" = "E-Mail"; "Password" = "Passwort"; diff --git a/UI/Templates/ContactsUI/UIxContactsListView.wox b/UI/Templates/ContactsUI/UIxContactsListView.wox index cd535d8d..950cfade 100644 --- a/UI/Templates/ContactsUI/UIxContactsListView.wox +++ b/UI/Templates/ContactsUI/UIxContactsListView.wox @@ -33,6 +33,8 @@ var:contactid="currentContact.c_uid" onclick="return onContactRowClick(event, this);" ondblclick="return onContactRowDblClick(event, this);" + onmousedown="return false;" + onselectstart="return false;" oncontextmenu="return onContactContextMenu(event, this);"> diff --git a/UI/Templates/MailerUI/UIxMailEditor.wox b/UI/Templates/MailerUI/UIxMailEditor.wox index bacdcb53..bfc1976a 100644 --- a/UI/Templates/MailerUI/UIxMailEditor.wox +++ b/UI/Templates/MailerUI/UIxMailEditor.wox @@ -51,8 +51,8 @@ class="textField" var:value="subject" /> +
-