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): * OpenChange/NSCalendarDate+MAPIStore.m (-asMinutesSince1601):
corollary to +dateFromMinutesSince1601. 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> 2011-03-20 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* OpenChange/MAPIStoreCalendarMessage.m * OpenChange/MAPIStoreCalendarMessage.m

2
NEWS
View File

@ -6,10 +6,12 @@ Enhancements
- updated Ukranian translation - updated Ukranian translation
- updated Spanish translation - updated Spanish translation
- "check while typing" is no longer enabled by default in HTML editor - "check while typing" is no longer enabled by default in HTML editor
- updated CKEditor to version 3.5.2
Bug Fixes Bug Fixes
- restored the automatic expunge of IMAP folders - restored the automatic expunge of IMAP folders
- sogo-tool now works in multi-domain environments - sogo-tool now works in multi-domain environments
- various other mutli-domain fixes - various other mutli-domain fixes
- sogo-tool now retrieves list of users from the folder info table
1.3-20110125 (1.3.5) 1.3-20110125 (1.3.5)
-------------------- --------------------

View File

@ -596,7 +596,7 @@ static NSArray *commonSearchFields;
- (EOQualifier *) _qualifierForFilter: (NSString *) filter - (EOQualifier *) _qualifierForFilter: (NSString *) filter
{ {
NSMutableArray *fields; NSMutableArray *fields;
NSString *searchFormat, *fieldFormat, *escapedFilter; NSString *fieldFormat, *searchFormat, *escapedFilter;
EOQualifier *qualifier; EOQualifier *qualifier;
NSMutableString *qs; NSMutableString *qs;
@ -611,10 +611,10 @@ static NSArray *commonSearchFields;
fieldFormat = [NSString stringWithFormat: @"(%%@='%@*')", escapedFilter]; fieldFormat = [NSString stringWithFormat: @"(%%@='%@*')", escapedFilter];
fields = [NSMutableArray arrayWithArray: searchFields]; fields = [NSMutableArray arrayWithArray: searchFields];
[fields addObjectsFromArray: mailFields]; [fields addObjectsFromArray: mailFields];
[fields addObject: CNField];
searchFormat = [[[fields uniqueObjects] stringsWithFormat: fieldFormat] searchFormat = [[[fields uniqueObjects] stringsWithFormat: fieldFormat]
componentsJoinedByString: @" OR "]; componentsJoinedByString: @" OR "];
[qs appendFormat: @"(%@='%@*') OR %@", [qs appendString: searchFormat];
CNField, escapedFilter, searchFormat];
} }
if (_filter && [_filter length]) if (_filter && [_filter length])

View File

@ -1,8 +1,9 @@
/* SOGoToolBackup.m - this file is part of SOGo /* 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> * Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
* Francis Lachapelle <flachapelle@inverse.ca>
* *
* This file is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -139,28 +140,58 @@
max = [users count]; max = [users count];
user = [users objectAtIndex: 0]; user = [users objectAtIndex: 0];
if (max == 1 && [user isEqualToString: @"ALL"]) if (max == 1 && [user isEqualToString: @"ALL"])
allUsers = [lm fetchUsersMatching: @"." inDomain: nil];
else
{ {
allUsers = [NSMutableArray new]; GCSFolderManager *fm;
for (count = 0; count < max; count++) GCSChannelManager *cm;
{ NSURL *folderLocation;
if (count > 0 && count%100 == 0) EOAdaptorChannel *fc;
{ NSArray *attrs;
DESTROY(pool); NSMutableArray *allSqlUsers;
pool = [[NSAutoreleasePool alloc] init]; NSString *sql;
}
user = [users objectAtIndex: count]; fm = [GCSFolderManager defaultFolderManager];
infos = [lm contactInfosForUserWithUIDorEmail: user]; cm = [fm channelManager];
if (infos) folderLocation = [fm folderInfoLocation];
[allUsers addObject: infos]; fc = [cm acquireOpenChannelForURL: folderLocation];
else if (fc)
NSLog (@"user '%@' unknown", user); {
} allSqlUsers = [NSMutableArray new];
[allUsers autorelease]; 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]); ASSIGN (userIDs, [allUsers objectsForKey: @"c_uid" notFoundMarker: nil]);
DESTROY(pool); DESTROY(pool);

View File

@ -335,9 +335,6 @@
sort = [[context request] formValueForKey: @"sort"]; sort = [[context request] formValueForKey: @"sort"];
if (![sort length])
sort = [self defaultSortKey];
return [sort uppercaseString]; return [sort uppercaseString];
} }
@ -357,31 +354,42 @@
activeUser = [context activeUser]; activeUser = [context activeUser];
clientObject = [self clientObject]; clientObject = [self clientObject];
module = [[[clientObject container] container] nameInContainer]; module = @"Mail";
us = [activeUser userSettings]; us = [activeUser userSettings];
moduleSettings = [us objectForKey: module]; moduleSettings = [us objectForKey: module];
if ([sort isEqualToString: [self defaultSortKey]] && !asc) if ([sort length])
{
if (moduleSettings)
{
[moduleSettings removeObjectForKey: @"SortingState"];
[us synchronize];
}
}
else
{ {
// Save the sorting state in the user settings if ([sort isEqualToString: [self defaultSortKey]] && !asc)
if (!moduleSettings) {
{ if (moduleSettings)
moduleSettings = [NSMutableDictionary dictionary]; {
[us setObject: moduleSettings forKey: module]; [moduleSettings removeObjectForKey: @"SortingState"];
} [us synchronize];
[moduleSettings setObject: [NSArray arrayWithObjects: [sort lowercaseString], [NSString stringWithFormat: @"%d", (asc?1:0)], nil] }
forKey: @"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 // Construct and return the final IMAP ordering constraint
if (!asc) if (!asc)
sort = [@"REVERSE " stringByAppendingString: sort]; sort = [@"REVERSE " stringByAppendingString: sort];

View File

@ -5,6 +5,7 @@ var accounts = [];
var mailboxTree; var mailboxTree;
var Mailer = { var Mailer = {
defaultWindowTitle: null,
currentMailbox: null, currentMailbox: null,
currentMailboxType: "", currentMailboxType: "",
currentMessages: {}, currentMessages: {},
@ -564,6 +565,7 @@ function onMailboxTreeItemClick(event) {
$("messageContent").innerHTML = ''; $("messageContent").innerHTML = '';
$("messageCountHeader").childNodes[0].innerHTML = '&nbsp;'; $("messageCountHeader").childNodes[0].innerHTML = '&nbsp;';
Mailer.dataTable._emptyTable(); Mailer.dataTable._emptyTable();
updateWindowTitle();
} }
else { else {
var datatype = this.parentNode.getAttribute("datatype"); var datatype = this.parentNode.getAttribute("datatype");
@ -572,6 +574,7 @@ function onMailboxTreeItemClick(event) {
else else
toggleAddressColumn("to", "from"); toggleAddressColumn("to", "from");
updateWindowTitle(this.childNodesWithTag("span")[0]);
openMailbox(mailbox); openMailbox(mailbox);
} }
@ -732,9 +735,9 @@ function openMailbox(mailbox, reload) {
var sortImage = createElement("img", "messageSortImage", "sortImage"); var sortImage = createElement("img", "messageSortImage", "sortImage");
sortHeader.insertBefore(sortImage, sortHeader.firstChild); sortHeader.insertBefore(sortImage, sortHeader.firstChild);
if (sorting["ascending"]) if (sorting["ascending"])
sortImage.src = ResourcesURL + "/arrow-down.png";
else
sortImage.src = ResourcesURL + "/arrow-up.png"; 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"); counterSpan.addClassName("hidden");
unseenSpan.removeClassName("unseen"); unseenSpan.removeClassName("unseen");
} }
if (node.getAttribute("dataname") == Mailer.currentMailbox)
updateWindowTitle(unseenSpan);
} }
} }
@ -917,6 +922,21 @@ function updateMessageListCounter(count, isDelta) {
cell.update(_("No message")); 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 is called when the event datatable:rendered is fired from SOGoDataTable. */
function onMessageListRender(event) { function onMessageListRender(event) {
// Restore previous selection // Restore previous selection

View File

@ -670,7 +670,9 @@ function displayAccountSignature(mailAccount) {
var identity = (mailAccount["identities"] var identity = (mailAccount["identities"]
? mailAccount["identities"][0] ? 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 && value.length > 0) {
if (value.length < 30) { if (value.length < 30) {
actSignatureValue = value; actSignatureValue = value;
@ -685,7 +687,7 @@ function displayAccountSignature(mailAccount) {
while (actSignature.firstChild) { while (actSignature.firstChild) {
actSignature.removeChild(actSignature.firstChild); actSignature.removeChild(actSignature.firstChild);
} }
actSignature.appendChild(document.createTextNode(actSignatureValue)); actSignature.update(actSignatureValue);
} }
function createMailAccount() { function createMailAccount() {