From 6876ba8709f6c9022af0a7e1bb3358745151a8f6 Mon Sep 17 00:00:00 2001 From: Ludovic Marcotte Date: Wed, 10 Feb 2016 13:47:17 -0500 Subject: [PATCH 01/29] (feat) show all/only this calendar --- NEWS | 1 + UI/Scheduler/English.lproj/Localizable.strings | 7 +++++++ UI/Templates/SchedulerUI/UIxCalMainView.wox | 11 +++++++++++ .../js/Scheduler/CalendarsController.js | 15 +++++++++++++++ 4 files changed, 34 insertions(+) diff --git a/NEWS b/NEWS index 591d70832..54b0ce42e 100644 --- a/NEWS +++ b/NEWS @@ -8,6 +8,7 @@ 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 Bug fixes - [web] handle birthday dates before 1970 diff --git a/UI/Scheduler/English.lproj/Localizable.strings b/UI/Scheduler/English.lproj/Localizable.strings index 12d24630e..717bf5e37 100644 --- a/UI/Scheduler/English.lproj/Localizable.strings +++ b/UI/Scheduler/English.lproj/Localizable.strings @@ -437,6 +437,13 @@ vtodo_class2 = "(Confidential task)"; "When I modify my calendar, send a mail to" = "When I modify my calendar, send a mail to"; "Email Address" = "Email Address"; "Export" = "Export"; + +/* Show only the calendar for which the menu is displayed */ +"Show Only This Calendar" = Show Only This Calendar"; + +/* Show all calendar (personal, subscriptions and web) */ +"Show All Calendars" = "Show All Calendars"; + "Links to this Calendar" = "Links to this Calendar"; "Authenticated User Access" = "Authenticated User Access"; "CalDAV URL" = "CalDAV URL "; diff --git a/UI/Templates/SchedulerUI/UIxCalMainView.wox b/UI/Templates/SchedulerUI/UIxCalMainView.wox index 2b5e3d3b7..d448c3d4e 100644 --- a/UI/Templates/SchedulerUI/UIxCalMainView.wox +++ b/UI/Templates/SchedulerUI/UIxCalMainView.wox @@ -188,6 +188,17 @@ + + + + + + + + + + + diff --git a/UI/WebServerResources/js/Scheduler/CalendarsController.js b/UI/WebServerResources/js/Scheduler/CalendarsController.js index b8349e469..f91a246b7 100644 --- a/UI/WebServerResources/js/Scheduler/CalendarsController.js +++ b/UI/WebServerResources/js/Scheduler/CalendarsController.js @@ -21,6 +21,8 @@ vm.share = share; vm.importCalendar = importCalendar; vm.exportCalendar = exportCalendar; + vm.showOnly = showOnly; + vm.showAll = showAll; vm.showLinks = showLinks; vm.showProperties = showProperties; vm.subscribeToFolder = subscribeToFolder; @@ -202,6 +204,19 @@ window.location.href = ApplicationBaseURL + '/' + calendar.id + '.ics' + '/export'; } + function showOnly(calendar) { + _.forEach(Calendar.$findAll(), function(o) { + if (calendar.id == o.id) + o.active = 1; + else + o.active = 0; + }); + } + + function showAll() { + _.forEach(Calendar.$findAll(), function(o) { o.active = 1; }); + } + function showLinks(calendar) { $mdDialog.show({ parent: angular.element(document.body), From e6d1cb9231e525e4bfe10a76932ec0d15261a76d Mon Sep 17 00:00:00 2001 From: Ludovic Marcotte Date: Wed, 10 Feb 2016 14:29:13 -0500 Subject: [PATCH 02/29] Fixed file. --- UI/Scheduler/English.lproj/Localizable.strings | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UI/Scheduler/English.lproj/Localizable.strings b/UI/Scheduler/English.lproj/Localizable.strings index 717bf5e37..e26b95849 100644 --- a/UI/Scheduler/English.lproj/Localizable.strings +++ b/UI/Scheduler/English.lproj/Localizable.strings @@ -439,7 +439,7 @@ vtodo_class2 = "(Confidential task)"; "Export" = "Export"; /* Show only the calendar for which the menu is displayed */ -"Show Only This Calendar" = Show Only This Calendar"; +"Show Only This Calendar" = "Show Only This Calendar"; /* Show all calendar (personal, subscriptions and web) */ "Show All Calendars" = "Show All Calendars"; From 8c99fdc99a410d43845afb6c461730b3794cd679 Mon Sep 17 00:00:00 2001 From: Ludovic Marcotte Date: Wed, 10 Feb 2016 15:03:20 -0500 Subject: [PATCH 03/29] (fix) allow resources to prevent invitations (fixes #3410) --- SoObjects/Appointments/SOGoAppointmentObject.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SoObjects/Appointments/SOGoAppointmentObject.m b/SoObjects/Appointments/SOGoAppointmentObject.m index 41b8eb108..064674356 100644 --- a/SoObjects/Appointments/SOGoAppointmentObject.m +++ b/SoObjects/Appointments/SOGoAppointmentObject.m @@ -433,7 +433,7 @@ i = count = 0; - // Build list of the attendees uids without ressources + // Build list of the attendees uids unavailableAttendees = [[NSMutableArray alloc] init]; enumerator = [theAttendees objectEnumerator]; ownerUID = [[[self context] activeUser] login]; @@ -449,7 +449,7 @@ moduleSettings = [us objectForKey:@"Calendar"]; // Check if the user prevented their account from beeing invited to events - if (![user isResource] && [[moduleSettings objectForKey:@"PreventInvitations"] boolValue]) + if ([[moduleSettings objectForKey:@"PreventInvitations"] boolValue]) { // Check if the user have a whiteList whiteList = [moduleSettings objectForKey:@"PreventInvitationsWhitelist"]; From fec263a3d6a9529a0f23fb5e463201b364100b5c Mon Sep 17 00:00:00 2001 From: Ludovic Marcotte Date: Wed, 10 Feb 2016 15:06:38 -0500 Subject: [PATCH 04/29] Updated NEWS file regarding previous commit. --- NEWS | 1 + 1 file changed, 1 insertion(+) diff --git a/NEWS b/NEWS index 54b0ce42e..e0b7f1a4b 100644 --- a/NEWS +++ b/NEWS @@ -9,6 +9,7 @@ Enhancements - [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 - [web] handle birthday dates before 1970 From 99e5c1b93cd453552c2e9df1a3e4ace8362bc29f Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Wed, 10 Feb 2016 16:15:00 -0500 Subject: [PATCH 05/29] (feature) Convert a message to an event or task Resolves #1722 --- NEWS | 5 +- SoObjects/Mailer/SOGoMailObject+Draft.m | 3 +- UI/MailerUI/English.lproj/Localizable.strings | 7 +++ UI/MailerUI/UIxMailActions.m | 60 +++++++++++++++++- UI/MailerUI/product.plist | 5 ++ UI/Templates/MailerUI/UIxMailMainFrame.wox | 5 +- UI/Templates/MailerUI/UIxMailViewTemplate.wox | 13 ++++ UI/WebServerResources/Gruntfile.js | 4 +- UI/WebServerResources/js/Common/utils.js | 6 +- UI/WebServerResources/js/Mailer/Mailer.app.js | 2 +- .../js/Mailer/Message.service.js | 9 +++ .../js/Mailer/MessageController.js | 45 ++++++++++++- .../js/Scheduler/Calendar.service.js | 8 +++ .../js/Scheduler/Component.service.js | 63 ++++++++++--------- 14 files changed, 192 insertions(+), 43 deletions(-) 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">