diff --git a/ChangeLog b/ChangeLog index 34f354f0f..6891016d3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,36 @@ +2011-12-05 Francis Lachapelle + + * UI/WebServerResources/MailerUI.js (deleteSelectedMessages) + (onMailboxTreeItemClick, onMessageSelecitionChange) + (configureMessageListEvents): update the message content div only + if it exists (will be hidden in single-window mode). + + * UI/WebServerResources/UIxContactsUserFolders.js + (initUserFoldersWindow): registered "click" event on new Done button. + + * UI/WebServerResources/UIxMailEditor.js (onContactAdd): show + contacts in a pane instead of a new window. + (onContactFolderChange): new method to update the contacts list + when changing contacts folder from the new popup menu. + (configureDragHandle): new method to allow the new contacts pane + to be resizable. + (onMailEditorResize): was onWindowResize. Now computes the space + used by the search contacts pane. + + * UI/WebServerResources/ContactsUI.js (getMenus): the function now + overloads the returning array with the menus defined by the + previously defined function with the same name. Used in + UIxMailEditor.wox that loads both MailerUI.js and ContactsUI.js. + (contactsListCallback): added support for 2-column view. Also + used in mail editor to refresh the new contacts pane. + (initContacts, onContactSelectionChange): don't update contactView when the div + doesn't exist. + (configureDraggables): don't allow drag'n'drop when the folders + list doesn't exist. + + * UI/MainUI/UIxLoading.m: new class for empty template used when + loading the iframe in single-window mode. + 2011-12-05 Wolfgang Sourdeau * UI/Scheduler/UIxComponentEditor.m (-setCategory): ensure that @@ -70,6 +103,18 @@ resulting string to @"" when the unicode or string pointers are NULL. +2011-11-28 Francis Lachapelle + + * UI/SOGoUI/UIxComponent.m (-singleWindowModeEnabled): new method + that returns true if the single-window mode is enabled. This mode + can be forced by setting the cookie "SOGoWindowMode" to "single". + + * UI/MailerUI/UIxMailEditor.m (-contactFolders) + (-personalContactInfos, -setCurrentFolder:, -currentContactFolderId) + (-currentContactFolderName, -currentContactFolderOwner) + (-currentContactFolderClass): getters/setters for new contacts + pane in the mail editor. + 2011-11-28 Wolfgang Sourdeau * OpenChange/MAPIStoreContext.m diff --git a/NEWS b/NEWS index d59c2923b..0e36006d0 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,19 @@ +1.3-201112DD (1.3.11) +--------------------- +New Features + - new experimental feature to force popup windows to appear in an iframe -- this mode + can be forced by setting the cookie "SOGoWindowMode" to "single" + +Enhancements + - contacts from the email editor now appear in a pane, like in Thunderbird + - added DanishDenmark translation - thanks to Altibox + - updated German translation + - updated SpanishArgentina translation + - updated SpanishSpain translation + +Bug Fixes + - + 1.3-20111130 (1.3.10) --------------------- New Features diff --git a/SoObjects/SOGo/SOGoUserFolder.h b/SoObjects/SOGo/SOGoUserFolder.h index a51c326f7..2cb02aa3e 100644 --- a/SoObjects/SOGo/SOGoUserFolder.h +++ b/SoObjects/SOGo/SOGoUserFolder.h @@ -39,6 +39,7 @@ @class NSDictionary; @class NSString; @class WOContext; +@class SOGoContactFolders; @interface SOGoUserFolder : SOGoFolder @@ -58,6 +59,9 @@ - (BOOL) collectionDavKey: (NSString *) key matches: (NSString *) value; +- (SOGoContactFolders *) privateContacts: (NSString *) _key + inContext: (WOContext *) _ctx; + @end #endif /* __SOGo_SOGoUserFolder_H__ */ diff --git a/UI/MailerUI/Toolbars/SOGoDraftObject.toolbar b/UI/MailerUI/Toolbars/SOGoDraftObject.toolbar index 9a677f406..c4c1020ad 100644 --- a/UI/MailerUI/Toolbars/SOGoDraftObject.toolbar +++ b/UI/MailerUI/Toolbars/SOGoDraftObject.toolbar @@ -10,7 +10,7 @@ ), ( { link = "#"; - onclick = "return onContactAdd(null);"; + onclick = "return onContactAdd(this);"; image = "tb-compose-contacts-flat-24x24.png"; cssClass = "tbicon_addressbook"; label = "Contacts"; @@ -35,5 +35,12 @@ image = "options.png"; cssClass = "tbicon_options"; label = "Options"; } + ), + ( + { link = "#"; + isSafe = NO; + onclick = "return onCloseButtonClick(event);"; + label = "Close"; + image = "tb-mail-stop-flat-24x24.png"; } ) ) diff --git a/UI/MailerUI/Toolbars/SOGoMailFolder.toolbar b/UI/MailerUI/Toolbars/SOGoMailFolder.toolbar new file mode 100644 index 000000000..a84c9780c --- /dev/null +++ b/UI/MailerUI/Toolbars/SOGoMailFolder.toolbar @@ -0,0 +1,67 @@ +( /* the toolbar groups -*-cperl-*- */ + + ( // first group + { link = "#"; + image = "tb-mail-getmail-flat-24x24.png"; + cssClass = "tbicon_getmail"; + label = "Get Mail"; + onclick = "return refreshMailbox(this);"; + tooltip = "Get new messages"; }, + { link = "#"; + isSafe = NO; + image = "tb-mail-write-flat-24x24.png"; + onclick = "return onComposeMessage();"; + cssClass = "tbicon_compose"; + label = "Write"; + tooltip = "Create a new message"; }, + ), + + ( // second group + { link = "#"; + onclick = "return openMessageWindowsForSelection('reply');"; + isSafe = NO; + image = "tb-mail-reply-flat-24x24.png"; + cssClass = "tbicon_reply"; + label = "Reply"; + tooltip = "Reply to the message"; }, + { link = "#"; + onclick = "return openMessageWindowsForSelection('replyall');"; + isSafe = NO; + image = "tb-mail-replyall-flat-24x24.png"; + cssClass = "tbicon_replyall"; + label = "Reply All"; + tooltip = "Reply to sender and all recipients"; }, + { link = "#"; + onclick = "return openMessageWindowsForSelection('forward');"; + isSafe = NO; + image = "tb-mail-forward-flat-24x24.png"; + cssClass = "tbicon_forward"; + label = "Forward"; + tooltip = "Forward selected message"; }, + ), + + ( // third group + { link = "#"; + isSafe = NO; + onclick = "onMenuDeleteMessage(event);"; +// enabled = showMarkDeletedButton; + image = "tb-mail-delete-flat-24x24.png"; + cssClass = "tbicon_delete"; + label = "Delete"; + tooltip = "Delete selected message or folder"; }, +// { link = "#"; +// isSafe = NO; +// image = "tb-mail-junk-flat-24x24.png"; +// cssClass = "tbicon_junk"; +// label = "Junk"; +// tooltip = "Mark the selected messages as junk"; }, + ), + ( + { link = "#"; + onclick = "return onPrintCurrentMessage(event);"; + cssClass = "tbicon_print"; + image = "tb-mail-print-flat-24x24.png"; + label = "Print"; + tooltip = "Print this message"; }, + ) +) diff --git a/UI/MailerUI/Toolbars/SOGoMailObject.toolbar b/UI/MailerUI/Toolbars/SOGoMailObject.toolbar index f17c464a6..727c6e8eb 100644 --- a/UI/MailerUI/Toolbars/SOGoMailObject.toolbar +++ b/UI/MailerUI/Toolbars/SOGoMailObject.toolbar @@ -1,29 +1,6 @@ ( /* the toolbar groups -*-cperl-*- */ - ( /* first group */ - { link = "#"; - image = "tb-mail-getmail-flat-24x24.png"; - cssClass = "tbicon_getmail"; - label = "Get Mail"; - onclick = "return refreshMailbox(this);"; - tooltip = "Get new messages"; }, - { link = "#"; - isSafe = NO; - image = "tb-mail-write-flat-24x24.png"; - onclick = "return onComposeMessage();"; - cssClass = "tbicon_compose"; - label = "Write"; - tooltip = "Create a new message"; }, - { link = "#"; - target = "addressbook"; - onclick = "openAddressbook(this);return false;"; - image = "tb-mail-addressbook-flat-24x24.png"; - cssClass = "tbicon_addressbook"; - label = "Addressbook"; - tooltip = "Go to address book"; }, - ), - - ( // second group + ( // first group { link = "#"; onclick = "return openMessageWindowsForSelection('reply');"; isSafe = NO; @@ -47,7 +24,7 @@ tooltip = "Forward selected message"; }, ), - ( // third group + ( // second group { link = "#"; isSafe = NO; onclick = "onMenuDeleteMessage(event);"; @@ -71,4 +48,11 @@ label = "Print"; tooltip = "Print this message"; }, ), + ( + { link = "#"; + isSafe = NO; + onclick = "return onCloseButtonClick(event);"; + label = "Close"; + image = "tb-mail-stop-flat-24x24.png"; } + ) ) diff --git a/UI/MailerUI/UIxMailEditor.m b/UI/MailerUI/UIxMailEditor.m index 66c8dd0fa..26fafd12b 100644 --- a/UI/MailerUI/UIxMailEditor.m +++ b/UI/MailerUI/UIxMailEditor.m @@ -1,6 +1,6 @@ /* Copyright (C) 2004-2005 SKYRIX Software AG - Copyright (C) 2008-2010 Inverse inc. + Copyright (C) 2008-2011 Inverse inc. This file is part of SOGo. @@ -47,15 +47,19 @@ #import #import -#import -#import -#import -#import #import +#import #import #import #import #import +#import +#import +#import +#import +#import +#import +#import /* UIxMailEditor @@ -80,6 +84,7 @@ NSString *priority; NSString *receipt; id item; + id currentFolder; /* these are for the inline attachment list */ NSString *attachmentName; @@ -108,6 +113,7 @@ static NSArray *infoKeys = nil; { priority = @"NORMAL"; receipt = nil; + currentFolder = nil; } return self; @@ -131,6 +137,7 @@ static NSArray *infoKeys = nil; [attachmentName release]; [attachmentNames release]; [attachedFiles release]; + [currentFolder release]; [super dealloc]; } @@ -386,6 +393,61 @@ static NSArray *infoKeys = nil; return [self valuesForKeys:infoKeys]; } +/* contacts search */ +- (NSArray *) contactFolders +{ + SOGoContactFolders *folderContainer; + + folderContainer = (SOGoContactFolders *) [[[self clientObject] lookupUserFolder] privateContacts: @"Contacts" + inContext: nil]; + + return [folderContainer subFolders]; +} + +- (NSArray *) personalContactInfos +{ + SOGoContactFolders *folderContainer; + id folder; + NSArray *contactInfos; + + folderContainer = (SOGoContactFolders *) [[[self clientObject] lookupUserFolder] privateContacts: @"Contacts" + inContext: nil]; + folder = [folderContainer lookupPersonalFolder: @"personal" ignoringRights: YES]; + + contactInfos = [folder lookupContactsWithFilter: nil + onCriteria: nil + sortBy: @"c_cn" + ordering: NSOrderedAscending]; + + return contactInfos; +} + +- (void) setCurrentFolder: (id) _currentFolder +{ + ASSIGN (currentFolder, _currentFolder); +} + +- (NSString *) currentContactFolderId +{ + return [NSString stringWithFormat: @"/%@", [currentFolder nameInContainer]]; +} + +- (NSString *) currentContactFolderName +{ + return [currentFolder displayName]; +} + +- (NSString *) currentContactFolderOwner +{ + return [currentFolder ownerInContext: context]; +} + +- (NSString *) currentContactFolderClass +{ + return ([currentFolder isKindOfClass: [SOGoContactSourceFolder class]] + ? @"remote" : @"local"); +} + /* requests */ - (BOOL) shouldTakeValuesFromRequest: (WORequest *) request diff --git a/UI/MailerUI/product.plist b/UI/MailerUI/product.plist index a35b3ecdb..49941d90b 100644 --- a/UI/MailerUI/product.plist +++ b/UI/MailerUI/product.plist @@ -73,7 +73,7 @@ slots = { toolbar = { protectedBy = "View"; - value = "SOGoMailObject.toolbar"; + value = "SOGoMailFolder.toolbar"; }; }; methods = { @@ -184,7 +184,7 @@ slots = { toolbar = { protectedBy = "View"; - value = "SOGoMailObject.toolbar"; + value = "SOGoMailFolder.toolbar"; }; }; methods = { @@ -329,7 +329,7 @@ slots = { toolbar = { protectedBy = "View"; - value = "SOGoMailObject.toolbar"; + value = "SOGoMailFolder.toolbar"; }; }; methods = { @@ -369,7 +369,7 @@ slots = { toolbar = { protectedBy = "View"; - value = "SOGoMailObject.toolbar"; + value = "SOGoMailFolder.toolbar"; }; }; methods = { diff --git a/UI/MainUI/UIxLoading.h b/UI/MainUI/UIxLoading.h new file mode 100644 index 000000000..092603644 --- /dev/null +++ b/UI/MainUI/UIxLoading.h @@ -0,0 +1,35 @@ +/* UIxLoading.h - this file is part of SOGo + * + * Copyright (C) 2011 Inverse inc. + * + * Author: Francis Lachapelle + * + * 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 UIXLOADING_H +#define UIXLOADING_H + +#import + + +@interface UIxLoading : UIxComponent +{ +} + +@end + +#endif /* UIXLOADING_H */ diff --git a/UI/MainUI/UIxLoading.m b/UI/MainUI/UIxLoading.m new file mode 100644 index 000000000..6647658d1 --- /dev/null +++ b/UI/MainUI/UIxLoading.m @@ -0,0 +1,37 @@ +/* UIxLoading.m - this file is part of SOGo + * + * Copyright (C) 2011 Inverse inc. + * + * Author: Francis Lachapelle + * + * 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 + +#import "UIxLoading.h" + +@implementation UIxLoading + +- (NSString *) doctype +{ + return (@"\n" + @""); +} + +@end diff --git a/UI/MainUI/product.plist b/UI/MainUI/product.plist index e5942c8bb..212429a0c 100644 --- a/UI/MainUI/product.plist +++ b/UI/MainUI/product.plist @@ -144,6 +144,10 @@ pageName = "SOGoRootPage"; actionName = "changePassword"; }; + loading = { + protectedBy = ""; + pageName = "UIxLoading"; + }; GET = { // more or less a hack, see README of dbd protectedBy = ""; pageName = "SOGoRootPage"; diff --git a/UI/PreferencesUI/Toolbars/UIxPreferences.toolbar b/UI/PreferencesUI/Toolbars/UIxPreferences.toolbar index b30200e85..09b0c9d8d 100644 --- a/UI/PreferencesUI/Toolbars/UIxPreferences.toolbar +++ b/UI/PreferencesUI/Toolbars/UIxPreferences.toolbar @@ -6,7 +6,7 @@ { link = "#"; isSafe = NO; label = "Close"; - onclick = "window.close(); return false;"; + onclick = "return onCloseButtonClick();"; image = "tb-mail-stop-flat-24x24.png"; } ) ) diff --git a/UI/SOGoUI/UIxComponent.m b/UI/SOGoUI/UIxComponent.m index 86a105f7d..473d2bf9a 100644 --- a/UI/SOGoUI/UIxComponent.m +++ b/UI/SOGoUI/UIxComponent.m @@ -447,6 +447,24 @@ static NSMutableArray *abbrMonthLabelKeys = nil; inContext: context]); } +- (BOOL) singleWindowModeEnabled +{ + //WEClientCapabilities *cc; + NSString *value; + BOOL result; + + //cc = [[context request] clientCapabilities]; + + //NSLog(@"User agent = %@, Type = %@, OS = %@, CPU = %@, Browser major version = %i", [cc userAgent], [cc userAgentType], [cc os], [cc cpu], [cc majorVersion]); + + value = [[context request] cookieValueForKey: @"SOGoWindowMode"]; + result = ([value isEqualToString: @"single"]); + + NSLog(@"Single window mode %@", result?@"enabled":@"disabled"); + + return result; +} + /* SoUser */ - (NSString *) shortUserNameForDisplay diff --git a/UI/Templates/ContactsUI/UIxContactsUserFolders.wox b/UI/Templates/ContactsUI/UIxContactsUserFolders.wox index fe5bb2dc2..5b34b2f37 100644 --- a/UI/Templates/ContactsUI/UIxContactsUserFolders.wox +++ b/UI/Templates/ContactsUI/UIxContactsUserFolders.wox @@ -17,5 +17,7 @@ diff --git a/UI/Templates/MailerUI/UIxMailEditor.wox b/UI/Templates/MailerUI/UIxMailEditor.wox index 15abf5513..2658ddfef 100644 --- a/UI/Templates/MailerUI/UIxMailEditor.wox +++ b/UI/Templates/MailerUI/UIxMailEditor.wox @@ -11,7 +11,7 @@ title="panelTitle" const:popup="YES" const:userDefaultsKeys="SOGoMailComposeMessageType,SOGoMailReplyPlacement,SOGoMailSignature" - const:jsFiles="UIxMailToSelection.js,ckeditor/ckeditor.js,SOGoAutoCompletion.js"> + const:jsFiles="UIxMailToSelection.js,ckeditor/ckeditor.js,SOGoAutoCompletion.js,ContactsUI.js"> + + diff --git a/UI/Templates/UIxLoading.wox b/UI/Templates/UIxLoading.wox new file mode 100644 index 000000000..ec27811c7 --- /dev/null +++ b/UI/Templates/UIxLoading.wox @@ -0,0 +1,21 @@ + + + + + + + + +
+ + +
diff --git a/UI/Templates/UIxPageFrame.wox b/UI/Templates/UIxPageFrame.wox index a8dc5beb3..2943db290 100644 --- a/UI/Templates/UIxPageFrame.wox +++ b/UI/Templates/UIxPageFrame.wox @@ -42,7 +42,9 @@