From 990f782b627ed956755b727ef3b043d5d66cb14c Mon Sep 17 00:00:00 2001 From: Ludovic Marcotte Date: Thu, 11 Dec 2014 10:01:21 -0500 Subject: [PATCH 01/27] Allow including or not freebusy info from subscribed calendars --- NEWS | 6 ++++++ SoObjects/Appointments/SOGoAppointmentFolder.m | 17 +++++++++++++++-- SoObjects/Appointments/SOGoFreeBusyObject.h | 3 +-- SoObjects/Appointments/SOGoFreeBusyObject.m | 5 ++--- UI/Scheduler/UIxCalendarProperties.h | 5 +---- UI/Scheduler/UIxCalendarProperties.m | 14 +------------- .../SchedulerUI/UIxCalendarProperties.wox | 6 ++---- 7 files changed, 28 insertions(+), 28 deletions(-) diff --git a/NEWS b/NEWS index 2b9d9616b..06c0efc12 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,9 @@ +2.2.12 (2014-12-xx) +------------------- + +New features + - Allow including or not freebusy info from subscribed calendars + 2.2.11a (2014-12-10) -------------------- diff --git a/SoObjects/Appointments/SOGoAppointmentFolder.m b/SoObjects/Appointments/SOGoAppointmentFolder.m index 0b5399107..75d02ea5b 100644 --- a/SoObjects/Appointments/SOGoAppointmentFolder.m +++ b/SoObjects/Appointments/SOGoAppointmentFolder.m @@ -487,15 +487,28 @@ static Class iCalEventK = nil; inCategory: @"FolderSynchronize"]; } +// +// If the user is the owner of the calendar, by default we include the freebusy information. +// +// If the user is NOT the owner of the calendar, by default we exclude the freebusy information. +// - (BOOL) includeInFreeBusy { NSNumber *excludeFromFreeBusy; - + NSString *userLogin; + BOOL is_owner; + + userLogin = [[context activeUser] login]; + is_owner = [userLogin isEqualToString: [self ownerInContext: context]]; + // Check if the owner (not the active user) has excluded the calendar from her/his free busy data. excludeFromFreeBusy = [self folderPropertyValueInCategory: @"FreeBusyExclusions" - forUser: [SOGoUser userWithLogin: [self ownerInContext: context]]]; + forUser: [SOGoUser userWithLogin: userLogin]]; + if (!excludeFromFreeBusy && !is_owner) + return NO; + return ![excludeFromFreeBusy boolValue]; } diff --git a/SoObjects/Appointments/SOGoFreeBusyObject.h b/SoObjects/Appointments/SOGoFreeBusyObject.h index 77b2f53ec..17f56dd51 100644 --- a/SoObjects/Appointments/SOGoFreeBusyObject.h +++ b/SoObjects/Appointments/SOGoFreeBusyObject.h @@ -1,6 +1,5 @@ /* - Copyright (C) 2007-2012 Inverse inc. - Copyright (C) 2000-2004 SKYRIX Software AG + Copyright (C) 2007-2014 Inverse inc. This file is part of SOGo diff --git a/SoObjects/Appointments/SOGoFreeBusyObject.m b/SoObjects/Appointments/SOGoFreeBusyObject.m index 18f08e10b..6624a2cfe 100644 --- a/SoObjects/Appointments/SOGoFreeBusyObject.m +++ b/SoObjects/Appointments/SOGoFreeBusyObject.m @@ -1,6 +1,5 @@ /* - Copyright (C) 2007-2012 Inverse inc. - Copyright (C) 2000-2004 SKYRIX Software AG + Copyright (C) 2007-2014 Inverse inc. This file is part of SOGo @@ -339,7 +338,7 @@ for (count = 0; count < max; count++) { calFolder = [folders objectAtIndex: count]; - if (![calFolder isSubscription] && [calFolder includeInFreeBusy]) + if ([calFolder includeInFreeBusy]) [infos addObjectsFromArray: [calFolder fetchFreeBusyInfosFrom: startDate to: endDate]]; } diff --git a/UI/Scheduler/UIxCalendarProperties.h b/UI/Scheduler/UIxCalendarProperties.h index 157653dc2..de17b6117 100644 --- a/UI/Scheduler/UIxCalendarProperties.h +++ b/UI/Scheduler/UIxCalendarProperties.h @@ -1,9 +1,6 @@ /* UIxCalendarProperties.m - this file is part of SOGo * - * Copyright (C) 2008-2012 Inverse inc. - * - * Author: Wolfgang Sourdeau - * Ludovic Marcotte + * Copyright (C) 2008-2014 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/Scheduler/UIxCalendarProperties.m b/UI/Scheduler/UIxCalendarProperties.m index 3817ad48d..8f0ec4e81 100644 --- a/UI/Scheduler/UIxCalendarProperties.m +++ b/UI/Scheduler/UIxCalendarProperties.m @@ -1,9 +1,6 @@ /* UIxCalendarProperties.m - this file is part of SOGo * - * Copyright (C) 2008-2012 Inverse inc. - * - * Author: Wolfgang Sourdeau - * Ludovic Marcotte + * Copyright (C) 2008-2014 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 @@ -181,15 +178,6 @@ [calendar setShowCalendarTasks: new]; } -- (BOOL) userIsOwner -{ - NSString *userLogin; - - userLogin = [[context activeUser] login]; - - return ([userLogin isEqualToString: [calendar ownerInContext: context]]); -} - - (BOOL) isPublicAccessEnabled { // NOTE: This method is the same found in Common/UIxAclEditor.m diff --git a/UI/Templates/SchedulerUI/UIxCalendarProperties.wox b/UI/Templates/SchedulerUI/UIxCalendarProperties.wox index 8451318e6..20772c200 100644 --- a/UI/Templates/SchedulerUI/UIxCalendarProperties.wox +++ b/UI/Templates/SchedulerUI/UIxCalendarProperties.wox @@ -113,16 +113,14 @@ >
-
+ >
From 9dd0d6c427a44f089cedef256899fed367899733 Mon Sep 17 00:00:00 2001 From: Ludovic Marcotte Date: Thu, 11 Dec 2014 13:31:32 -0500 Subject: [PATCH 02/27] Draft autossave feature --- NEWS | 1 + SoObjects/Mailer/SOGoDraftObject.m | 2 +- SoObjects/SOGo/SOGoDefaults.plist | 2 ++ SoObjects/SOGo/SOGoDomainDefaults.h | 4 +-- SoObjects/SOGo/SOGoDomainDefaults.m | 2 -- SoObjects/SOGo/SOGoUserDefaults.h | 5 ++- SoObjects/SOGo/SOGoUserDefaults.m | 21 +++++++++-- UI/MailerUI/UIxMailMainFrame.m | 2 +- .../English.lproj/Localizable.strings | 3 ++ UI/PreferencesUI/UIxPreferences.m | 10 ++++++ UI/Templates/MailerUI/UIxMailEditor.wox | 2 +- UI/Templates/PreferencesUI/UIxPreferences.wox | 3 ++ UI/WebServerResources/UIxMailEditor.js | 35 +++++++++++++++++-- 13 files changed, 78 insertions(+), 14 deletions(-) diff --git a/NEWS b/NEWS index 06c0efc12..fe792274a 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,7 @@ New features - Allow including or not freebusy info from subscribed calendars + - Now possible to set an autosave timer for draft messages 2.2.11a (2014-12-10) -------------------- diff --git a/SoObjects/Mailer/SOGoDraftObject.m b/SoObjects/Mailer/SOGoDraftObject.m index 24b84e8bd..c70e56c09 100644 --- a/SoObjects/Mailer/SOGoDraftObject.m +++ b/SoObjects/Mailer/SOGoDraftObject.m @@ -629,7 +629,7 @@ static NSString *userAgent = nil; folder = [imap4 imap4FolderNameForURL: [container imap4URL]]; result = [client append: message toFolder: folder - withFlags: [NSArray arrayWithObjects: @"seen", @"draft", nil]]; + withFlags: [NSArray arrayWithObjects: @"draft", nil]]; if ([[result objectForKey: @"result"] boolValue]) { if (IMAP4ID > -1) diff --git a/SoObjects/SOGo/SOGoDefaults.plist b/SoObjects/SOGo/SOGoDefaults.plist index 17388f261..d0d230c43 100644 --- a/SoObjects/SOGo/SOGoDefaults.plist +++ b/SoObjects/SOGo/SOGoDefaults.plist @@ -68,6 +68,8 @@ SOGoDraftsFolderName = "Drafts"; SOGoTrashFolderName = "Trash"; + SOGoMailAutoSave = "5"; + SOGoCalendarDefaultCategoryColor = "#aaa"; SOGoCalendarShouldDisplayWeekend = YES; SOGoCalendarEventsDefaultClassification = "PUBLIC"; diff --git a/SoObjects/SOGo/SOGoDomainDefaults.h b/SoObjects/SOGo/SOGoDomainDefaults.h index 00a79cfe9..4743917af 100644 --- a/SoObjects/SOGo/SOGoDomainDefaults.h +++ b/SoObjects/SOGo/SOGoDomainDefaults.h @@ -1,8 +1,6 @@ /* SOGoDomainDefaults.h - this file is part of SOGo * - * Copyright (C) 2009-2013 Inverse inc. - * - * Author: Wolfgang Sourdeau + * Copyright (C) 2009-2014 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/SOGoDomainDefaults.m b/SoObjects/SOGo/SOGoDomainDefaults.m index 1a577c3f6..35a078b3f 100644 --- a/SoObjects/SOGo/SOGoDomainDefaults.m +++ b/SoObjects/SOGo/SOGoDomainDefaults.m @@ -2,8 +2,6 @@ * * Copyright (C) 2009-2014 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) diff --git a/SoObjects/SOGo/SOGoUserDefaults.h b/SoObjects/SOGo/SOGoUserDefaults.h index 4cb893b8d..66dbcf5fb 100644 --- a/SoObjects/SOGo/SOGoUserDefaults.h +++ b/SoObjects/SOGo/SOGoUserDefaults.h @@ -1,6 +1,6 @@ /* SOGoUserDefaults.h - this file is part of SOGo * - * Copyright (C) 2011-2013 Inverse inc. + * Copyright (C) 2011-2014 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 @@ -126,6 +126,9 @@ extern NSString *SOGoWeekStartFirstFullWeek; - (void) setMailDisplayRemoteInlineImages: (NSString *) newValue; - (NSString *) mailDisplayRemoteInlineImages; +- (void) setMailAutoSave: (NSString *) newValue; +- (NSString *) mailAutoSave; + - (void) setMailMessageForwarding: (NSString *) newValue; - (NSString *) mailMessageForwarding; diff --git a/SoObjects/SOGo/SOGoUserDefaults.m b/SoObjects/SOGo/SOGoUserDefaults.m index 031a3283a..5d975f146 100644 --- a/SoObjects/SOGo/SOGoUserDefaults.m +++ b/SoObjects/SOGo/SOGoUserDefaults.m @@ -1,6 +1,6 @@ /* SOGoUserDefaults.m - this file is part of SOGo * - * Copyright (C) 2009-2013 Inverse inc. + * Copyright (C) 2009-2014 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 @@ -508,7 +508,7 @@ NSString *SOGoWeekStartFirstFullWeek = @"FirstFullWeek"; return [self stringForKey: @"SOGoMailComposeMessageType"]; } -- (void) setMailDisplayRemoteInlineImages: (NSString *) newValue; +- (void) setMailDisplayRemoteInlineImages: (NSString *) newValue { [self setObject: newValue forKey: @"SOGoMailDisplayRemoteInlineImages"]; } @@ -518,6 +518,23 @@ NSString *SOGoWeekStartFirstFullWeek = @"FirstFullWeek"; return [self stringForKey: @"SOGoMailDisplayRemoteInlineImages"]; } +- (void) setMailAutoSave: (NSString *) newValue +{ + [self setObject: newValue forKey: @"SOGoMailAutoSave"]; +} + +- (NSString *) mailAutoSave +{ + NSString *s; + + s = [self stringForKey: @"SOGoMailAutoSave"]; + + if ([s intValue] == 0) + s = @"5"; + + return s; +} + - (void) setMailMessageForwarding: (NSString *) newValue { [self setObject: newValue forKey: @"SOGoMailMessageForwarding"]; diff --git a/UI/MailerUI/UIxMailMainFrame.m b/UI/MailerUI/UIxMailMainFrame.m index d94f90aae..488449207 100644 --- a/UI/MailerUI/UIxMailMainFrame.m +++ b/UI/MailerUI/UIxMailMainFrame.m @@ -1,5 +1,5 @@ /* - Copyright (C) 2007-2013 Inverse inc. + Copyright (C) 2007-2014 Inverse inc. This file is part of SOGo. diff --git a/UI/PreferencesUI/English.lproj/Localizable.strings b/UI/PreferencesUI/English.lproj/Localizable.strings index ebc9ace4e..538bd3d9b 100644 --- a/UI/PreferencesUI/English.lproj/Localizable.strings +++ b/UI/PreferencesUI/English.lproj/Localizable.strings @@ -153,6 +153,9 @@ "displayremoteinlineimages_never" = "Never"; "displayremoteinlineimages_always" = "Always"; +"Auto save every" = "Auto save every"; +"minutes" = "minutes"; + /* Contact */ "Personal Address Book" = "Personal Address Book"; "Collected Address Book" = "Collected Address Book"; diff --git a/UI/PreferencesUI/UIxPreferences.m b/UI/PreferencesUI/UIxPreferences.m index 5017a4bec..a43a8e744 100644 --- a/UI/PreferencesUI/UIxPreferences.m +++ b/UI/PreferencesUI/UIxPreferences.m @@ -959,6 +959,16 @@ static NSArray *reminderValues = nil; [userDefaults setMailDisplayRemoteInlineImages: newType]; } +- (void) setAutoSave: (NSString *) theValue +{ + [userDefaults setMailAutoSave: theValue]; +} + +- (NSString *) autoSave +{ + return [userDefaults mailAutoSave]; +} + /* mail autoreply (vacation) */ - (BOOL) isSieveScriptsEnabled diff --git a/UI/Templates/MailerUI/UIxMailEditor.wox b/UI/Templates/MailerUI/UIxMailEditor.wox index ea18d9c4f..51a3e0afc 100644 --- a/UI/Templates/MailerUI/UIxMailEditor.wox +++ b/UI/Templates/MailerUI/UIxMailEditor.wox @@ -10,7 +10,7 @@ className="UIxPageFrame" title="panelTitle" const:popup="YES" - const:userDefaultsKeys="SOGoMailComposeMessageType,SOGoMailReplyPlacement,SOGoMailSignature" + const:userDefaultsKeys="SOGoMailComposeMessageType,SOGoMailReplyPlacement,SOGoMailSignature,SOGoMailAutoSave,SOGoDraftsFolderName" const:jsFiles="UIxMailToSelection.js,ckeditor/ckeditor.js,SOGoAutoCompletion.js,ContactsUI.js,jquery-ui.js,jquery.fileupload.js,jquery.iframe-transport.js" const:cssFiles="jquery.fileupload.css">