diff --git a/ChangeLog b/ChangeLog index e11c9b2ad..7d0addfb6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2009-06-29 Cyril Robert + + * UI/WebServerResources/ContactsUI.js: Added drag & drop support! + * UI/WebServerResources/ContactsUI.js: Disabled drag & drop for lists + +2009-06-26 Francis Lachapelle + + * UI/Contacts/UIxContactsListViewContainer.[hm]: this class was + removed along with the template and moved to UIxContactFoldersView. + 2009-06-26 Cyril Robert * UI/WebServerResources/UIxPreferences.js: Fixed a bug when diff --git a/UI/Contacts/GNUmakefile b/UI/Contacts/GNUmakefile index a3a5d26e0..d6e4c7f5f 100644 --- a/UI/Contacts/GNUmakefile +++ b/UI/Contacts/GNUmakefile @@ -20,7 +20,6 @@ ContactsUI_OBJC_FILES = \ UIxListView.m \ UIxListEditor.m \ UIxContactsListView.m \ - UIxContactsListViewContainer.m \ UIxContactFoldersView.m ContactsUI_RESOURCE_FILES += \ diff --git a/UI/Contacts/UIxContactFoldersView.h b/UI/Contacts/UIxContactFoldersView.h index b66ceaf08..064e71e6a 100644 --- a/UI/Contacts/UIxContactFoldersView.h +++ b/UI/Contacts/UIxContactFoldersView.h @@ -1,6 +1,6 @@ /* UIxContactFoldersView.h - this file is part of SOGo * - * Copyright (C) 2006 Inverse inc. + * Copyright (C) 2006-2009 Inverse inc. * * Author: Wolfgang Sourdeau * @@ -30,8 +30,16 @@ { NSUserDefaults *ud; NSMutableDictionary *moduleSettings; + id currentFolder; } +- (NSArray *) contactFolders; + +- (NSString *) currentContactFolderId; +- (NSString *) currentContactFolderOwner; +- (NSString *) currentContactFolderName; +- (NSString *) currentContactFolderClass; + - (WOResponse *) saveDragHandleStateAction; @end diff --git a/UI/Contacts/UIxContactFoldersView.m b/UI/Contacts/UIxContactFoldersView.m index a8d7f9247..e43179391 100644 --- a/UI/Contacts/UIxContactFoldersView.m +++ b/UI/Contacts/UIxContactFoldersView.m @@ -74,34 +74,6 @@ [ud setObject: moduleSettings forKey: module]; } -- (id) _selectActionForApplication: (NSString *) actionName -{ - SOGoContactFolders *folders; - NSString *url, *action; - WORequest *request; - - folders = [self clientObject]; - action = [NSString stringWithFormat: @"../personal/%@", actionName]; - - request = [[self context] request]; - - url = [[request uri] composeURLWithAction: action - parameters: [self queryParameters] - andHash: NO]; - - return [self redirectToLocation: url]; -} - -- (id) defaultAction -{ - return [self _selectActionForApplication: @"view"]; -} - -- (id) selectForMailerAction -{ - return [self _selectActionForApplication: @"mailer-contacts"]; -} - - (void) _fillResults: (NSMutableDictionary *) results inFolder: (id ) folder withSearchOn: (NSString *) contact @@ -357,6 +329,41 @@ withSearchOn: (NSString *) contact // ? contactFolder : nil); // } +- (BOOL) isPopup +{ + return [[self queryParameterForKey: @"popup"] boolValue]; +} + +- (NSArray *) contactFolders +{ + SOGoContactFolders *folderContainer; + + folderContainer = [self clientObject]; + + return [folderContainer subFolders]; +} + +- (NSString *) currentContactFolderId +{ + return [NSString stringWithFormat: @"/%@", + [currentFolder nameInContainer]]; +} + +- (NSString *) currentContactFolderName +{ + return [currentFolder displayName]; +} + +- (NSString *) currentContactFolderOwner +{ + return [currentFolder ownerInContext: context]; +} + +- (NSString *) currentContactFolderClass +{ + return ([currentFolder isKindOfClass: [SOGoContactLDAPFolder class]]? @"remote" : @"local"); +} + - (WOResponse *) saveDragHandleStateAction { WORequest *request; diff --git a/UI/Contacts/UIxContactsListViewContainer.h b/UI/Contacts/UIxContactsListViewContainer.h deleted file mode 100644 index 9c7d9b493..000000000 --- a/UI/Contacts/UIxContactsListViewContainer.h +++ /dev/null @@ -1,56 +0,0 @@ -/* UIxContactsListViewContainer.h - this file is part of SOGo - * - * Copyright (C) 2006 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 UIXCONTACTSLISTVIEWCONTAINERBASE_H -#define UIXCONTACTSLISTVIEWCONTAINERBASE_H - -#import - -@class NSArray; -@class NSString; -@class SOGoContactFolder; -@class SOGoContactLDAPFolder; - -@interface UIxContactsListViewContainer : UIxComponent -{ - NSString *selectorComponentClass; - id currentFolder; - NSUserDefaults *ud; - NSMutableDictionary *moduleSettings; -} - -- (void) setCurrentFolder: (id) folder; - -- (NSArray *) contactFolders; - -- (NSString *) currentContactFolderId; -- (NSString *) currentContactFolderOwner; -- (NSString *) currentContactFolderName; -- (NSString *) currentContactFolderClass; - -- (NSString *) verticalDragHandleStyle; -- (NSString *) horizontalDragHandleStyle; -- (NSString *) contactsListContentStyle; - -@end - -#endif /* UIXCONTACTSLISTVIEWCONTAINERBASE_H */ diff --git a/UI/Contacts/UIxContactsListViewContainer.m b/UI/Contacts/UIxContactsListViewContainer.m deleted file mode 100644 index 0beb302a8..000000000 --- a/UI/Contacts/UIxContactsListViewContainer.m +++ /dev/null @@ -1,173 +0,0 @@ -/* UIxContactsListViewContainer.m - this file is part of SOGo - * - * Copyright (C) 2006-2009 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 -#import -#import -#import - -#import -#import - -#import -#import -#import - -#import "UIxContactsListViewContainer.h" - -@class SOGoContactFolders; - -@implementation UIxContactsListViewContainer - -- (void) _setupContext -{ - SOGoUser *activeUser; - NSString *module; - SOGoContactFolders *clientObject; - - activeUser = [context activeUser]; - clientObject = [[self clientObject] container]; - - module = [clientObject nameInContainer]; - - ud = [activeUser userSettings]; - moduleSettings = [ud objectForKey: module]; - if (!moduleSettings) - { - moduleSettings = [NSMutableDictionary new]; - [moduleSettings autorelease]; - } - [ud setObject: moduleSettings forKey: module]; -} - -- (id) init -{ - if ((self = [super init])) - { - selectorComponentClass = nil; - } - - return self; -} - -- (void) setSelectorComponentClass: (NSString *) aComponentClass -{ - selectorComponentClass = aComponentClass; -} - -- (NSString *) selectorComponentName -{ - return selectorComponentClass; -} - -- (WOElement *) selectorComponent -{ - WOElement *newComponent; -// Class componentClass; - -// componentClass = NSClassFromString(selectorComponentClass); -// if (componentClass) -// { - newComponent = [self pageWithName: selectorComponentClass]; -// } -// else -// newComponent = nil; - - return newComponent; -} - -- (void) setCurrentFolder: (id) folder -{ - currentFolder = folder; -} - -- (NSArray *) contactFolders -{ - SOGoContactFolders *folderContainer; - - folderContainer = [[self clientObject] container]; - - return [folderContainer subFolders]; -} - -- (NSString *) currentContactFolderId -{ - return [NSString stringWithFormat: @"/%@", - [currentFolder nameInContainer]]; -} - -- (NSString *) currentContactFolderName -{ - return [currentFolder displayName]; -} - -- (NSString *) currentContactFolderOwner -{ - return [currentFolder ownerInContext: context]; -} - -- (NSString *) currentContactFolderClass -{ - return ([currentFolder isKindOfClass: [SOGoContactLDAPFolder class]]? @"remote" : @"local"); -} - -- (BOOL) hasContactSelectionButtons -{ - return (selectorComponentClass != nil); -} - -- (BOOL) isPopup -{ - return [[self queryParameterForKey: @"popup"] boolValue]; -} - -- (NSString *) verticalDragHandleStyle -{ - NSString *vertical; - - [self _setupContext]; - vertical = [moduleSettings objectForKey: @"DragHandleVertical"]; - - return ((vertical && [vertical intValue] > 0) ? (id)[vertical stringByAppendingFormat: @"px"] : nil); -} - -- (NSString *) horizontalDragHandleStyle -{ - NSString *horizontal; - - [self _setupContext]; - horizontal = [moduleSettings objectForKey: @"DragHandleHorizontal"]; - - return ((horizontal && [horizontal intValue] > 0) ? (id)[horizontal stringByAppendingFormat: @"px"] : nil); -} - -- (NSString *) contactsListContentStyle -{ - NSString *height; - - [self _setupContext]; - height = [moduleSettings objectForKey: @"DragHandleVertical"]; - - return ((height && [height intValue] > 0) ? (id)[NSString stringWithFormat: @"%ipx", ([height intValue] - 27)] : nil); -} - -@end diff --git a/UI/Contacts/product.plist b/UI/Contacts/product.plist index 2c9bbcb39..77079b608 100644 --- a/UI/Contacts/product.plist +++ b/UI/Contacts/product.plist @@ -7,6 +7,12 @@ categories = { SOGoContactFolders = { + slots = { + toolbar = { + protectedBy = "View"; + value = "SOGoContactFolder.toolbar"; + }; + }; methods = { view = { protectedBy = "View"; diff --git a/UI/MailerUI/UIxMailAccountActions.m b/UI/MailerUI/UIxMailAccountActions.m index d4466c3e3..d1a24078e 100644 --- a/UI/MailerUI/UIxMailAccountActions.m +++ b/UI/MailerUI/UIxMailAccountActions.m @@ -255,7 +255,7 @@ if ([signature length]) { [newDraftMessage - setText: [NSString stringWithFormat: @"\n-- \n%@", signature]]; + setText: [NSString stringWithFormat: @"\n\n-- \n%@", signature]]; save = YES; } if (save) diff --git a/UI/Templates/ContactsUI/UIxContactFoldersView.wox b/UI/Templates/ContactsUI/UIxContactFoldersView.wox index c42113e11..bbb826413 100644 --- a/UI/Templates/ContactsUI/UIxContactFoldersView.wox +++ b/UI/Templates/ContactsUI/UIxContactFoldersView.wox @@ -1,2 +1,108 @@ - + + + + + + + + + + +
+
+ +
+
+ +
    +
  • +
+ + +
+ +
+
+
+ +
+ + +
+ + +
+ +
+ +
+
+ + +
diff --git a/UI/Templates/ContactsUI/UIxContactView.wox b/UI/Templates/ContactsUI/UIxContactView.wox index 888752b0d..dffe956c3 100644 --- a/UI/Templates/ContactsUI/UIxContactView.wox +++ b/UI/Templates/ContactsUI/UIxContactView.wox @@ -1,16 +1,13 @@ - - >

+ >
diff --git a/UI/Templates/ContactsUI/UIxContactsListView.wox b/UI/Templates/ContactsUI/UIxContactsListView.wox index b4082f143..01136fc88 100644 --- a/UI/Templates/ContactsUI/UIxContactsListView.wox +++ b/UI/Templates/ContactsUI/UIxContactsListView.wox @@ -1,14 +1,11 @@ - + xmlns:rsrc="OGo:url"> @@ -40,4 +37,4 @@
-
+ diff --git a/UI/Templates/ContactsUI/UIxContactsListViewContainer.wox b/UI/Templates/ContactsUI/UIxContactsListViewContainer.wox deleted file mode 100644 index 3f59ccf83..000000000 --- a/UI/Templates/ContactsUI/UIxContactsListViewContainer.wox +++ /dev/null @@ -1,122 +0,0 @@ - - - - - - - - - - - - - -
-
- -
-
- -
    -
  • -
- - -
- -
-
-
- -
- - -
- - -
- -
- -
- -
-
- - - - - -
- - - - -
diff --git a/UI/Templates/UIxPageFrame.wox b/UI/Templates/UIxPageFrame.wox index 348274233..45e2fb7fa 100644 --- a/UI/Templates/UIxPageFrame.wox +++ b/UI/Templates/UIxPageFrame.wox @@ -128,6 +128,7 @@ +