diff --git a/ChangeLog b/ChangeLog index 154cb2dbd..393bf3486 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,225 @@ +commit c8a4ea5548e06de1341312a1cabb00fb0ef232e8 +Author: Francis Lachapelle +Date: Tue Nov 19 13:57:18 2013 -0500 + + Update translations + +M UI/MailPartViewers/Czech.lproj/Localizable.strings +M UI/MailPartViewers/Finnish.lproj/Localizable.strings +M UI/MailPartViewers/Polish.lproj/Localizable.strings +M UI/MailPartViewers/Russian.lproj/Localizable.strings +M UI/MailPartViewers/SpanishSpain.lproj/Localizable.strings + +commit 148fd4936cc648a7264ef363afccd024a9e5d177 +Author: Jean Raby +Date: Tue Nov 19 13:43:45 2013 -0500 + + Update Version to 2.1.1 and update news + +M NEWS +M Version + +commit a7fef39448d0735aaf8fa9da1ad43fc96ae82efb +Author: Jean Raby +Date: Tue Nov 19 13:43:22 2013 -0500 + + Update to 2.1.1 + +M Documentation/SOGo Installation Guide.odt +M Documentation/SOGo Mobile Devices Configuration.odt +M Documentation/SOGo Mozilla Thunderbird Configuration.odt +M Documentation/SOGo Native Microsoft Outlook Configuration.odt + +commit 5a3d0d27e0ecea09daa1bca791e6baaeecdf397a +Author: Francis Lachapelle +Date: Tue Nov 19 13:39:48 2013 -0500 + + Fix bug following mail tags management CSS changes + +M UI/WebServerResources/SOGoTabsController.js +M UI/WebServerResources/UIxPreferences.css +M UI/WebServerResources/generic.css + +commit eb9111b5fa1dcd17e8bdccec6bef595b31c6a2ec +Author: Ludovic Marcotte +Date: Tue Nov 19 11:40:33 2013 -0500 + + Updated news for the recent bug fix + +M NEWS + +commit eb7d1f08bcfe0c9de6f14042a57b8032662906c3 +Author: Ludovic Marcotte +Date: Tue Nov 19 11:39:45 2013 -0500 + + Fix for bug #2482 + +M SoObjects/Mailer/SOGoDraftObject.m +M UI/MailerUI/UIxMailEditor.m + +commit 854fed529c14bd70ac827520ed05a425fe99359f +Author: Ludovic Marcotte +Date: Tue Nov 19 09:52:53 2013 -0500 + + Added SOGoMailAuxiliaryUserAccountsEnabled + +M Scripts/sogo.conf + +commit 3c29e0724d89cbe102fbb11a9bb8c7d565d46b3e +Author: Jean Raby +Date: Fri Nov 15 16:12:15 2013 -0500 + + update news file + +M NEWS + +commit aae26602b0200d865ba2a9a3ea8d986d6e3b8960 +Author: Jean Raby +Date: Fri Nov 15 16:04:09 2013 -0500 + + Use raw (utf7) name when checking folder type + +M UI/MailerUI/UIxMailAccountActions.m + +commit 05233d9c53b40b7c6dc685358d9438b5c0f8bcdb +Author: Jean Raby +Date: Fri Nov 15 16:02:59 2013 -0500 + + Use modified utf7 for special folder names + +M SoObjects/SOGo/SOGoUserDefaults.m + +commit e862194b323ef09bf318243cfca96e802c89dd26 +Author: Francis Lachapelle +Date: Fri Nov 15 15:50:46 2013 -0500 + + Convert color picker to an inline widget + + The colors are now limited to the colors offered in Thunderbird. + +M NEWS +M UI/Scheduler/GNUmakefile +D UI/Scheduler/UIxColorPicker.h +D UI/Scheduler/UIxColorPicker.m +M UI/Scheduler/product.plist +M UI/Templates/PreferencesUI/UIxPreferences.wox +M UI/Templates/SchedulerUI/UIxCalendarProperties.wox +M UI/WebServerResources/SchedulerUI.js +M UI/WebServerResources/UIxCalendarProperties.css +M UI/WebServerResources/UIxCalendarProperties.js +M UI/WebServerResources/UIxPreferences.css +M UI/WebServerResources/UIxPreferences.js +M UI/WebServerResources/generic.css +D UI/WebServerResources/js_color_picker_v2.css + +commit 884fbfdb7359db6a24057a4f958db6a563e04944 +Author: Jean Raby +Date: Fri Nov 15 13:17:37 2013 -0500 + + Bump copyright and fix whitespace (tab kill) + +M UI/MailerUI/UIxMailAccountActions.m + +commit c05cf00db7b1f5878cac9130cadbebbf0649b8dc +Author: Ludovic Marcotte +Date: Thu Nov 14 09:00:19 2013 -0500 + + Update standard tag colors to match TB and improve tags id generation. + +M SoObjects/SOGo/SOGoDefaults.plist +M UI/WebServerResources/UIxPreferences.js + +commit 198db855f6aad1dd9bd0f9d482ef7f0a6783a677 +Author: Ludovic Marcotte +Date: Wed Nov 13 15:55:25 2013 -0500 + + Specify color in which TB can grok it. + +M SoObjects/SOGo/SOGoDefaults.plist + +commit 1c439c866efc5e639e7b3bc1259fb442942d0e19 +Author: Ludovic Marcotte +Date: Wed Nov 13 15:44:57 2013 -0500 + + Added DAV support for mails labels. + +M SoObjects/Contacts/SOGoContactFolders.m +M SoObjects/Mailer/SOGoMailAccount.h +M SoObjects/Mailer/SOGoMailAccount.m +M SoObjects/Mailer/SOGoMailAccounts.h +M SoObjects/Mailer/SOGoMailAccounts.m +M SoObjects/Mailer/SOGoMailNamespace.m +M SoObjects/Mailer/product.plist +M SoObjects/SOGo/NSDictionary+DAV.m +M SoObjects/SOGo/NSObject+DAV.h +M SoObjects/SOGo/NSObject+DAV.m +M SoObjects/SOGo/NSString+DAV.h +M SoObjects/SOGo/NSString+Utilities.m +M SoObjects/SOGo/SOGoDefaults.plist +M SoObjects/SOGo/SOGoObject.m +M SoObjects/SOGo/SOGoWebDAVValue.m +M UI/Templates/MailerUI/UIxMailMainFrame.wox + +commit 616ee7c6e4d42ad8258c66eed11446a48981fba1 +Author: Francis Lachapelle +Date: Wed Nov 13 14:46:08 2013 -0500 + + GUI changes for mail labels management + +M NEWS +M UI/Templates/MailerUI/UIxMailMainFrame.wox +M UI/Templates/PreferencesUI/UIxPreferences.wox +M UI/Templates/SchedulerUI/UIxCalendarSelector.wox +M UI/WebServerResources/MailerUI.css +M UI/WebServerResources/SOGoTabsController.js +M UI/WebServerResources/SchedulerUI.css +M UI/WebServerResources/SchedulerUI.js +M UI/WebServerResources/UIxPreferences.css +M UI/WebServerResources/UIxPreferences.js +M UI/WebServerResources/generic.css +M UI/WebServerResources/iefixes.css + +commit 37d3234b6067df7047ef5035e8f28f7906de893b +Author: Ludovic Marcotte +Date: Mon Nov 11 10:49:58 2013 -0500 + + Added support for dynamic mail labels/tags management. + + The CSS in the UIxPreferences remains to be done. + +M SoObjects/Mailer/GNUmakefile +A SoObjects/Mailer/SOGoMailLabel.h +A SoObjects/Mailer/SOGoMailLabel.m +M SoObjects/SOGo/SOGoDefaults.plist +M SoObjects/SOGo/SOGoUserDefaults.h +M SoObjects/SOGo/SOGoUserDefaults.m +M UI/MailerUI/UIxMailActions.h +M UI/MailerUI/UIxMailActions.m +M UI/MailerUI/UIxMailListActions.m +M UI/MailerUI/UIxMailMainFrame.h +M UI/MailerUI/UIxMailMainFrame.m +M UI/MailerUI/product.plist +M UI/PreferencesUI/English.lproj/Localizable.strings +M UI/PreferencesUI/UIxFilterEditor.m +M UI/PreferencesUI/UIxPreferences.h +M UI/PreferencesUI/UIxPreferences.m +M UI/Templates/MailerUI/UIxMailMainFrame.wox +M UI/Templates/PreferencesUI/UIxFilterEditor.wox +M UI/Templates/PreferencesUI/UIxPreferences.wox +M UI/WebServerResources/MailerUI.css +M UI/WebServerResources/MailerUI.js +M UI/WebServerResources/UIxColorPicker.js +M UI/WebServerResources/UIxFilterEditor.js +M UI/WebServerResources/UIxPreferences.js + +commit 6a9bcfda684135e518dc4f63b15926c1d4d06fa0 +Author: Francis Lachapelle +Date: Thu Nov 7 14:42:48 2013 -0500 + + Update ChangeLog + +M ChangeLog + commit d0b09ebe35d9bde78f627b6569660627c60c8e42 Author: Francis Lachapelle Date: Thu Nov 7 14:14:39 2013 -0500 diff --git a/Documentation/SOGo Installation Guide.odt b/Documentation/SOGo Installation Guide.odt index 53970d031..1e8bf6000 100644 Binary files a/Documentation/SOGo Installation Guide.odt and b/Documentation/SOGo Installation Guide.odt differ diff --git a/Documentation/SOGo Mobile Devices Configuration.odt b/Documentation/SOGo Mobile Devices Configuration.odt index 69246f4d8..f50348e19 100644 Binary files a/Documentation/SOGo Mobile Devices Configuration.odt and b/Documentation/SOGo Mobile Devices Configuration.odt differ diff --git a/Documentation/SOGo Mozilla Thunderbird Configuration.odt b/Documentation/SOGo Mozilla Thunderbird Configuration.odt index 77c7b7d55..b47b7f312 100644 Binary files a/Documentation/SOGo Mozilla Thunderbird Configuration.odt and b/Documentation/SOGo Mozilla Thunderbird Configuration.odt differ diff --git a/Documentation/SOGo Native Microsoft Outlook Configuration.odt b/Documentation/SOGo Native Microsoft Outlook Configuration.odt index ef069b4a8..3c206b8f8 100644 Binary files a/Documentation/SOGo Native Microsoft Outlook Configuration.odt and b/Documentation/SOGo Native Microsoft Outlook Configuration.odt differ diff --git a/NEWS b/NEWS index 0d9ca6137..c5184cf7c 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,18 @@ +2.1.1 (2013-11-19) +------------------ + +New features + - creation and modification of mail labels + +Enhancements + - the color picker is no longer a popup window + +Bug fixes + - fixed utf8 character handling in special folder names + Special folder names can now be set as UTF8 or modified UTF7 in sogo.conf + - fixed reply-to header not being set for auxiliary IMAP accounts + - fixed handling of broken/invalid email addresses + 2.1.0 (2013-11-07) ------------------ @@ -32,7 +47,7 @@ Bug fixes - fixed S/MIME verification issues with certain OpenSSL versions - worked around an issue with chunked encoding of CAS replies (#2408) - fixed OpenChange corruption issue regarding predecessors change list (#2405) - - avoid unnecessary UTF-7 conversions (#2318) + - avoid unnecessary UTF-7 conversions (#2318) - improved RTF parser to fix vCards (#2354) - fixed definition of the COMPLETED attribute of vTODO (#2240) - fixed DAV:resource-id property when sharing calendars (#2399) diff --git a/Scripts/sogo.conf b/Scripts/sogo.conf index 5af5d4229..f502c6135 100644 --- a/Scripts/sogo.conf +++ b/Scripts/sogo.conf @@ -84,6 +84,7 @@ //SOGoVacationEnabled = YES; //SOGoForwardEnabled = YES; //SOGoSieveScriptsEnabled = YES; + //SOGoMailAuxiliaryUserAccountsEnabled = YES; /* General */ //SOGoLanguage = English; diff --git a/SoObjects/Contacts/SOGoContactFolders.m b/SoObjects/Contacts/SOGoContactFolders.m index c10f88c66..5bf9ba7bd 100644 --- a/SoObjects/Contacts/SOGoContactFolders.m +++ b/SoObjects/Contacts/SOGoContactFolders.m @@ -1,8 +1,6 @@ /* SOGoContactFolders.m - this file is part of SOGo * - * Copyright (C) 2006-2011 Inverse inc. - * - * Author: Wolfgang Sourdeau + * Copyright (C) 2006-2013 Inverse inc. * * 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 @@ -20,13 +18,6 @@ * Boston, MA 02111-1307, USA. */ -/* MailItems IPF.Note - ContactItems IPF.Contact - AppointmentItems IPF.Appointment - NoteItems IPF.StickyNote - TaskItems IPF.Task - JournalItems IPF.Journal */ - #import #import #import @@ -50,6 +41,7 @@ #import "SOGoContactFolders.h" #define XMLNS_INVERSEDAV @"urn:inverse:params:xml:ns:inverse-dav" + @implementation SOGoContactFolders + (NSString *) gcsFolderType diff --git a/SoObjects/Mailer/GNUmakefile b/SoObjects/Mailer/GNUmakefile index eb7df2a86..d96f672af 100644 --- a/SoObjects/Mailer/GNUmakefile +++ b/SoObjects/Mailer/GNUmakefile @@ -16,6 +16,7 @@ Mailer_OBJC_FILES += \ SOGoMailAccounts.m \ SOGoMailAccount.m \ SOGoMailFolder.m \ + SOGoMailLabel.m \ SOGoMailNamespace.m \ SOGoMailObject.m \ SOGoMailObject+Draft.m \ diff --git a/SoObjects/Mailer/SOGoDraftObject.m b/SoObjects/Mailer/SOGoDraftObject.m index 4f2cdab95..9ce6b4136 100644 --- a/SoObjects/Mailer/SOGoDraftObject.m +++ b/SoObjects/Mailer/SOGoDraftObject.m @@ -619,11 +619,40 @@ static NSString *userAgent = nil; TODO: what about sender (RFC 822 3.6.2) */ NSMutableArray *to, *addrs, *allRecipients; - NSArray *envelopeAddresses, *userEmails; + NSArray *envelopeAddresses; allRecipients = [NSMutableArray array]; - userEmails = [[context activeUser] allEmails]; - [allRecipients addObjectsFromArray: userEmails]; + + // + // When we do a Reply-To or a Reply-To-All, we strip our own addresses + // from the list of recipients so we don't reply to ourself! We check + // which addresses we should use - that is the ones for the current + // user if we're dealing with the default "SOGo mail account" or + // the ones specified in the auxiliary IMAP accounts + // + if ([[[self->container mailAccountFolder] nameInContainer] intValue] == 0) + { + NSArray *userEmails; + + userEmails = [[context activeUser] allEmails]; + [allRecipients addObjectsFromArray: userEmails]; + } + else + { + NSArray *identities; + NSString *email; + int i; + + identities = [[[self container] mailAccountFolder] identities]; + + for (i = 0; i < [identities count]; i++) + { + email = [[identities objectAtIndex: i] objectForKey: @"email"]; + + if (email) + [allRecipients addObject: email]; + } + } to = [NSMutableArray arrayWithCapacity: 2]; @@ -634,20 +663,19 @@ static NSString *userAgent = nil; else [addrs setArray: [_envelope from]]; - [self _purgeRecipients: allRecipients - fromAddresses: addrs]; - [self _addEMailsOfAddresses: addrs toArray: to]; - [self _addRecipients: addrs toArray: allRecipients]; - [_info setObject: to forKey: @"to"]; + [self _purgeRecipients: allRecipients fromAddresses: addrs]; + [self _addEMailsOfAddresses: addrs toArray: to]; + [self _addRecipients: addrs toArray: allRecipients]; + [_info setObject: to forKey: @"to"]; /* If "to" is empty, we add at least ourself as a recipient! This is for emails in the "Sent" folder that we reply to... */ if (![to count]) { if ([[_envelope replyTo] count]) - [self _addEMailsOfAddresses: [_envelope replyTo] toArray: to]; + [self _addEMailsOfAddresses: [_envelope replyTo] toArray: to]; else - [self _addEMailsOfAddresses: [_envelope from] toArray: to]; + [self _addEMailsOfAddresses: [_envelope from] toArray: to]; } /* If we have no To but we have Cc recipients, let's move the Cc @@ -661,7 +689,7 @@ static NSString *userAgent = nil; [_info removeObjectForKey: @"cc"]; } - /* CC processing if we reply-to-all: add all 'to' and 'cc' */ + /* CC processing if we reply-to-all: - we add all 'to' and 'cc' fields */ if (_replyToAll) { to = [NSMutableArray new]; diff --git a/SoObjects/Mailer/SOGoMailAccount.h b/SoObjects/Mailer/SOGoMailAccount.h index bec7a5e9e..011a7620e 100644 --- a/SoObjects/Mailer/SOGoMailAccount.h +++ b/SoObjects/Mailer/SOGoMailAccount.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2009-2011 Inverse inc. + Copyright (C) 2009-2013 Inverse inc. Copyright (C) 2004-2005 SKYRIX Software AG This file is part of SOGo. diff --git a/SoObjects/Mailer/SOGoMailAccount.m b/SoObjects/Mailer/SOGoMailAccount.m index 37b9e08c5..c396b04d1 100644 --- a/SoObjects/Mailer/SOGoMailAccount.m +++ b/SoObjects/Mailer/SOGoMailAccount.m @@ -1,6 +1,6 @@ /* Copyright (C) 2004-2005 SKYRIX Software AG - Copyright (C) 2007-2011 Inverse inc. + Copyright (C) 2007-2013 Inverse inc. This file is part of SOGo. @@ -26,6 +26,9 @@ #import #import +#import +#import + #import #import #import @@ -56,6 +59,8 @@ #import "SOGoMailAccount.h" +#define XMLNS_INVERSEDAV @"urn:inverse:params:xml:ns:inverse-dav" + @implementation SOGoMailAccount static NSString *inboxFolderName = @"INBOX"; diff --git a/SoObjects/Mailer/SOGoMailAccounts.h b/SoObjects/Mailer/SOGoMailAccounts.h index 2fe066a31..a9b1bdb9d 100644 --- a/SoObjects/Mailer/SOGoMailAccounts.h +++ b/SoObjects/Mailer/SOGoMailAccounts.h @@ -1,20 +1,21 @@ /* + Copyright (C) 2009-2013 Inverse inc. Copyright (C) 2004-2005 SKYRIX Software AG - This file is part of OpenGroupware.org. + This file is part of SOGo. - OGo is free software; you can redistribute it and/or modify it under + SOGo is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. - OGo is distributed in the hope that it will be useful, but WITHOUT ANY + SOGo is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with OGo; see the file COPYING. If not, write to the + License along with SOGo; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ diff --git a/SoObjects/Mailer/SOGoMailAccounts.m b/SoObjects/Mailer/SOGoMailAccounts.m index fda419240..3d792d885 100644 --- a/SoObjects/Mailer/SOGoMailAccounts.m +++ b/SoObjects/Mailer/SOGoMailAccounts.m @@ -1,14 +1,15 @@ /* Copyright (C) 2004-2005 SKYRIX Software AG + Copyright (C) 2007-2013 Inverse inc. - This file is part of OpenGroupware.org. + This file is part of SOGo. - OGo is free software; you can redistribute it and/or modify it under + SOGo is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. - OGo is distributed in the hope that it will be useful, but WITHOUT ANY + SOGo is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. @@ -26,14 +27,20 @@ #import #import #import +#import +#import #import "../SOGo/NSArray+Utilities.h" +#import "../SOGo/NSObject+DAV.h" #import "../SOGo/NSString+Utilities.h" #import "../SOGo/SOGoUser.h" +#import "../SOGo/SOGoUserDefaults.h" #import "SOGoMailAccount.h" #import "SOGoMailAccounts.h" +#define XMLNS_INVERSEDAV @"urn:inverse:params:xml:ns:inverse-dav" + @implementation SOGoMailAccounts - (NSArray *) mailAccounts @@ -92,4 +99,156 @@ return obj; } +/* + Mail labels/tags synchronization. + + Request: + + + + Result: + + + + + /SOGo/dav/sogo10/Mail/ + + HTTP/1.1 200 OK + + + Important + Work + Personal + To Do + Later + + + + + + +*/ +- (SOGoWebDAVValue *) davMailsLabels +{ + NSDictionary *labelsFromDefaults, *labelValues, *attributes; + NSMutableArray *davMailsLabels; + NSUInteger count, max; + SOGoUser *ownerUser; + NSArray *allKeys, *values; + NSString *key; + + ownerUser = [SOGoUser userWithLogin: owner]; + labelsFromDefaults = [[ownerUser userDefaults] mailLabelsColors]; + allKeys = [labelsFromDefaults allKeys]; + max = [allKeys count]; + + davMailsLabels = [NSMutableArray arrayWithCapacity: max]; + + for (count = 0; count < max; count++) + { + key = [allKeys objectAtIndex: count]; + values = [labelsFromDefaults objectForKey: key]; + + attributes = [NSDictionary dictionaryWithObjectsAndKeys: key, @"id", + [values objectAtIndex: 1], @"color", + nil]; + + labelValues = davElementWithAttributesAndContent(@"label", + attributes, + XMLNS_INVERSEDAV, + [values objectAtIndex: 0]); + + [davMailsLabels addObject: labelValues]; + } + + return [davElementWithContent (@"mails-labels", + XMLNS_INVERSEDAV, + davMailsLabels) + asWebDAVValue]; +} + +/* + + We get something like that: + + Request: + + + + + + + Important + Work + Personal + To Do + Later + + + + + + Response: + + + + /SOGo/dav/sogo10/Mail/ + + + + + HTTP/1.1 200 OK + + + + +*/ +- (NSException *) setDavMailsLabels: (NSString *) newLabels +{ + id documentElement, labelNode; + id labelNodes; + id document; + + NSString *label, *name, *color; + NSMutableDictionary *labels; + NSMutableArray *values; + SOGoUserDefaults *ud; + SOGoUser *ownerUser; + + NSUInteger count, max; + + labels = [NSMutableDictionary dictionary]; + + if ([newLabels length] > 0) + { + document = [[context request] contentAsDOMDocument]; + documentElement = [document documentElement]; + labelNodes = [documentElement getElementsByTagName: @"label"]; + max = [labelNodes length]; + + for (count = 0; count < max; count++) + { + values = [NSMutableArray array]; + + labelNode = [labelNodes objectAtIndex: count]; + + label = [labelNode attribute: @"id"]; + name = [labelNode textValue]; + color = [labelNode attribute: @"color"]; + + [values addObject: name]; + [values addObject: color]; + + [labels setObject: values forKey: label]; + } + } + + ownerUser = [SOGoUser userWithLogin: owner]; + ud = [ownerUser userDefaults]; + [ud setMailLabelsColors: labels]; + [ud synchronize]; + + return nil; +} + @end /* SOGoMailAccounts */ diff --git a/SoObjects/Mailer/SOGoMailLabel.h b/SoObjects/Mailer/SOGoMailLabel.h new file mode 100644 index 000000000..54bd2496a --- /dev/null +++ b/SoObjects/Mailer/SOGoMailLabel.h @@ -0,0 +1,50 @@ +/* + Copyright (C) 2013 Inverse inc. + + This file is part of SOGo. + + SOGo is free software; you can redistribute it and/or modify it under + the terms of the GNU Lesser General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + SOGo is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with OGo; see the file COPYING. If not, write to the + Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. +*/ + +#ifndef SOGOMAILLABEL_H +#define SOGOMAILLABEL_H + +#import +#import + +#import "../../UI/SOGoUI/UIxComponent.h"; + +@interface SOGoMailLabel : NSObject +{ + NSString *_name; + NSString *_label; + NSString *_color; +} + +- (id) initWithName: (NSString *) theName + label: (NSString *) theLabel + color: (NSString *) theColor; + +- (NSString *) name; +- (NSString *) label; +- (NSString *) color; + ++ (NSArray *) labelsFromDefaults: (NSDictionary *) theDefaults + component: (UIxComponent *) theComponent; + +@end + +#endif // SOGOMAILLABEL_H diff --git a/SoObjects/Mailer/SOGoMailLabel.m b/SoObjects/Mailer/SOGoMailLabel.m new file mode 100644 index 000000000..413684985 --- /dev/null +++ b/SoObjects/Mailer/SOGoMailLabel.m @@ -0,0 +1,96 @@ +/* + Copyright (C) 2007-2013 Inverse inc. + + This file is part of SOGo. + + SOGo is free software; you can redistribute it and/or modify it under + the terms of the GNU Lesser General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + SOGo is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with OGo; see the file COPYING. If not, write to the + Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. +*/ + +#import "SOGoMailLabel.h" + +#import + +@implementation SOGoMailLabel + +- (id) initWithName: (NSString *) theName + label: (NSString *) theLabel + color: (NSString *) theColor +{ + self = [super init]; + + if (self) + { + ASSIGN(_name, theName); + ASSIGN(_label, theLabel); + ASSIGN(_color, theColor); + } + return self; +} + +- (void) dealloc +{ + RELEASE(_name); + RELEASE(_label); + RELEASE(_color); + [super dealloc]; +} + +- (NSString *) name +{ + return _name; +} + +- (NSString *) label +{ + return _label; +} + +- (NSString *) color +{ + return _color; +} + + ++ (NSArray *) labelsFromDefaults: (NSDictionary *) theDefaults + component: (UIxComponent *) theComponent +{ + NSMutableArray *allLabels, *allKeys; + NSDictionary *mailLabelsColors; + NSString *key, *name; + SOGoMailLabel *label; + NSArray *values; + int i; + + allLabels = [NSMutableArray array]; + allKeys = [[theDefaults allKeys] sortedArrayUsingSelector: @selector (caseInsensitiveCompare:)]; + + for (i = 0; i < [allKeys count]; i++) + { + key = [allKeys objectAtIndex: i]; + values = [theDefaults objectForKey: key]; + name = [theComponent labelForKey: [values objectAtIndex: 0]]; + + label = [[self alloc] initWithName: key + label: name + color: [values objectAtIndex: 1]]; + [allLabels addObject: label]; + RELEASE(label); + } + + return allLabels; +} + +@end diff --git a/SoObjects/Mailer/SOGoMailNamespace.m b/SoObjects/Mailer/SOGoMailNamespace.m index bc4d1f88b..4bec0420a 100644 --- a/SoObjects/Mailer/SOGoMailNamespace.m +++ b/SoObjects/Mailer/SOGoMailNamespace.m @@ -1,8 +1,6 @@ /* SOGoMailNamespace.m - this file is part of SOGo * - * Copyright (C) 2010 Wolfgang Sourdeau - * - * Author: Wolfgang Sourdeau + * Copyright (C) 2010-2013 Inverse inc. * * 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 diff --git a/SoObjects/Mailer/product.plist b/SoObjects/Mailer/product.plist index 523da2688..42249f727 100644 --- a/SoObjects/Mailer/product.plist +++ b/SoObjects/Mailer/product.plist @@ -29,9 +29,6 @@ "WebDAV Access" = ( "Owner", "AuthorizedSubscriber" ); }; }; -/* SOGoSharedMailAccount = { - superclass = "SOGoMailAccount"; - }; */ SOGoMailFolder = { superclass = "SOGoMailBaseObject"; defaultRoles = { @@ -44,9 +41,6 @@ "Change Permissions" = ( "Owner", "MailAdministrator" ); }; }; -/* SOGoSharedInboxFolder = { - superclass = "SOGoMailFolder"; - }; */ SOGoTrashFolder = { superclass = "SOGoMailFolder"; }; diff --git a/SoObjects/SOGo/NSDictionary+DAV.m b/SoObjects/SOGo/NSDictionary+DAV.m index bd3d40161..722e20511 100644 --- a/SoObjects/SOGo/NSDictionary+DAV.m +++ b/SoObjects/SOGo/NSDictionary+DAV.m @@ -1,8 +1,6 @@ /* NSDictionary+DAV.m - this file is part of SOGo * - * Copyright (C) 2008-2009 Inverse inc. - * - * Author: Wolfgang Sourdeau + * Copyright (C) 2008-2013 Inverse inc. * * 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 @@ -59,6 +57,7 @@ - (NSString *) asWebDavStringWithNamespaces: (NSMutableDictionary *) namespaces { + NSDictionary *attributes; NSMutableString *webdavString; NSString *nsTag, *ns, *subString, *element; BOOL firstLevel; @@ -88,6 +87,22 @@ [webdavString appendString: [self _namespaceDecl: namespaces]]; [namespaces release]; } + + attributes = [self objectForKey: @"attributes"]; + + if (attributes) + { + NSArray *keys; + int i; + + keys = [attributes allKeys]; + + for (i = 0; i < [keys count]; i++) + { + [webdavString appendFormat: @" %@=\"%@\"", [keys objectAtIndex: i], [attributes objectForKey: [keys objectAtIndex: i]]]; + } + } + if (subString) [webdavString appendFormat: @">%@", subString, element]; else diff --git a/SoObjects/SOGo/NSObject+DAV.h b/SoObjects/SOGo/NSObject+DAV.h index e1d0e76a2..ef5399e57 100644 --- a/SoObjects/SOGo/NSObject+DAV.h +++ b/SoObjects/SOGo/NSObject+DAV.h @@ -1,8 +1,6 @@ /* NSObject+DAV.h - this file is part of SOGo * - * Copyright (C) 2008 Inverse inc. - * - * Author: Wolfgang Sourdeau + * Copyright (C) 2008-2013 Inverse inc. * * 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 @@ -47,6 +45,12 @@ typedef enum _HTTPStatusCode { n, @"ns", \ c, @"content", nil] +#define davElementWithAttributesAndContent(t,a,n,c) \ + [NSDictionary dictionaryWithObjectsAndKeys: t, @"method", \ + a, @"attributes", \ + n, @"ns", \ + c, @"content", nil] + SEL SOGoSelectorForPropertyGetter (NSString *property); SEL SOGoSelectorForPropertySetter (NSString *property); diff --git a/SoObjects/SOGo/NSObject+DAV.m b/SoObjects/SOGo/NSObject+DAV.m index 30f5ab016..b5e9a40f6 100644 --- a/SoObjects/SOGo/NSObject+DAV.m +++ b/SoObjects/SOGo/NSObject+DAV.m @@ -1,8 +1,6 @@ /* NSObject+DAV.m - this file is part of SOGo * - * Copyright (C) 2008-2010 Inverse inc. - * - * Author: Wolfgang Sourdeau + * Copyright (C) 2008-2013 Inverse inc. * * 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 diff --git a/SoObjects/SOGo/NSString+DAV.h b/SoObjects/SOGo/NSString+DAV.h index 29478150b..83a5ce26d 100644 --- a/SoObjects/SOGo/NSString+DAV.h +++ b/SoObjects/SOGo/NSString+DAV.h @@ -1,8 +1,6 @@ /* NSString+DAV.h - this file is part of SOGo * - * Copyright (C) 2008 Inverse inc. - * - * Author: Wolfgang Sourdeau + * Copyright (C) 2008-2013 Inverse inc. * * 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 diff --git a/SoObjects/SOGo/NSString+Utilities.m b/SoObjects/SOGo/NSString+Utilities.m index 59241ba4b..cb9889eb8 100644 --- a/SoObjects/SOGo/NSString+Utilities.m +++ b/SoObjects/SOGo/NSString+Utilities.m @@ -314,12 +314,12 @@ static int cssEscapingCount; int count; strings = [NSArray arrayWithObjects: @"_U_", @"_D_", @"_H_", @"_A_", @"_S_", - @"_C_", @"_CO_", @"_SP_", @"_SQ_", @"_AM_", @"_P_", nil]; + @"_C_", @"_CO_", @"_SP_", @"_SQ_", @"_AM_", @"_P_", @"_DS_", nil]; [strings retain]; cssEscapingStrings = [strings asPointersOfObjects]; characters = [NSArray arrayWithObjects: @"_", @".", @"#", @"@", @"*", @":", - @",", @" ", @"'", @"&", @"+", nil]; + @",", @" ", @"'", @"&", @"+", @"$", nil]; cssEscapingCount = [strings count]; cssEscapingCharacters = NSZoneMalloc (NULL, (cssEscapingCount + 1) diff --git a/SoObjects/SOGo/SOGoDefaults.plist b/SoObjects/SOGo/SOGoDefaults.plist index bb68c62d7..9b5b7050d 100644 --- a/SoObjects/SOGo/SOGoDefaults.plist +++ b/SoObjects/SOGo/SOGoDefaults.plist @@ -76,4 +76,12 @@ SOGoRemindWithASound = YES; SOGoSearchMinimumWordLength = 2; + + SOGoMailLabelsColors = { + $label1 = ("Important", "#FF0000"); + $label2 = ("Work", "#FF9900"); + $label3 = ("Personal", "#009900"); + $label4 = ("To Do", "#3333FF"); + $label5 = ("Later", "#993399"); + }; } diff --git a/SoObjects/SOGo/SOGoObject.m b/SoObjects/SOGo/SOGoObject.m index 90df71afe..716e8f194 100644 --- a/SoObjects/SOGo/SOGoObject.m +++ b/SoObjects/SOGo/SOGoObject.m @@ -1,9 +1,7 @@ /* SOGoObject.m - this file is part of SOGo * * Copyright (C) 2004-2005 SKYRIX Software AG - * Copyright (C) 2006-2009 Inverse inc. - * - * Author: Wolfgang Sourdeau + * Copyright (C) 2006-2013 Inverse inc. * * 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 diff --git a/SoObjects/SOGo/SOGoUserDefaults.h b/SoObjects/SOGo/SOGoUserDefaults.h index 0a6cdb818..3fdaf0306 100644 --- a/SoObjects/SOGo/SOGoUserDefaults.h +++ b/SoObjects/SOGo/SOGoUserDefaults.h @@ -1,8 +1,6 @@ /* SOGoUserDefaults.h - this file is part of SOGo * - * Copyright (C) 2011-2012 Inverse inc. - * - * Author: Wolfgang Sourdeau + * Copyright (C) 2011-2013 Inverse inc. * * 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 @@ -166,6 +164,9 @@ extern NSString *SOGoWeekStartFirstFullWeek; - (void) setForwardOptions: (NSDictionary *) newValue; - (NSDictionary *) forwardOptions; +- (void) setMailLabelsColors: (NSDictionary *) newValues; +- (NSDictionary *) mailLabelsColors; + /* calendar */ - (void) setCalendarCategories: (NSArray *) newValues; - (NSArray *) calendarCategories; diff --git a/SoObjects/SOGo/SOGoUserDefaults.m b/SoObjects/SOGo/SOGoUserDefaults.m index bba384f43..006a9d346 100644 --- a/SoObjects/SOGo/SOGoUserDefaults.m +++ b/SoObjects/SOGo/SOGoUserDefaults.m @@ -1,8 +1,6 @@ /* SOGoUserDefaults.m - this file is part of SOGo * - * Copyright (C) 2009-2012 Inverse inc. - * - * Author: Wolfgang Sourdeau + * Copyright (C) 2009-2013 Inverse inc. * * 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 @@ -26,6 +24,8 @@ #import #import +#import + #import "NSString+Utilities.h" #import "SOGoDomainDefaults.h" #import "SOGoSystemDefaults.h" @@ -420,7 +420,8 @@ NSString *SOGoWeekStartFirstFullWeek = @"FirstFullWeek"; - (NSString *) draftsFolderName { - return [self stringForKey: @"SOGoDraftsFolderName"]; + return [[self stringForKey: @"SOGoDraftsFolderName"] + stringByEncodingImap4FolderName]; } - (void) setSentFolderName: (NSString *) newValue @@ -430,7 +431,8 @@ NSString *SOGoWeekStartFirstFullWeek = @"FirstFullWeek"; - (NSString *) sentFolderName { - return [self stringForKey: @"SOGoSentFolderName"]; + return [[self stringForKey: @"SOGoSentFolderName"] + stringByEncodingImap4FolderName]; } - (void) setTrashFolderName: (NSString *) newValue @@ -440,7 +442,8 @@ NSString *SOGoWeekStartFirstFullWeek = @"FirstFullWeek"; - (NSString *) trashFolderName { - return [self stringForKey: @"SOGoTrashFolderName"]; + return [[self stringForKey: @"SOGoTrashFolderName"] + stringByEncodingImap4FolderName]; } - (void) setFirstDayOfWeek: (int) newValue @@ -733,6 +736,26 @@ NSString *SOGoWeekStartFirstFullWeek = @"FirstFullWeek"; return [self boolForKey: @"SOGoRemindWithASound"]; } +// +// Dictionary of arrays. Example: +// +// { +// label1 => ("Important", "#FF0000"); +// label2 => ("Work" "#00FF00"); +// foo_bar => ("Foo Bar", "#0000FF"); +// } +// +- (void) setMailLabelsColors: (NSDictionary *) newValues +{ + [self setObject: newValues forKey: @"SOGoMailLabelsColors"]; +} + +- (NSDictionary *) mailLabelsColors +{ + return [self objectForKey: @"SOGoMailLabelsColors"]; +} + + - (void) setSieveFilters: (NSArray *) newValue { [self setObject: newValue forKey: @"SOGoSieveFilters"]; diff --git a/SoObjects/SOGo/SOGoWebDAVValue.m b/SoObjects/SOGo/SOGoWebDAVValue.m index 31c471f71..3734491e4 100644 --- a/SoObjects/SOGo/SOGoWebDAVValue.m +++ b/SoObjects/SOGo/SOGoWebDAVValue.m @@ -1,8 +1,6 @@ /* SOGoWebDAVValue.m - this file is part of $PROJECT_NAME_HERE$ * - * Copyright (C) 2008 Inverse inc. - * - * Author: Wolfgang Sourdeau + * Copyright (C) 2008-2013 Inverse inc. * * 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 diff --git a/UI/MailPartViewers/Czech.lproj/Localizable.strings b/UI/MailPartViewers/Czech.lproj/Localizable.strings index d1fc1b8a5..b6c33bb26 100644 --- a/UI/MailPartViewers/Czech.lproj/Localizable.strings +++ b/UI/MailPartViewers/Czech.lproj/Localizable.strings @@ -12,6 +12,8 @@ publish_info_text = "Odesílatel Vás informuje o přiložené události."; cancel_info_text = "Vaše pozvánka nebo celá událost byla zrušena."; request_info_no_attendee = "navrhuje setkání účastníků. Tento mail jste obdrželi jako oznámení, nejste nastaveni jako účastník."; Appointment = "Schůzka"; +"Status Update" = "Aktualizace stavu"; +was = "bylo"; Organizer = "Organizátor"; Time = "Čas"; diff --git a/UI/MailPartViewers/Finnish.lproj/Localizable.strings b/UI/MailPartViewers/Finnish.lproj/Localizable.strings index ee6edde97..6c730767f 100644 --- a/UI/MailPartViewers/Finnish.lproj/Localizable.strings +++ b/UI/MailPartViewers/Finnish.lproj/Localizable.strings @@ -12,6 +12,8 @@ publish_info_text = "Lähettäjä ilmoittaa sinulle liitteenä olevan tapahtuman cancel_info_text = "Kutsusi tai tapahtuma on peruttu."; request_info_no_attendee = "ehdottaa kokousta osallistujille. Saat tämän sähköpostin ilmoituksena, et osallistujana."; Appointment = "Tapahtuma"; +"Status Update" = "Tilapäivitys"; +was = "oli"; Organizer = "Järjestäjä"; Time = "Aika"; diff --git a/UI/MailPartViewers/Polish.lproj/Localizable.strings b/UI/MailPartViewers/Polish.lproj/Localizable.strings index 5d4038cc5..d303ec387 100644 --- a/UI/MailPartViewers/Polish.lproj/Localizable.strings +++ b/UI/MailPartViewers/Polish.lproj/Localizable.strings @@ -12,6 +12,8 @@ publish_info_text = "Nadawca informuje cię o załączonym wydarzeniu."; cancel_info_text = "Twoje zaproszenie lub całe wydarzenie zostało anulowane."; request_info_no_attendee = "proponuje uczestnikom spotkanie. Otrzymujesz tę wiadomość jako powiadomienie, nie jesteś planowany jako uczestnik."; Appointment = "Spotkanie"; +"Status Update" = "Aktualizacja Statusu"; +was = "było"; Organizer = "Organizator"; Time = "Czas"; diff --git a/UI/MailPartViewers/Russian.lproj/Localizable.strings b/UI/MailPartViewers/Russian.lproj/Localizable.strings index 529206e1f..c6c2e730b 100644 --- a/UI/MailPartViewers/Russian.lproj/Localizable.strings +++ b/UI/MailPartViewers/Russian.lproj/Localizable.strings @@ -12,6 +12,8 @@ publish_info_text = "Отправитель сообщает о приложен cancel_info_text = "Ваше приглашение или все мероприятие отменено."; request_info_no_attendee = "предлагает участникам встретиться. Вы получили это сообщение как приглашенное лицо. Вы еще не включены в список подтвержденных участников."; Appointment = "Встреча"; +"Status Update" = "Обновление статуса"; +was = "был"; Organizer = "Организатор"; Time = "Время"; diff --git a/UI/MailPartViewers/SpanishSpain.lproj/Localizable.strings b/UI/MailPartViewers/SpanishSpain.lproj/Localizable.strings index 12fb2dd7d..3eeeb85ea 100644 --- a/UI/MailPartViewers/SpanishSpain.lproj/Localizable.strings +++ b/UI/MailPartViewers/SpanishSpain.lproj/Localizable.strings @@ -12,6 +12,8 @@ publish_info_text = "El remitente le informa del evento adjunto."; cancel_info_text = "Su invitación o el evento ha sido cancelado."; request_info_no_attendee = "ha propuesto un evento a los participantes. Ud recibe este correo como notificación, pero no aparece como participante."; Appointment = "Cita"; +"Status Update" = "Actualización de Estado"; +was = "estaba"; Organizer = "Organizador"; Time = "Hora"; diff --git a/UI/MailerUI/UIxMailAccountActions.m b/UI/MailerUI/UIxMailAccountActions.m index f3b519728..a06411294 100644 --- a/UI/MailerUI/UIxMailAccountActions.m +++ b/UI/MailerUI/UIxMailAccountActions.m @@ -1,6 +1,6 @@ /* UIxMailAccountActions.m - this file is part of SOGo * - * Copyright (C) 2007-2011 Inverse inc. + * Copyright (C) 2007-2013 Inverse inc. * * Author: Wolfgang Sourdeau * Ludovic Marcotte @@ -87,21 +87,21 @@ { co = [self clientObject]; specialFolders = [[NSArray arrayWithObjects: - [co inboxFolderNameInContext: context], - [co draftsFolderNameInContext: context], - [co sentFolderNameInContext: context], - [co trashFolderNameInContext: context], - [co otherUsersFolderNameInContext: context], - [co sharedFoldersNameInContext: context], - nil] stringsWithFormat: @"/%@"]; + [co inboxFolderNameInContext: context], + [co draftsFolderNameInContext: context], + [co sentFolderNameInContext: context], + [co trashFolderNameInContext: context], + [co otherUsersFolderNameInContext: context], + [co sharedFoldersNameInContext: context], + nil] stringsWithFormat: @"/%@"]; ASSIGN(inboxFolderName, [specialFolders objectAtIndex: 0]); ASSIGN(draftsFolderName, [specialFolders objectAtIndex: 1]); ASSIGN(sentFolderName, [specialFolders objectAtIndex: 2]); ASSIGN(trashFolderName, [specialFolders objectAtIndex: 3]); if ([specialFolders count] > 4) - ASSIGN(otherUsersFolderName, [specialFolders objectAtIndex: 4]); + ASSIGN(otherUsersFolderName, [specialFolders objectAtIndex: 4]); if ([specialFolders count] > 5) - ASSIGN(sharedFoldersName, [specialFolders objectAtIndex: 5]); + ASSIGN(sharedFoldersName, [specialFolders objectAtIndex: 5]); } if ([folderName isEqualToString: inboxFolderName]) @@ -141,48 +141,50 @@ pool = [[NSAutoreleasePool alloc] init]; currentDecodedFolder = [currentFolder stringByDecodingImap4FolderName]; - currentFolderType = [self _folderType: currentDecodedFolder]; + currentFolderType = [self _folderType: currentFolder]; // We translate the "Other Users" and "Shared Folders" namespaces. // While we're at it, we also translate the user's mailbox names // to the full name of the person. if (otherUsersFolderName && [currentDecodedFolder hasPrefix: otherUsersFolderName]) - { - // We have a string like /Other Users/lmarcotte/... under Cyrus, but we could - // also have something like /shared under Dovecot. So we swap the username only - // if we have one, of course. - pathComponents = [NSMutableArray arrayWithArray: [currentDecodedFolder pathComponents]]; - - if ([pathComponents count] > 2) - { - login = [pathComponents objectAtIndex: 2]; - userManager = [SOGoUserManager sharedUserManager]; - fullName = [userManager getCNForUID: login]; - [pathComponents removeObjectsInRange: NSMakeRange(0,3)]; - - currentDisplayName = [NSString stringWithFormat: @"/%@/%@/%@", - [self labelForKey: @"OtherUsersFolderName"], - (fullName != nil ? fullName : login), - [pathComponents componentsJoinedByString: @"/"]]; - - } - else - { - currentDisplayName = [NSString stringWithFormat: @"/%@%@", [self labelForKey: @"OtherUsersFolderName"], - [currentDecodedFolder substringFromIndex: [otherUsersFolderName length]]]; - } - } + { + // We have a string like /Other Users/lmarcotte/... under Cyrus, but we could + // also have something like /shared under Dovecot. So we swap the username only + // if we have one, of course. + pathComponents = [NSMutableArray arrayWithArray: [currentDecodedFolder pathComponents]]; + + if ([pathComponents count] > 2) + { + login = [pathComponents objectAtIndex: 2]; + userManager = [SOGoUserManager sharedUserManager]; + fullName = [userManager getCNForUID: login]; + [pathComponents removeObjectsInRange: NSMakeRange(0,3)]; + + currentDisplayName = [NSString stringWithFormat: @"/%@/%@/%@", + [self labelForKey: @"OtherUsersFolderName"], + (fullName != nil ? fullName : login), + [pathComponents componentsJoinedByString: @"/"]]; + + } + else + { + currentDisplayName = [NSString stringWithFormat: @"/%@%@", + [self labelForKey: @"OtherUsersFolderName"], + [currentDecodedFolder substringFromIndex: + [otherUsersFolderName length]]]; + } + } else if (sharedFoldersName && [currentDecodedFolder hasPrefix: sharedFoldersName]) - currentDisplayName = [NSString stringWithFormat: @"/%@%@", [self labelForKey: @"SharedFoldersName"], - [currentDecodedFolder substringFromIndex: [sharedFoldersName length]]]; + currentDisplayName = [NSString stringWithFormat: @"/%@%@", [self labelForKey: @"SharedFoldersName"], + [currentDecodedFolder substringFromIndex: [sharedFoldersName length]]]; else - currentDisplayName = currentDecodedFolder; - + currentDisplayName = currentDecodedFolder; + folderData = [NSDictionary dictionaryWithObjectsAndKeys: - currentFolder, @"path", - currentFolderType, @"type", - currentDisplayName, @"displayName", - nil]; + currentFolder, @"path", + currentFolderType, @"type", + currentDisplayName, @"displayName", + nil]; [folders addObject: folderData]; [pool release]; } @@ -207,7 +209,7 @@ response = [self responseWithStatus: 200 andString: [data jsonRepresentation]]; [response setHeader: @"application/json" - forKey: @"content-type"]; + forKey: @"content-type"]; return response; } @@ -256,7 +258,7 @@ nl = ([[[[context activeUser] userDefaults] mailComposeMessageType] isEqualToString: @"html"] ? @"
" : @"\n"); [newDraftMessage - setText: [NSString stringWithFormat: @"%@%@-- %@%@", nl, nl, nl, signature]]; + setText: [NSString stringWithFormat: @"%@%@-- %@%@", nl, nl, nl, signature]]; save = YES; } if (save) @@ -264,8 +266,8 @@ urlBase = [newDraftMessage baseURLInContext: context]; url = [urlBase composeURLWithAction: @"edit" - parameters: nil - andHash: NO]; + parameters: nil + andHash: NO]; return [self redirectToLocation: url]; } diff --git a/UI/MailerUI/UIxMailActions.h b/UI/MailerUI/UIxMailActions.h index cdbea6305..80292b24a 100644 --- a/UI/MailerUI/UIxMailActions.h +++ b/UI/MailerUI/UIxMailActions.h @@ -1,8 +1,6 @@ /* UIxMailActions.h - this file is part of SOGo * - * Copyright (C) 2007 Inverse inc. - * - * Author: Wolfgang Sourdeau + * Copyright (C) 2007-2013 Inverse inc. * * 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 diff --git a/UI/MailerUI/UIxMailActions.m b/UI/MailerUI/UIxMailActions.m index 652ffd7ee..c32a4f80c 100644 --- a/UI/MailerUI/UIxMailActions.m +++ b/UI/MailerUI/UIxMailActions.m @@ -1,8 +1,6 @@ /* UIxMailActions.m - this file is part of SOGo * - * Copyright (C) 2007 Inverse inc. - * - * Author: Wolfgang Sourdeau + * Copyright (C) 2007-2013 Inverse inc. * * 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 @@ -21,6 +19,7 @@ */ #import +#import #import #import @@ -32,6 +31,8 @@ #import #import #import +#import + #import "../Common/WODirectAction+SOGo.h" @@ -194,16 +195,18 @@ return response; } -- (WOResponse *) _addLabel: (unsigned int) number +- (WOResponse *) addLabelAction { WOResponse *response; SOGoMailObject *co; NSException *error; NSArray *flags; + NSString *flag; + flag = [[[self->context request] formValueForKey: @"flag"] fromCSSIdentifier]; co = [self clientObject]; - flags = [NSArray arrayWithObject: - [NSString stringWithFormat: @"$Label%u", number]]; + flags = [NSArray arrayWithObject: flag]; + error = [co addFlags: flags]; if (error) response = (WOResponse *) error; @@ -213,16 +216,18 @@ return response; } -- (WOResponse *) _removeLabel: (unsigned int) number +- (WOResponse *) removeLabelAction { WOResponse *response; SOGoMailObject *co; NSException *error; NSArray *flags; + NSString *flag; + flag = [[[self->context request] formValueForKey: @"flag"] fromCSSIdentifier]; co = [self clientObject]; - flags = [NSArray arrayWithObject: - [NSString stringWithFormat: @"$Label%u", number]]; + flags = [NSArray arrayWithObject: flag]; + error = [co removeFlags: flags]; if (error) response = (WOResponse *) error; @@ -232,66 +237,25 @@ return response; } -- (WOResponse *) addLabel1Action -{ - return [self _addLabel: 1]; -} - -- (WOResponse *) addLabel2Action -{ - return [self _addLabel: 2]; -} - -- (WOResponse *) addLabel3Action -{ - return [self _addLabel: 3]; -} - -- (WOResponse *) addLabel4Action -{ - return [self _addLabel: 4]; -} - -- (WOResponse *) addLabel5Action -{ - return [self _addLabel: 5]; -} - -- (WOResponse *) removeLabel1Action -{ - return [self _removeLabel: 1]; -} - -- (WOResponse *) removeLabel2Action -{ - return [self _removeLabel: 2]; -} - -- (WOResponse *) removeLabel3Action -{ - return [self _removeLabel: 3]; -} - -- (WOResponse *) removeLabel4Action -{ - return [self _removeLabel: 4]; -} - -- (WOResponse *) removeLabel5Action -{ - return [self _removeLabel: 5]; -} - - (WOResponse *) removeAllLabelsAction { + NSMutableArray *flags; WOResponse *response; SOGoMailObject *co; NSException *error; - NSArray *flags; + NSDictionary *v; + co = [self clientObject]; - flags = [NSArray arrayWithObjects: @"$Label1", @"$Label2", @"$Label3", - @"$Label4", @"$Label5", nil]; + + v = [[[context activeUser] userDefaults] mailLabelsColors]; + + // We always unconditionally remove the Mozilla tags + flags = [NSMutableArray arrayWithObjects: @"$Label1", @"$Label2", @"$Label3", + @"$Label4", @"$Label5", nil]; + + [flags addObjectsFromArray: [v allKeys]]; + error = [co removeFlags: flags]; if (error) response = (WOResponse *) error; diff --git a/UI/MailerUI/UIxMailEditor.m b/UI/MailerUI/UIxMailEditor.m index 5e3e0caa2..3eb7878b8 100644 --- a/UI/MailerUI/UIxMailEditor.m +++ b/UI/MailerUI/UIxMailEditor.m @@ -253,11 +253,33 @@ static NSArray *infoKeys = nil; - (NSString *) replyTo { - SOGoUserDefaults *ud; + NSString *value; + + value = nil; - ud = [[context activeUser] userDefaults]; + // + // We add the correct replyTo here. That is, the one specified in the defaults + // for the main "SOGo mail account" versus the one specified in the auxiliary + // IMAP accounts. + // + if ([[[[self clientObject] mailAccountFolder] nameInContainer] intValue] == 0) + { + SOGoUserDefaults *ud; + + ud = [[context activeUser] userDefaults]; + value = [ud mailReplyTo]; + } + else + { + NSArray *identities; + + identities = [[[self clientObject] mailAccountFolder] identities]; - return [ud mailReplyTo]; + if ([identities count]) + value = [[identities objectAtIndex: 0] objectForKey: @"replyTo"]; + } + + return value; } - (void) setSubject: (NSString *) newSubject diff --git a/UI/MailerUI/UIxMailListActions.m b/UI/MailerUI/UIxMailListActions.m index e766321e9..90acfd53e 100644 --- a/UI/MailerUI/UIxMailListActions.m +++ b/UI/MailerUI/UIxMailListActions.m @@ -1,6 +1,6 @@ /* Copyright (C) 2004-2005 SKYRIX Software AG - Copyright (C) 2006-2011 Inverse inc. + Copyright (C) 2006-2013 Inverse inc. This file is part of SOGo @@ -861,8 +861,9 @@ flags = [[message objectForKey: @"flags"] objectEnumerator]; while ((currentFlag = [flags nextObject])) - if ([currentFlag hasPrefix: @"$label"]) - [labels addObject: [currentFlag substringFromIndex: 1]]; + { + [labels addObject: currentFlag]; + } return [labels componentsJoinedByString: @" "]; } diff --git a/UI/MailerUI/UIxMailMainFrame.h b/UI/MailerUI/UIxMailMainFrame.h index a7d5ecf49..b51116dc2 100644 --- a/UI/MailerUI/UIxMailMainFrame.h +++ b/UI/MailerUI/UIxMailMainFrame.h @@ -1,8 +1,6 @@ /* UIxMailMainFrame.h - this file is part of SOGo * - * Copyright (C) 2006-2011 Inverse inc. - * - * Author: Wolfgang Sourdeau + * Copyright (C) 2006-2013 Inverse inc. * * 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 @@ -25,6 +23,8 @@ #import "../SOGoUI/UIxComponent.h" +@class SOGoMailLabel; + @interface UIxMailMainFrame : UIxComponent { SOGoUserSettings *us; @@ -33,6 +33,7 @@ NSArray *columnsOrder; int folderType; NSDictionary *currentColumn; + SOGoMailLabel *_currentLabel; } - (WOResponse *) getFoldersStateAction; diff --git a/UI/MailerUI/UIxMailMainFrame.m b/UI/MailerUI/UIxMailMainFrame.m index a5a88c27b..dd8aca949 100644 --- a/UI/MailerUI/UIxMailMainFrame.m +++ b/UI/MailerUI/UIxMailMainFrame.m @@ -1,9 +1,5 @@ /* - Copyright (C) 2007-2011 Inverse inc. - Copyright (C) 2004-2005 SKYRIX Software AG - - Author: Wolfgang Sourdeau - Ludovic Marcotte + Copyright (C) 2007-2013 Inverse inc. This file is part of SOGo. @@ -48,6 +44,7 @@ #import #import #import +#import #import #import #import @@ -84,6 +81,12 @@ return self; } +- (void) dealloc +{ + RELEASE(_currentLabel); + [super dealloc]; +} + - (void) _setupContext { SOGoUser *activeUser; @@ -687,4 +690,32 @@ return [folders jsonRepresentation]; } +// +// Standard mapping done by Thunderbird: +// +// label1 => Important +// label2 => Work +// label3 => Personal +// label4 => To Do +// label5 => Later +// +- (NSArray *) availableLabels +{ + NSDictionary *v; + + v = [[[context activeUser] userDefaults] mailLabelsColors]; + + return [SOGoMailLabel labelsFromDefaults: v component: self]; +} + +- (void) setCurrentLabel: (SOGoMailLabel *) theCurrentLabel +{ + ASSIGN(_currentLabel, theCurrentLabel); +} + +- (SOGoMailLabel *) currentLabel +{ + return _currentLabel; +} + @end /* UIxMailMainFrame */ diff --git a/UI/MailerUI/product.plist b/UI/MailerUI/product.plist index 60d726ba0..8b9ed30cb 100644 --- a/UI/MailerUI/product.plist +++ b/UI/MailerUI/product.plist @@ -272,55 +272,15 @@ actionClass = "UIxMailActions"; actionName = "markMessageRead"; }; - addLabel1 = { + addLabel = { protectedBy = "View"; actionClass = "UIxMailActions"; - actionName = "addLabel1"; + actionName = "addLabel"; }; - addLabel2 = { + removeLabel = { protectedBy = "View"; actionClass = "UIxMailActions"; - actionName = "addLabel2"; - }; - addLabel3 = { - protectedBy = "View"; - actionClass = "UIxMailActions"; - actionName = "addLabel3"; - }; - addLabel4 = { - protectedBy = "View"; - actionClass = "UIxMailActions"; - actionName = "addLabel4"; - }; - addLabel5 = { - protectedBy = "View"; - actionClass = "UIxMailActions"; - actionName = "addLabel5"; - }; - removeLabel1 = { - protectedBy = "View"; - actionClass = "UIxMailActions"; - actionName = "removeLabel1"; - }; - removeLabel2 = { - protectedBy = "View"; - actionClass = "UIxMailActions"; - actionName = "removeLabel2"; - }; - removeLabel3 = { - protectedBy = "View"; - actionClass = "UIxMailActions"; - actionName = "removeLabel3"; - }; - removeLabel4 = { - protectedBy = "View"; - actionClass = "UIxMailActions"; - actionName = "removeLabel4"; - }; - removeLabel5 = { - protectedBy = "View"; - actionClass = "UIxMailActions"; - actionName = "removeLabel5"; + actionName = "removeLabel"; }; removeAllLabels = { protectedBy = "View"; diff --git a/UI/PreferencesUI/English.lproj/Localizable.strings b/UI/PreferencesUI/English.lproj/Localizable.strings index 481ecfb7b..d739522c9 100644 --- a/UI/PreferencesUI/English.lproj/Localizable.strings +++ b/UI/PreferencesUI/English.lproj/Localizable.strings @@ -288,12 +288,13 @@ "Flagged" = "Flagged"; "Junk" = "Junk"; "Not Junk" = "Not Junk"; -"Label 1" = "Label 1"; -"Label 2" = "Label 2"; -"Label 3" = "Label 3"; -"Label 4" = "Label 4"; -"Label 5" = "Label 5"; +"Important" = "Important"; +"Work" = "Work"; +"Personal" = "Personal"; +"To Do" = "To Do"; +"Later" = "Later"; +/* Password policy */ "The password was changed successfully." = "The password was changed successfully."; "Password must not be empty." = "Password must not be empty."; "The passwords do not match. Please try again." = "The passwords do not match. Please try again."; @@ -306,4 +307,4 @@ "Unhandled policy error: %{0}" = "Unhandled policy error: %{0}"; "Unhandled error response" = "Unhandled error response"; "Password change is not supported." = "Password change is not supported."; -"Unhandled HTTP error code: %{0}" = "Unhandled HTTP error code: %{0}"; +"Unhandled HTTP error code: %{0}" = "Unhandled HTTP error code: %{0}"; \ No newline at end of file diff --git a/UI/PreferencesUI/UIxFilterEditor.m b/UI/PreferencesUI/UIxFilterEditor.m index 28ce6c231..f6fe59d2b 100644 --- a/UI/PreferencesUI/UIxFilterEditor.m +++ b/UI/PreferencesUI/UIxFilterEditor.m @@ -1,8 +1,6 @@ /* UIxFilterEditor.m - this file is part of SOGo * - * Copyright (C) 2010 Inverse inc. - * - * Author: Wolfgang Sourdeau + * Copyright (C) 2010-2013 Inverse inc. * * 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 @@ -26,20 +24,44 @@ #import #import +#import #import #import +#import #import @interface UIxFilterEditor : UIxComponent { NSString *filterId; + NSDictionary *labels; } @end @implementation UIxFilterEditor +- (id) init +{ + self = [super init]; + + if (self) + { + filterId = nil; + labels = nil; + } + + return self; +} + +- (void) dealloc +{ + RELEASE(filterId); + RELEASE(labels); + [super dealloc]; +} + + /* convert and save */ - (BOOL) _validateFilterId { @@ -80,4 +102,14 @@ return filterId; } +- (NSString *) labels +{ + if (!labels) + { + ASSIGN(labels, [[[context activeUser] userDefaults] mailLabelsColors]); + } + + return [labels jsonRepresentation]; +} + @end diff --git a/UI/PreferencesUI/UIxPreferences.h b/UI/PreferencesUI/UIxPreferences.h index 24a1ea43a..3040e67ae 100644 --- a/UI/PreferencesUI/UIxPreferences.h +++ b/UI/PreferencesUI/UIxPreferences.h @@ -1,8 +1,6 @@ /* UIxPreferences.h - this file is part of SOGo * - * Copyright (C) 2007-2010 Inverse inc. - * - * Author: Wolfgang Sourdeau + * Copyright (C) 2007-2013 Inverse inc. * * 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 @@ -27,23 +25,36 @@ @class NSString; +@class SOGoMailLabel; @class SOGoUser; @interface UIxPreferences : UIxComponent { id item; SOGoUser *user; + + // Calendar categories NSString *category; NSArray *calendarCategories; NSDictionary *calendarCategoriesColors; + NSArray *contactsCategories; NSString *defaultCategoryColor; NSCalendarDate *today; + + // Mail labels/tags + SOGoMailLabel *label; + NSArray *mailLabels; + + // Sieve filtering NSArray *daysOfWeek, *daysBetweenResponsesList; NSArray *sieveFilters; NSMutableDictionary *vacationOptions, *forwardOptions; + BOOL mailCustomFromEnabled; BOOL hasChanged; + + } - (NSString *) userLongDateFormat; diff --git a/UI/PreferencesUI/UIxPreferences.m b/UI/PreferencesUI/UIxPreferences.m index 8d6bcb227..7b082f622 100644 --- a/UI/PreferencesUI/UIxPreferences.m +++ b/UI/PreferencesUI/UIxPreferences.m @@ -1,9 +1,6 @@ /* UIxPreferences.m - this file is part of SOGo * - * Copyright (C) 2007-2011 Inverse inc. - * - * Author: Wolfgang Sourdeau - * Francis Lachapelle + * Copyright (C) 2007-2013 Inverse inc. * * 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 @@ -31,6 +28,8 @@ #import #import +#import + #import #import @@ -47,6 +46,7 @@ #import #import #import +#import #import "UIxPreferences.h" @@ -77,6 +77,9 @@ defaultCategoryColor = nil; category = nil; + label = nil; + mailLabels = nil; + ASSIGN (daysOfWeek, [locale objectForKey: NSWeekDayNameArray]); dd = [user domainDefaults]; @@ -120,6 +123,8 @@ [calendarCategoriesColors release]; [defaultCategoryColor release]; [category release]; + [label release]; + [mailLabels release]; [contactsCategories release]; [forwardOptions release]; [daysOfWeek release]; @@ -1175,6 +1180,67 @@ sortedArrayUsingSelector: @selector (localizedCaseInsensitiveCompare:)]; } +- (SOGoMailLabel *) label +{ + return label; +} + +- (void) setLabel: (SOGoMailLabel *) newLabel +{ + ASSIGN(label, newLabel); +} + +- (NSArray *) mailLabelList +{ + if (!mailLabels) + { + NSDictionary *v; + + v = [[[context activeUser] userDefaults] mailLabelsColors]; + ASSIGN(mailLabels, [SOGoMailLabel labelsFromDefaults: v component: self]); + } + + return mailLabels; +} + +- (NSString *) mailLabelsValue +{ + return @""; +} + +- (void) setMailLabelsValue: (NSString *) value +{ + NSMutableDictionary *sanitizedLabels; + NSDictionary *newLabels; + NSArray *allKeys; + NSString *name; + int i; + + newLabels = [value objectFromJSONString]; + if (newLabels && [newLabels isKindOfClass: [NSDictionary class]]) + { + // We encode correctly our keys + sanitizedLabels = [NSMutableDictionary dictionary]; + allKeys = [newLabels allKeys]; + + for (i = 0; i < [allKeys count]; i++) + { + name = [allKeys objectAtIndex: i]; + + if (![name is7bitSafe]) + name = [name stringByEncodingImap4FolderName]; + + name = [name lowercaseString]; + + [sanitizedLabels setObject: [newLabels objectForKey: [allKeys objectAtIndex: i]] + forKey: name]; + } + + [userDefaults setMailLabelsColors: sanitizedLabels]; + } +} + + - (void) setCategory: (NSString *) newCategory { ASSIGN (category, newCategory); diff --git a/UI/Scheduler/GNUmakefile b/UI/Scheduler/GNUmakefile index 2ade17522..c3bc3b3d7 100644 --- a/UI/Scheduler/GNUmakefile +++ b/UI/Scheduler/GNUmakefile @@ -15,13 +15,12 @@ SchedulerUI_OBJC_FILES = \ \ UIxCalMainView.m \ UIxCalendarProperties.m \ - UIxColorPicker.m \ \ UIxCalFilterPanel.m \ UIxCalDayTable.m \ UIxCalDateSelector.m \ UIxCalUserRightsEditor.m \ - UIxCalFolderActions.m \ + UIxCalFolderActions.m \ \ UIxCalView.m \ UIxCalDayView.m \ diff --git a/UI/Scheduler/UIxColorPicker.h b/UI/Scheduler/UIxColorPicker.h deleted file mode 100644 index 179c8b309..000000000 --- a/UI/Scheduler/UIxColorPicker.h +++ /dev/null @@ -1,31 +0,0 @@ -/* UIxColorPicker.h - this file is part of SOGo - * - * Copyright (C) 2008 Inverse inc. - * - * Author: Wolfgang Sourdeau - * - * 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 - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This file is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#ifndef UIXCOLORPICKER_H -#define UIXCOLORPICKER_H - -#import - -@interface UIxColorPicker : UIxComponent -@end - -#endif /* UIXCOLORPICKER_H */ diff --git a/UI/Scheduler/UIxColorPicker.m b/UI/Scheduler/UIxColorPicker.m deleted file mode 100644 index bda17c45b..000000000 --- a/UI/Scheduler/UIxColorPicker.m +++ /dev/null @@ -1,29 +0,0 @@ -/* UIxColorPicker.m - this file is part of SOGo - * - * Copyright (C) 2008 Inverse inc. - * - * Author: Wolfgang Sourdeau - * - * 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 - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This file is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#import "UIxColorPicker.h" - -#warning this module should probably be moved into a "Utility" product - -@implementation UIxColorPicker - -@end diff --git a/UI/Scheduler/product.plist b/UI/Scheduler/product.plist index df8ad4852..3c3af6be9 100644 --- a/UI/Scheduler/product.plist +++ b/UI/Scheduler/product.plist @@ -131,10 +131,6 @@ protectedBy = "View"; pageName = "UIxReminderEditor"; }; - colorPicker = { - protectedBy = "View"; - pageName = "UIxColorPicker"; - }; }; }; diff --git a/UI/Templates/MailerUI/UIxMailMainFrame.wox b/UI/Templates/MailerUI/UIxMailMainFrame.wox index 858156769..f79b9755f 100644 --- a/UI/Templates/MailerUI/UIxMailMainFrame.wox +++ b/UI/Templates/MailerUI/UIxMailMainFrame.wox @@ -16,6 +16,16 @@ var unseenCountFolders = ;