From 8508800ca5f584f6523d22064fdc402df923d704 Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Mon, 21 Mar 2011 18:04:50 +0000 Subject: [PATCH 1/6] See ChangeLog Monotone-Parent: 6e7ac4cd1529c1ca1209faeb43583ee333facec8 Monotone-Revision: fdd87c8990a184548d84798a93d2b2df80f30651 Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2011-03-21T18:04:50 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 8 +++++ Tools/SOGoToolBackup.m | 69 ++++++++++++++++++++++++++++++------------ 2 files changed, 58 insertions(+), 19 deletions(-) diff --git a/ChangeLog b/ChangeLog index 355c20228..779b32066 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2011-03-21 Francis Lachapelle + + * Tools/SOGoToolBackup.m (-fetchUserIDs:): when choosing to backup + all users, fetch the users list from the folder info table instead + of the configured sources. This fixes an issue when trying to + retrieve the users from LDAP sources that limit the number + of results. + 2011-03-20 Wolfgang Sourdeau * OpenChange/MAPIStoreCalendarMessage.m diff --git a/Tools/SOGoToolBackup.m b/Tools/SOGoToolBackup.m index 2b1d416fc..5b2c6588e 100644 --- a/Tools/SOGoToolBackup.m +++ b/Tools/SOGoToolBackup.m @@ -1,8 +1,9 @@ /* SOGoToolBackup.m - this file is part of SOGo * - * Copyright (C) 2009-2010 Inverse inc. + * Copyright (C) 2009-2011 Inverse inc. * * Author: Wolfgang Sourdeau + * Francis Lachapelle * * This file is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -139,28 +140,58 @@ max = [users count]; user = [users objectAtIndex: 0]; if (max == 1 && [user isEqualToString: @"ALL"]) - allUsers = [lm fetchUsersMatching: @"." inDomain: nil]; - else { - allUsers = [NSMutableArray new]; - for (count = 0; count < max; count++) - { - if (count > 0 && count%100 == 0) - { - DESTROY(pool); - pool = [[NSAutoreleasePool alloc] init]; - } + GCSFolderManager *fm; + GCSChannelManager *cm; + NSURL *folderLocation; + EOAdaptorChannel *fc; + NSArray *attrs; + NSMutableArray *allSqlUsers; + NSString *sql; - user = [users objectAtIndex: count]; - infos = [lm contactInfosForUserWithUIDorEmail: user]; - if (infos) - [allUsers addObject: infos]; - else - NSLog (@"user '%@' unknown", user); - } - [allUsers autorelease]; + fm = [GCSFolderManager defaultFolderManager]; + cm = [fm channelManager]; + folderLocation = [fm folderInfoLocation]; + fc = [cm acquireOpenChannelForURL: folderLocation]; + if (fc) + { + allSqlUsers = [NSMutableArray new]; + sql + = [NSString stringWithFormat: @"SELECT DISTINCT c_path2 FROM %@", + [folderLocation gcsTableName]]; + [fc evaluateExpressionX: sql]; + attrs = [fc describeResults: NO]; + while ((infos = [fc fetchAttributes: attrs withZone: NULL])) + { + user = [infos objectForKey: @"c_path2"]; + if (user) + [allSqlUsers addObject: user]; + } + [cm releaseChannel: fc]; + + users = allSqlUsers; + max = [users count]; + } } + allUsers = [NSMutableArray new]; + for (count = 0; count < max; count++) + { + if (count > 0 && count%100 == 0) + { + DESTROY(pool); + pool = [[NSAutoreleasePool alloc] init]; + } + + user = [users objectAtIndex: count]; + infos = [lm contactInfosForUserWithUIDorEmail: user]; + if (infos) + [allUsers addObject: infos]; + else + NSLog (@"user '%@' unknown", user); + } + [allUsers autorelease]; + ASSIGN (userIDs, [allUsers objectsForKey: @"c_uid" notFoundMarker: nil]); DESTROY(pool); From eb6629d89f1401a84f49b56ca8d2c129dda8a3eb Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Mon, 21 Mar 2011 18:24:06 +0000 Subject: [PATCH 2/6] See ChangeLog Monotone-Parent: fdd87c8990a184548d84798a93d2b2df80f30651 Monotone-Revision: fc98ebd698555332841f6988e47ba738f8e5e2da Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2011-03-21T18:24:06 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 3 +++ SoObjects/SOGo/LDAPSource.m | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 779b32066..431ad4574 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,9 @@ retrieve the users from LDAP sources that limit the number of results. + * SoObjects/SOGo/LDAPSource.m (:_qualifierForFilter): avoid + duplicated filters on the CN attribute. + 2011-03-20 Wolfgang Sourdeau * OpenChange/MAPIStoreCalendarMessage.m diff --git a/SoObjects/SOGo/LDAPSource.m b/SoObjects/SOGo/LDAPSource.m index 12daf3c56..d844f946a 100644 --- a/SoObjects/SOGo/LDAPSource.m +++ b/SoObjects/SOGo/LDAPSource.m @@ -596,7 +596,7 @@ static NSArray *commonSearchFields; - (EOQualifier *) _qualifierForFilter: (NSString *) filter { NSMutableArray *fields; - NSString *searchFormat, *fieldFormat, *escapedFilter; + NSString *fieldFormat, *searchFormat, *escapedFilter; EOQualifier *qualifier; NSMutableString *qs; @@ -611,10 +611,10 @@ static NSArray *commonSearchFields; fieldFormat = [NSString stringWithFormat: @"(%%@='%@*')", escapedFilter]; fields = [NSMutableArray arrayWithArray: searchFields]; [fields addObjectsFromArray: mailFields]; + [fields addObject: CNField]; searchFormat = [[[fields uniqueObjects] stringsWithFormat: fieldFormat] componentsJoinedByString: @" OR "]; - [qs appendFormat: @"(%@='%@*') OR %@", - CNField, escapedFilter, searchFormat]; + [qs appendString: searchFormat]; } if (_filter && [_filter length]) From 9c6eba47ce496ffbe78f853fe783fea32611f981 Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Mon, 21 Mar 2011 18:56:03 +0000 Subject: [PATCH 3/6] Updated NEWS file Monotone-Parent: fc98ebd698555332841f6988e47ba738f8e5e2da Monotone-Revision: 9b1266835546cad935416117e959f5990a2363db Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2011-03-21T18:56:03 Monotone-Branch: ca.inverse.sogo --- NEWS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/NEWS b/NEWS index 9947fcfa3..456898b20 100644 --- a/NEWS +++ b/NEWS @@ -6,10 +6,12 @@ Enhancements - updated Ukranian translation - updated Spanish translation - "check while typing" is no longer enabled by default in HTML editor +- updated CKEditor to version 3.5.2 Bug Fixes - restored the automatic expunge of IMAP folders - sogo-tool now works in multi-domain environments - various other mutli-domain fixes +- sogo-tool now retrieves list of users from the folder info table 1.3-20110125 (1.3.5) -------------------- From 8a2181a9b5aaf90b2a7656d42172f4fd0d5dbdca Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Mon, 21 Mar 2011 20:09:56 +0000 Subject: [PATCH 4/6] See ChangeLog Monotone-Parent: 9b1266835546cad935416117e959f5990a2363db Monotone-Revision: f46a82535044ebae377ca25229db810ded914ae0 Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2011-03-21T20:09:56 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 4 ++++ UI/WebServerResources/UIxPreferences.js | 6 ++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 431ad4574..74a36771a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9,6 +9,10 @@ * SoObjects/SOGo/LDAPSource.m (:_qualifierForFilter): avoid duplicated filters on the CN attribute. + * UI/WebServerResources/UIxPreferences.js + (displayAccountSignature): strips the tags and unescape the HTML + to improve readability. + 2011-03-20 Wolfgang Sourdeau * OpenChange/MAPIStoreCalendarMessage.m diff --git a/UI/WebServerResources/UIxPreferences.js b/UI/WebServerResources/UIxPreferences.js index e929f799e..eb247bfc1 100644 --- a/UI/WebServerResources/UIxPreferences.js +++ b/UI/WebServerResources/UIxPreferences.js @@ -670,7 +670,9 @@ function displayAccountSignature(mailAccount) { var identity = (mailAccount["identities"] ? mailAccount["identities"][0] : {} ); - var value = identity["signature"]; + var value = identity["signature"].replace(/^[ \n\r]*$/, ""); + if (CKEDITOR.instances["signature"]) + value = value.stripTags().unescapeHTML(); if (value && value.length > 0) { if (value.length < 30) { actSignatureValue = value; @@ -685,7 +687,7 @@ function displayAccountSignature(mailAccount) { while (actSignature.firstChild) { actSignature.removeChild(actSignature.firstChild); } - actSignature.appendChild(document.createTextNode(actSignatureValue)); + actSignature.update(actSignatureValue); } function createMailAccount() { From 112072d3f486b8ccece501c59550ae9604ea53f5 Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Mon, 21 Mar 2011 22:00:49 +0000 Subject: [PATCH 5/6] See ChangeLog Monotone-Parent: f46a82535044ebae377ca25229db810ded914ae0 Monotone-Revision: 42caf855ed6371b609cb372b49a7c45444fc18e6 Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2011-03-21T22:00:49 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 4 ++++ UI/WebServerResources/MailerUI.js | 20 ++++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/ChangeLog b/ChangeLog index 74a36771a..0b9d43eda 100644 --- a/ChangeLog +++ b/ChangeLog @@ -13,6 +13,10 @@ (displayAccountSignature): strips the tags and unescape the HTML to improve readability. + * UI/WebServerResources/MailerUI.js (updateWindowTitle): new + function used to update the window title with respect to the + currently selected mailbox. + 2011-03-20 Wolfgang Sourdeau * OpenChange/MAPIStoreCalendarMessage.m diff --git a/UI/WebServerResources/MailerUI.js b/UI/WebServerResources/MailerUI.js index 713a3c69d..16a27c58f 100644 --- a/UI/WebServerResources/MailerUI.js +++ b/UI/WebServerResources/MailerUI.js @@ -5,6 +5,7 @@ var accounts = []; var mailboxTree; var Mailer = { + defaultWindowTitle: null, currentMailbox: null, currentMailboxType: "", currentMessages: {}, @@ -564,6 +565,7 @@ function onMailboxTreeItemClick(event) { $("messageContent").innerHTML = ''; $("messageCountHeader").childNodes[0].innerHTML = ' '; Mailer.dataTable._emptyTable(); + updateWindowTitle(); } else { var datatype = this.parentNode.getAttribute("datatype"); @@ -572,6 +574,7 @@ function onMailboxTreeItemClick(event) { else toggleAddressColumn("to", "from"); + updateWindowTitle(this.childNodesWithTag("span")[0]); openMailbox(mailbox); } @@ -900,6 +903,8 @@ function updateUnseenCount(node, count, isDelta) { counterSpan.addClassName("hidden"); unseenSpan.removeClassName("unseen"); } + if (node.getAttribute("dataname") == Mailer.currentMailbox) + updateWindowTitle(unseenSpan); } } @@ -917,6 +922,21 @@ function updateMessageListCounter(count, isDelta) { cell.update(_("No message")); } +function updateWindowTitle(span) { + if (!Mailer.defaultWindowTitle) + Mailer.defaultWindowTitle = document.title || "SOGo"; + else if (!span) + document.title = Mailer.defaultWindowTitle; + if (span) { + var title = Mailer.defaultWindowTitle + " - "; + if (span.hasClassName("unseen")) + title += span.innerHTML.stripTags(); + else + title += span.childNodes[0].nodeValue; + document.title = title; + } +} + /* Function is called when the event datatable:rendered is fired from SOGoDataTable. */ function onMessageListRender(event) { // Restore previous selection From 4c107904de335d23b8f7ab962c4e052945537bed Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Tue, 22 Mar 2011 00:30:26 +0000 Subject: [PATCH 6/6] See ChangeLog Monotone-Parent: 42caf855ed6371b609cb372b49a7c45444fc18e6 Monotone-Revision: d4aaec9a2984bf8eb954d457c1dde92899b63a7a Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2011-03-22T00:30:26 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 6 ++++ UI/MailerUI/UIxMailListActions.m | 56 ++++++++++++++++++------------- UI/WebServerResources/MailerUI.js | 4 +-- 3 files changed, 40 insertions(+), 26 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0b9d43eda..091316fea 100644 --- a/ChangeLog +++ b/ChangeLog @@ -17,6 +17,12 @@ function used to update the window title with respect to the currently selected mailbox. + * UI/WebServerResources/MailerUI.js (openMailbox): exchanged sort + arrows to match Thunderbird's GUI. + + * UI/MailerUI/UIxMailListActions.m (-imap4SortOrdering): when the + sort is not specified in the request, retrieve the user's previous sort. + 2011-03-20 Wolfgang Sourdeau * OpenChange/MAPIStoreCalendarMessage.m diff --git a/UI/MailerUI/UIxMailListActions.m b/UI/MailerUI/UIxMailListActions.m index 459f0bf74..ee59114e7 100644 --- a/UI/MailerUI/UIxMailListActions.m +++ b/UI/MailerUI/UIxMailListActions.m @@ -335,9 +335,6 @@ sort = [[context request] formValueForKey: @"sort"]; - if (![sort length]) - sort = [self defaultSortKey]; - return [sort uppercaseString]; } @@ -357,31 +354,42 @@ activeUser = [context activeUser]; clientObject = [self clientObject]; - module = [[[clientObject container] container] nameInContainer]; + module = @"Mail"; us = [activeUser userSettings]; moduleSettings = [us objectForKey: module]; - if ([sort isEqualToString: [self defaultSortKey]] && !asc) - { - if (moduleSettings) - { - [moduleSettings removeObjectForKey: @"SortingState"]; - [us synchronize]; - } - } - else + if ([sort length]) { - // Save the sorting state in the user settings - if (!moduleSettings) - { - moduleSettings = [NSMutableDictionary dictionary]; - [us setObject: moduleSettings forKey: module]; - } - [moduleSettings setObject: [NSArray arrayWithObjects: [sort lowercaseString], [NSString stringWithFormat: @"%d", (asc?1:0)], nil] - forKey: @"SortingState"]; - [us synchronize]; - } - + if ([sort isEqualToString: [self defaultSortKey]] && !asc) + { + if (moduleSettings) + { + [moduleSettings removeObjectForKey: @"SortingState"]; + [us synchronize]; + } + } + else + { + // Save the sorting state in the user settings + if (!moduleSettings) + { + moduleSettings = [NSMutableDictionary dictionary]; + [us setObject: moduleSettings forKey: module]; + } + [moduleSettings setObject: [NSArray arrayWithObjects: [sort lowercaseString], [NSString stringWithFormat: @"%d", (asc?1:0)], nil] + forKey: @"SortingState"]; + [us synchronize]; + } + } + else if (moduleSettings) + { + NSArray *sortState = [moduleSettings objectForKey: @"SortingState"]; + sort = [[sortState objectAtIndex: 0] uppercaseString]; + asc = [[sortState objectAtIndex: 1] boolValue]; + } + else + sort = [self defaultSortKey]; + // Construct and return the final IMAP ordering constraint if (!asc) sort = [@"REVERSE " stringByAppendingString: sort]; diff --git a/UI/WebServerResources/MailerUI.js b/UI/WebServerResources/MailerUI.js index 16a27c58f..a1867c3cd 100644 --- a/UI/WebServerResources/MailerUI.js +++ b/UI/WebServerResources/MailerUI.js @@ -735,9 +735,9 @@ function openMailbox(mailbox, reload) { var sortImage = createElement("img", "messageSortImage", "sortImage"); sortHeader.insertBefore(sortImage, sortHeader.firstChild); if (sorting["ascending"]) - sortImage.src = ResourcesURL + "/arrow-down.png"; - else sortImage.src = ResourcesURL + "/arrow-up.png"; + else + sortImage.src = ResourcesURL + "/arrow-down.png"; } }