merge of 'b4cd488f57719689e0d2bed481d82df8e68fcf46'

and 'd4aaec9a2984bf8eb954d457c1dde92899b63a7a'

Monotone-Parent: b4cd488f57719689e0d2bed481d82df8e68fcf46
Monotone-Parent: d4aaec9a2984bf8eb954d457c1dde92899b63a7a
Monotone-Revision: 2c72ee27838cb086c9f9538bdfd088d48c551532

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2011-03-22T21:33:48
Monotone-Branch: ca.inverse.sogo
maint-2.0.2
Wolfgang Sourdeau 2011-03-22 21:33:48 +00:00
commit f0b9038b75
7 changed files with 138 additions and 50 deletions

View File

@ -14,6 +14,31 @@
* OpenChange/NSCalendarDate+MAPIStore.m (-asMinutesSince1601):
corollary to +dateFromMinutesSince1601.
2011-03-21 Francis Lachapelle <flachapelle@inverse.ca>
* 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.
* 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.
* UI/WebServerResources/MailerUI.js (updateWindowTitle): new
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 <wsourdeau@inverse.ca>
* OpenChange/MAPIStoreCalendarMessage.m

2
NEWS
View File

@ -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)
--------------------

View File

@ -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])

View File

@ -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 <wsourdeau@inverse.ca>
* Francis Lachapelle <flachapelle@inverse.ca>
*
* 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);

View File

@ -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];

View File

@ -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 = '&nbsp;';
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);
}
@ -732,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";
}
}
@ -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

View File

@ -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() {