diff --git a/NEWS b/NEWS index e0b7f1a4b..6d914acaf 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,10 @@ 3.0.2 (2016-02-DD) ------------------ +New features + - [web] show all/only this calendar + - [web] convert a message to an appointment or a task (#1722) + Enhancements - [web] added Junk handling feature from v2 - [web] updated Material Icons font to version 2.1.3 @@ -8,7 +12,6 @@ Enhancements - [web] mail filters are now sortable - [web] now supports RFC6154 and NoInferiors IMAP flag - [web] improved confirm dialogs for deletions - - [web] show all/only this calendar - [web] allow resources to prevent invitations (#3410) Bug fixes diff --git a/SoObjects/Mailer/SOGoMailObject+Draft.m b/SoObjects/Mailer/SOGoMailObject+Draft.m index 1aa24ea5b..26b39f881 100644 --- a/SoObjects/Mailer/SOGoMailObject+Draft.m +++ b/SoObjects/Mailer/SOGoMailObject+Draft.m @@ -167,8 +167,7 @@ NSMutableArray *keys; NSArray *acceptedTypes; - acceptedTypes - = [NSArray arrayWithObjects: @"text/plain", @"text/html", nil]; + acceptedTypes = [NSArray arrayWithObjects: @"text/plain", @"text/html", nil]; keys = [NSMutableArray array]; [self addRequiredKeysOfStructure: [self bodyStructure] path: @"" toArray: keys acceptedTypes: acceptedTypes diff --git a/UI/MailerUI/English.lproj/Localizable.strings b/UI/MailerUI/English.lproj/Localizable.strings index 56f3070c7..b98565fb2 100644 --- a/UI/MailerUI/English.lproj/Localizable.strings +++ b/UI/MailerUI/English.lproj/Localizable.strings @@ -187,6 +187,13 @@ "Save As..." = "Save As..."; "Print Preview" = "Print Preview"; "View Message Source" = "View Message Source"; + +/* Message view "more" menu: create an event from message */ +"Convert To Event" = "Convert To Event"; + +/* Message view "more" menu: create a task from message */ +"Convert To Task" = "Convert To Task"; + "Print..." = "Print..."; "Delete Message" = "Delete Message"; "Delete Selected Messages" = "Delete Selected Messages"; diff --git a/UI/MailerUI/UIxMailActions.m b/UI/MailerUI/UIxMailActions.m index 0f60f64d8..1766c9d70 100644 --- a/UI/MailerUI/UIxMailActions.m +++ b/UI/MailerUI/UIxMailActions.m @@ -1,6 +1,6 @@ /* UIxMailActions.m - this file is part of SOGo * - * Copyright (C) 2007-2014 Inverse inc. + * Copyright (C) 2007-2016 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 @@ -29,10 +29,13 @@ #import #import +#import #import #import #import #import +#import +#import #import #import #import @@ -121,6 +124,61 @@ andString: [data jsonRepresentation]]; } +- (WOResponse *) viewPlainAction +{ + BOOL htmlContent; + NSArray *acceptedTypes, *types; + NSDictionary *parts; + NSMutableArray *keys; + NSMutableDictionary *data; + NSString *rawPart, *contentKey, *subject, *content; + NSUInteger index; + SOGoMailObject *co; + + co = [self clientObject]; + subject = [co decodedSubject]; + htmlContent = NO; + data = [NSMutableDictionary dictionary]; + + if (subject) + [data setObject: subject + forKey: @"subject"]; + + // Fetch the text parts of the message body structure + acceptedTypes = [NSArray arrayWithObjects: @"text/plain", @"text/html", nil]; + keys = [NSMutableArray array]; + [co addRequiredKeysOfStructure: [co bodyStructure] + path: @"" toArray: keys acceptedTypes: acceptedTypes + withPeek: NO]; + + // Use plain part if available, otherwise use the HTML part + types = [keys objectsForKey: @"mimeType" notFoundMarker: @""]; + index = [types indexOfObject: @"text/plain"]; + if (index == NSNotFound) + { + index = [types indexOfObject: @"text/html"]; + htmlContent = YES; + } + + // Fetch part and convert HTML if necessary + contentKey = [keys objectAtIndex: index]; + parts = [co fetchPlainTextStrings: [NSArray arrayWithObject: contentKey]]; + if ([parts count] > 0) + { + rawPart = [[parts allValues] objectAtIndex: 0]; + if (htmlContent) + content = [rawPart htmlToText]; + else + content = rawPart; + if (content) + [data setObject: [content stringByTrimmingSpaces] + forKey: @"content"]; + } + + return [self responseWithStatus: 201 + andString: [data jsonRepresentation]]; +} + /* active message */ - (id) markMessageUnflaggedAction diff --git a/UI/MailerUI/product.plist b/UI/MailerUI/product.plist index 6b2b02130..ee9a004be 100644 --- a/UI/MailerUI/product.plist +++ b/UI/MailerUI/product.plist @@ -278,6 +278,11 @@ actionClass = "UIxMailActions"; actionName = "forward"; }; + viewplain = { + protectedBy = "View"; + actionClass = "UIxMailActions"; + actionName = "viewPlain"; + }; markMessageUncollapse = { protectedBy = "View"; actionClass = "UIxMailActions"; diff --git a/UI/Templates/MailerUI/UIxMailMainFrame.wox b/UI/Templates/MailerUI/UIxMailMainFrame.wox index 3d61ae5d0..ef8ecac4a 100644 --- a/UI/Templates/MailerUI/UIxMailMainFrame.wox +++ b/UI/Templates/MailerUI/UIxMailMainFrame.wox @@ -8,7 +8,7 @@ xmlns:label="OGo:label" className="UIxPageFrame" title="title" - const:jsFiles="Common.js, Preferences.services.js, Contacts.services.js, Mailer.js, Mailer.services.js, vendor/ckeditor/ckeditor.js, vendor/ckeditor/ck.js, vendor/angular-file-upload.min.js"> + const:jsFiles="Common.js, Preferences.services.js, Contacts.services.js, Scheduler.services.js, Mailer.js, Mailer.services.js, vendor/ckeditor/ckeditor.js, vendor/ckeditor/ck.js, vendor/angular-file-upload.min.js">