From 0b09c1b52b00daea4273ee3c2adca5a0d38748d7 Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Fri, 17 Oct 2008 02:17:56 +0000 Subject: [PATCH 1/3] Fix for bug #3039 Monotone-Parent: 6c02bf9631ff4ffa77f3dd2068fdf632d29bcc25 Monotone-Revision: fd6739c8912ccda074f93108e73623ee0dcc2d1b Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2008-10-17T02:17:56 Monotone-Branch: ca.inverse.sogo --- UI/Contacts/UIxContactFoldersView.m | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/UI/Contacts/UIxContactFoldersView.m b/UI/Contacts/UIxContactFoldersView.m index 27d7526a4..54128163d 100644 --- a/UI/Contacts/UIxContactFoldersView.m +++ b/UI/Contacts/UIxContactFoldersView.m @@ -42,6 +42,7 @@ #import #import #import +#import #import #import #import @@ -192,6 +193,7 @@ withSearchOn: (NSString *) contact NSString *searchText, *mail; NSDictionary *contact, *data; NSArray *folders, *contacts, *descriptors, *sortedContacts; + NSMutableArray *sortedFolders; NSMutableDictionary *uniqueContacts; unsigned int i, j; NSSortDescriptor *displayNameDescriptor; @@ -201,10 +203,20 @@ withSearchOn: (NSString *) contact { //NSLog(@"Search all contacts: %@", searchText); folders = [[self clientObject] subFolders]; + sortedFolders = [NSMutableArray arrayWithCapacity: [folders count]]; uniqueContacts = [NSMutableDictionary dictionary]; + /* We first search in LDAP folders (in case of duplicated entries in GCS folders) */ for (i = 0; i < [folders count]; i++) { folder = [folders objectAtIndex: i]; + if ([folder isKindOfClass: [SOGoContactLDAPFolder class]]) + [sortedFolders insertObject: folder atIndex: 0]; + else + [sortedFolders addObject: folder]; + } + for (i = 0; i < [sortedFolders count]; i++) + { + folder = [sortedFolders objectAtIndex: i]; //NSLog(@" Address book: %@ (%@)", [folder displayName], [folder class]); contacts = [folder lookupContactsWithFilter: searchText sortBy: @"displayName" From 5bb2c383262fed5273b2f6e753185e14ae461219 Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Fri, 17 Oct 2008 23:41:27 +0000 Subject: [PATCH 2/3] Fix for bug #3038 Monotone-Parent: fd6739c8912ccda074f93108e73623ee0dcc2d1b Monotone-Revision: f1a1a7d4fd101844877061fca124817c04fb68bb Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2008-10-17T23:41:27 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 6 ++++++ UI/Common/UIxPageFrame.h | 2 ++ UI/Common/UIxPageFrame.m | 11 +++++++++++ UI/Templates/UIxPageFrame.wox | 3 ++- 4 files changed, 21 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index ac479d260..13071ad0a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-10-17 Francis Lachapelle + + * UI/Common/UIxPageFrame.m ([NSString userLanguage]): returns the + user's language. Used to make this information available through + JavaScript. + 2008-10-16 Wolfgang Sourdeau * SoObjects/SOGo/SOGoObject.m ([SOGoObject -davURL]) diff --git a/UI/Common/UIxPageFrame.h b/UI/Common/UIxPageFrame.h index 8545712c3..080f949bb 100644 --- a/UI/Common/UIxPageFrame.h +++ b/UI/Common/UIxPageFrame.h @@ -67,6 +67,8 @@ - (BOOL) isSuperUser; +- (NSString *) userLanguage; + - (BOOL) isCompatibleBrowser; @end diff --git a/UI/Common/UIxPageFrame.m b/UI/Common/UIxPageFrame.m index bdf1a5f7c..11dd97d16 100644 --- a/UI/Common/UIxPageFrame.m +++ b/UI/Common/UIxPageFrame.m @@ -386,6 +386,17 @@ return [user canAccessModule: @"Mail"]; } +- (NSString *) userLanguage +{ + NSString *language; + + language = [[context activeUser] language]; + if (!language) + language = [SOGoUser language]; + + return language; +} + /* browser/os identification */ - (BOOL) isCompatibleBrowser diff --git a/UI/Templates/UIxPageFrame.wox b/UI/Templates/UIxPageFrame.wox index 7773eaef3..7625fa6b6 100644 --- a/UI/Templates/UIxPageFrame.wox +++ b/UI/Templates/UIxPageFrame.wox @@ -109,7 +109,8 @@ var UserFolderURL = ''; - var UserLogin = ''; + var UserLogin = ''; + var UserLanguage = ''; From d6f7a53694d62beca72bfad10a749651959690df Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Fri, 17 Oct 2008 23:41:52 +0000 Subject: [PATCH 3/3] Fix for bug #3044 Monotone-Parent: f1a1a7d4fd101844877061fca124817c04fb68bb Monotone-Revision: c188de330d668938c84bba685aabd793abbfbe6a Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2008-10-17T23:41:52 Monotone-Branch: ca.inverse.sogo --- UI/WebServerResources/MailerUI.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UI/WebServerResources/MailerUI.js b/UI/WebServerResources/MailerUI.js index 0cb8aee6d..19de02eb3 100644 --- a/UI/WebServerResources/MailerUI.js +++ b/UI/WebServerResources/MailerUI.js @@ -849,7 +849,7 @@ function loadMessage(idx) { var cachedMessage = getCachedMessage(idx); var row = $("row_" + idx); - var seenStateChanged = row.hasClassName('mailer_unreadmail'); + var seenStateChanged = row && row.hasClassName('mailer_unreadmail'); if (cachedMessage == null) { var url = (ApplicationBaseURL + encodeURI(Mailer.currentMailbox) + "/" + idx + "/view?noframe=1");