See ChangeLog

Monotone-Parent: 3c15622e01ba189cb753c80fb8cf4c1a57e85c29
Monotone-Revision: 3273edcbe74bef5af678b4bac440df23fe52dafd

Monotone-Author: flachapelle@inverse.ca
Monotone-Date: 2009-06-26T17:48:28
Monotone-Branch: ca.inverse.sogo
maint-2.0.2
Francis Lachapelle 2009-06-26 17:48:28 +00:00
parent f30c282fc0
commit 3a26cead36
14 changed files with 211 additions and 419 deletions

View File

@ -1,3 +1,8 @@
2009-06-26 Francis Lachapelle <flachapelle@inverse.ca>
* UI/Contacts/UIxContactsListViewContainer.[hm]: this class was
removed along with the template and moved to UIxContactFoldersView.
2009-06-26 Cyril Robert <crobert@inverse.ca>
* UI/WebServerResources/UIxPreferences.js: Fixed a bug when

View File

@ -20,7 +20,6 @@ ContactsUI_OBJC_FILES = \
UIxListView.m \
UIxListEditor.m \
UIxContactsListView.m \
UIxContactsListViewContainer.m \
UIxContactFoldersView.m
ContactsUI_RESOURCE_FILES += \

View File

@ -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 <wsourdeau@inverse.ca>
*
@ -30,8 +30,16 @@
{
NSUserDefaults *ud;
NSMutableDictionary *moduleSettings;
id currentFolder;
}
- (NSArray *) contactFolders;
- (NSString *) currentContactFolderId;
- (NSString *) currentContactFolderOwner;
- (NSString *) currentContactFolderName;
- (NSString *) currentContactFolderClass;
- (WOResponse *) saveDragHandleStateAction;
@end

View File

@ -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 <SOGoContactFolder>) 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;

View File

@ -1,56 +0,0 @@
/* UIxContactsListViewContainer.h - this file is part of SOGo
*
* Copyright (C) 2006 Inverse inc.
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
*
* 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 <SOGoUI/UIxComponent.h>
@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 */

View File

@ -1,173 +0,0 @@
/* UIxContactsListViewContainer.m - this file is part of SOGo
*
* Copyright (C) 2006-2009 Inverse inc.
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
*
* 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 <Foundation/NSArray.h>
#import <Foundation/NSDictionary.h>
#import <Foundation/NSString.h>
#import <Foundation/NSUserDefaults.h>
#import <NGObjWeb/SoObjects.h>
#import <NGExtensions/NSObject+Values.h>
#import <SoObjects/SOGo/SOGoUser.h>
#import <SoObjects/Contacts/SOGoContactFolder.h>
#import <SoObjects/Contacts/SOGoContactFolders.h>
#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

View File

@ -7,6 +7,12 @@
categories = {
SOGoContactFolders = {
slots = {
toolbar = {
protectedBy = "View";
value = "SOGoContactFolder.toolbar";
};
};
methods = {
view = {
protectedBy = "View";

View File

@ -1,2 +1,109 @@
<?xml version='1.0' standalone='yes'?>
<container />
<!DOCTYPE var:component>
<var:component
xmlns="http://www.w3.org/1999/xhtml"
xmlns:var="http://www.skyrix.com/od/binding"
xmlns:const="http://www.skyrix.com/od/constant"
xmlns:uix="OGo:uix"
xmlns:label="OGo:label"
xmlns:rsrc="OGo:url"
className="UIxPageFrame"
title="name"
var:popup="isPopup">
<style type="text/css">
<var:if condition="horizontalDragHandleStyle">
DIV#dragHandle, DIV#rightPanel
{ left: <var:string value="horizontalDragHandleStyle" />; }
DIV#contactFoldersList
{ width: <var:string value="horizontalDragHandleStyle" />; }
</var:if><var:if condition="verticalDragHandleStyle">
DIV#rightDragHandle, DIV#contactView
{ top: <var:string value="verticalDragHandleStyle" />; }
</var:if><var:if condition="contactsListContentStyle">
DIV#contactsListContent
{ height: <var:string value="contactsListContentStyle" />; }
</var:if>
</style>
<div class="menu" id="contactFoldersMenu">
<ul>
<li><var:string label:value="Properties" /></li>
<li><!-- separator --></li>
<li><var:string label:value="New Card" /></li>
<li><var:string label:value="New List" /></li>
<li><!-- separator --></li>
<li><var:string label:value="Delete" /></li>
<li><!-- separator --></li>
<li><var:string label:value="Sharing..." /></li>
</ul>
</div>
<div class="menu" id="contactMenu">
<ul>
<li><var:string label:value="Properties" /></li>
<li><!-- separator --></li>
<li><var:string label:value="Write" /></li>
<li><var:string label:value="Instant Message" /></li>
<li><!-- separator --></li>
<li><var:string label:value="Delete" /></li>
<li><!-- separator --></li>
<li><var:string label:value="Move To" /></li>
<li><var:string label:value="Copy To" /></li>
</ul>
</div>
<!-- var:if condition="isPopup" const:negate="YES" -->
<!-- <var:if condition="hideFolderTree" const:negate="YES" -->
<div class="contactFoldersList" id="contactFoldersList">
<div class="titlediv"
><var:string label:value="Address Books"
/></div>
<!-- var:if var:condition="isPopup" const:negate="YES" -->
<div class="toolbar" id="abToolbar">
<a href="#" class="toolbarButton"
><span class="toolbarButton"
><img rsrc:src="add-addressbook.png" label:title="New Addressbook..."
/></span></a
><a href="#" class="toolbarButton"
><span class="toolbarButton"
><img rsrc:src="add-user-addressbook.png" label:title="Subscribe to an Addressbook..."
/></span></a
><a href="#" class="toolbarButton"
><span class="toolbarButton"
><img rsrc:src="remove-addressbook.png" label:title="Remove the selected Addressbook"
/></span></a
></div><!-- var:if -->
<ul id="contactFolders">
<var:foreach list="contactFolders" item="currentFolder"
><li var:id="currentContactFolderId"
var:owner="currentContactFolderOwner"
var:class="currentContactFolderClass"
><var:string value="currentContactFolderName" /></li
></var:foreach
>
</ul>
<var:if condition="hasContactSelectionButtons">
<div class="contactSelection">
<var:component value="selectorComponent" />
</div>
</var:if>
</div>
<div class="dragHandle" id="dragHandle"><!-- space --></div>
<!-- var:if -->
<div id="rightPanel">
<var:component className="UIxContactsFilterPanel" qualifier="qualifier" />
<div id="contactsListContent"><!-- space --></div>
<div class="dragHandle" id="rightDragHandle"><!-- space --></div>
<div id="contactView" onmousedown="return false;"><!-- space --></div>
</div>
<var:string value="errorAlertJavaScript" const:escapeHTML="NO" />
</var:if>
</var:component>

View File

@ -1,122 +0,0 @@
<?xml version='1.0' standalone='yes'?>
<!DOCTYPE var:component>
<var:component
xmlns="http://www.w3.org/1999/xhtml"
xmlns:var="http://www.skyrix.com/od/binding"
xmlns:const="http://www.skyrix.com/od/constant"
xmlns:uix="OGo:uix"
xmlns:label="OGo:label"
xmlns:rsrc="OGo:url"
className="UIxPageFrame"
title="name"
var:popup="isPopup">
<var:if condition="hideFrame" const:negate="YES">
<style type="text/css">
<var:if condition="horizontalDragHandleStyle">
DIV#dragHandle, DIV#rightPanel
{ left: <var:string value="horizontalDragHandleStyle" />; }
DIV#contactFoldersList
{ width: <var:string value="horizontalDragHandleStyle" />; }
</var:if><var:if condition="verticalDragHandleStyle">
DIV#rightDragHandle, DIV#contactView
{ top: <var:string value="verticalDragHandleStyle" />; }
</var:if><var:if condition="contactsListContentStyle">
DIV#contactsListContent
{ height: <var:string value="contactsListContentStyle" />; }
</var:if>
</style>
<div class="menu" id="contactFoldersMenu">
<ul>
<li><var:string label:value="Properties" /></li>
<li><!-- separator --></li>
<li><var:string label:value="New Card" /></li>
<li><var:string label:value="New List" /></li>
<li><!-- separator --></li>
<li><var:string label:value="Delete" /></li>
<li><!-- separator --></li>
<li><var:string label:value="Sharing..." /></li>
</ul>
</div>
<div class="menu" id="contactMenu">
<ul>
<li><var:string label:value="Properties" /></li>
<li><!-- separator --></li>
<li><var:string label:value="Write" /></li>
<li><var:string label:value="Instant Message" /></li>
<li><!-- separator --></li>
<li><var:string label:value="Delete" /></li>
<li><!-- separator --></li>
<li><var:string label:value="Move To" /></li>
<li><var:string label:value="Copy To" /></li>
</ul>
</div>
<!-- var:if condition="isPopup" const:negate="YES" -->
<!-- <var:if condition="hideFolderTree" const:negate="YES" -->
<div class="contactFoldersList" id="contactFoldersList">
<div class="titlediv"
><var:string label:value="Address Books"
/></div>
<!-- var:if var:condition="isPopup" const:negate="YES" -->
<div class="toolbar" id="abToolbar">
<a href="#" class="toolbarButton"
><span class="toolbarButton"
><img rsrc:src="add-addressbook.png" label:title="New Addressbook..."
/></span></a
><a href="#" class="toolbarButton"
><span class="toolbarButton"
><img rsrc:src="add-user-addressbook.png" label:title="Subscribe to an Addressbook..."
/></span></a
><a href="#" class="toolbarButton"
><span class="toolbarButton"
><img rsrc:src="remove-addressbook.png" label:title="Remove the selected Addressbook"
/></span></a
></div><!-- var:if -->
<ul id="contactFolders">
<var:foreach list="contactFolders" item="currentFolder"
><li var:id="currentContactFolderId"
var:owner="currentContactFolderOwner"
var:class="currentContactFolderClass"
><var:string value="currentContactFolderName" /></li
></var:foreach
>
</ul>
<var:if condition="hasContactSelectionButtons">
<div class="contactSelection">
<var:component value="selectorComponent" />
</div>
</var:if>
</div>
<div class="dragHandle" id="dragHandle"><!-- space --></div>
<!-- var:if -->
<div id="rightPanel">
<var:component className="UIxContactsFilterPanel" qualifier="qualifier" />
<div id="contactsListContent">
<var:component-content />
</div>
<div class="dragHandle" id="rightDragHandle"><!-- space --></div>
<div id="contactView" onmousedown="return false;"><!-- space --></div>
</div>
<!-- /var:if> -->
<!-- var:if condition="isPopup">
var:component-content />
/var:if> -->
<var:string value="errorAlertJavaScript" const:escapeHTML="NO" />
</var:if>
<var:if condition="hideFrame">
<var:component-content />
</var:if>
</var:component>

View File

@ -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%;

View File

@ -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")

View File

@ -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; }

View File

@ -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", "");
}
}
}

View File

@ -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