diff --git a/ChangeLog b/ChangeLog index e11c9b2ad..19b651638 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +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/Templates/ContactsUI/UIxContactFoldersView.wox b/UI/Templates/ContactsUI/UIxContactFoldersView.wox index c42113e11..9c89f81f7 100644 --- a/UI/Templates/ContactsUI/UIxContactFoldersView.wox +++ b/UI/Templates/ContactsUI/UIxContactFoldersView.wox @@ -1,2 +1,109 @@ - + + + + + + + + + + +
+
+ +
+
+ +
    +
  • +
+ + +
+ +
+
+
+ +
+ + +
+ + +
+ +
+ +
+
+ + + +
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/WebServerResources/ContactsUI.css b/UI/WebServerResources/ContactsUI.css index 77aaed72c..a28369728 100644 --- a/UI/WebServerResources/ContactsUI.css +++ b/UI/WebServerResources/ContactsUI.css @@ -61,16 +61,11 @@ DIV#contactsListContent width: 25%; } -.contentcell -{ -} - .titlediv -{ - line-height: 2em; - vertical-align: bottom; - padding-left: 1em; -} +{ line-height: 18px; + vertical-align: middle; + padding-top: 8px; + padding-left: 6px; } TABLE.titletable { @@ -117,11 +112,18 @@ DIV#contactFoldersList overflow: hidden; } DIV#contactFoldersList DIV.toolbar -{ width: 100%; - padding: 0px; - margin: 0px; - border-top: 1px solid #aaa; - border-left: 1px solid #aaa; } +{ padding: 4px 0; + margin: 1px 0 0 0; + border-top: 1px solid #888; + border-left: 1px solid #aaa; + border-right: 1px solid #aaa; } + +SPAN.toolbarButton +{ float: none; + padding: 14px 2px 0px 2px; } + +A.toolbarButton +{ text-decoration: none; } UL#contactFolders { list-style-type: none; @@ -131,7 +133,7 @@ UL#contactFolders color: #000; background: #fff; position: absolute; /* required for Safari & IE */ - top: 53px; /* leave space for the mini addressbook */ + top: 62px; /* leave space for the mini addressbook */ bottom: 0px; width: 100%; height: 100%; diff --git a/UI/WebServerResources/ContactsUI.js b/UI/WebServerResources/ContactsUI.js index 97ab47cbd..8e7cd0ad0 100644 --- a/UI/WebServerResources/ContactsUI.js +++ b/UI/WebServerResources/ContactsUI.js @@ -97,24 +97,26 @@ function contactsListCallback(http) { var tmp = document.createElement('div'); $(tmp).update(html); table.replaceChild($(tmp).select("table tbody")[0], tbody); - - var rows = table.tBodies[0].rows; - for (var i = 0; i < rows.length; i++) { - var row = $(rows[i]); - row.observe("mousedown", onRowClick); - row.observe("dblclick", onContactRowDblClick); - row.observe("selectstart", listRowMouseDownHandler); - row.observe("contextmenu", onContactContextMenu); - } - } + } else { - // Add table (doesn't happen .. yet) + // Add table div.update(http.responseText); table = $("contactsList"); + table.multiselect = true; + table.observe("mousedown", onContactSelectionChange); configureSortableTableHeaders(table); TableKit.Resizable.init(table, {'trueResize' : true, 'keepWidth' : true}); } + var rows = table.tBodies[0].rows; + for (var i = 0; i < rows.length; i++) { + var row = $(rows[i]); + row.observe("mousedown", onRowClick); + row.observe("dblclick", onContactRowDblClick); + row.observe("selectstart", listRowMouseDownHandler); + row.observe("contextmenu", onContactContextMenu); + } + if (sorting["attribute"] && sorting["attribute"].length > 0) { var sortHeader; if (sorting["attribute"] == "c_cn") diff --git a/UI/WebServerResources/MailerUI.css b/UI/WebServerResources/MailerUI.css index 981417eb7..7c7264cf3 100644 --- a/UI/WebServerResources/MailerUI.css +++ b/UI/WebServerResources/MailerUI.css @@ -23,7 +23,7 @@ DIV#leftPanel { position: absolute; - top: 65px; + top: 70px; left: 0px; width: 15em; bottom: 0px; @@ -184,12 +184,18 @@ DIV#folderTreeContent .titlediv { - height: 24px; - vertical-align: middle; + height: 2em; + vertical-align: bottom; padding-top: 6px; padding-left: 6px; } +.titlediv +{ line-height: 18px; + vertical-align: middle; + padding-top: 0px; + padding-left: 6px; } + TABLE.titletable { height: 24px; @@ -228,12 +234,6 @@ TABLE.titletable TD.titlecell SELECT DIV#folderTreeContent { -khtml-user-select: none;} -DIV#folderTreeContent TABLE TD -{ height: 18px; - border-top: 1px solid #fff; - margin: 0px; - padding: 0px; } - /* mailbox tree (dtree) */ DIV.dTreeNode SPAN.unseen { font-weight: bold; } diff --git a/UI/WebServerResources/MailerUI.js b/UI/WebServerResources/MailerUI.js index a51382848..053298630 100644 --- a/UI/WebServerResources/MailerUI.js +++ b/UI/WebServerResources/MailerUI.js @@ -2045,10 +2045,12 @@ function messageFlagCallback(http) { var idx = flags.indexOf(flag); flags.splice(idx, 1); } - row.setAttribute("labels", flags.join(" ")); + row.writeAttribute("labels", flags.join(" ")); + row.toggleClassName("_selected"); + row.toggleClassName("_selected"); } else - row.setAttribute("labels", ""); + row.writeAttribute("labels", ""); } } } diff --git a/UI/WebServerResources/iefixes.css b/UI/WebServerResources/iefixes.css index f3888c63e..07afda9d2 100644 --- a/UI/WebServerResources/iefixes.css +++ b/UI/WebServerResources/iefixes.css @@ -61,6 +61,11 @@ IMG.dragMessage TD.mailer_fieldname { width: 8em; } +/* ContactsUI */ + +DIV#contactFoldersList SPAN.toolbarButton +{ padding: 2px; } + /* SchedulerUI */ DIV#daysView > DIV.hours > DIV.hour