Monotone-Parent: 32b8651c607640726bff724790fc018ce587ad3e

Monotone-Revision: db3a7e7fdd8662a109a9a31c651b6cfa55d16775

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2006-10-03T22:04:48
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2006-10-03 22:04:48 +00:00
parent bf4774d9bb
commit 2ff6576f36
8 changed files with 194 additions and 206 deletions

View File

@@ -1,5 +1,14 @@
2006-10-03 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* UI/Contacts/UIxContactsSelectionViewContainer.m: removed since
we now use the action mechanism in UIxContactsListView to keep the
same view for the contact selectors and the regular contact view.
* UI/Contacts/UIxContactsListViewContainer.[hm]: replaces
UIxContactsListViewContainerBase.[hm]
* UI/Contacts/UIxContactsListView.[hm]: replaces UIxContactsListViewBase.[hm]
* UI/WebServerResources/generic.js: generalized emailstring
handling functions. Generalized address book access functions.

View File

@@ -9,9 +9,6 @@ ContactsUI_PRINCIPAL_CLASS = ContactsUIProduct
ContactsUI_LANGUAGES = English French
ContactsUI_OBJC_FILES = \
UIxContactsListViewBase.m \
UIxContactsListViewContainerBase.m \
\
UIxContactsSchedulerSelection.m \
UIxContactsMailerSelection.m \
\
@@ -22,7 +19,6 @@ ContactsUI_OBJC_FILES = \
UIxContactsListView.m \
UIxContactsListViewContainer.m \
UIxContactSelector.m \
UIxContactsSelectionViewContainer.m \
UIxContactFoldersView.m \
ContactsUI_RESOURCE_FILES += \

View File

@@ -19,8 +19,8 @@
02111-1307, USA.
*/
#ifndef __UIxContactsListViewBase_H__
#define __UIxContactsListViewBase_H__
#ifndef __UIxContactsListView_H__
#define __UIxContactsListView_H__
#import <SOGoUI/UIxComponent.h>
@@ -29,12 +29,13 @@
@protocol SOGoContactObject;
@interface UIxContactsListViewBase : UIxComponent
@interface UIxContactsListView : UIxComponent
{
NSString *searchText;
NSDictionary *currentContact;
NSString *selectorComponentClass;
}
@end
#endif /* __UIxContactsListViewBase_H__ */
#endif /* __UIxContactsListView_H__ */

View File

@@ -19,10 +19,150 @@
02111-1307, USA.
*/
#include "UIxContactsListViewBase.h"
#import <Contacts/SOGoContactObject.h>
#import <Contacts/SOGoContactFolder.h>
#import <Contacts/SOGoContactFolders.h>
@interface UIxContactsListView : UIxContactsListViewBase
@end
#import "common.h"
#import "UIxContactsListView.h"
@implementation UIxContactsListView
- (id) init
{
if ((self = [super init]))
{
selectorComponentClass = nil;
}
return self;
}
- (void) dealloc
{
if (searchText)
[searchText release];
[super dealloc];
}
/* accessors */
- (void) setCurrentContact: (NSDictionary *) _contact
{
currentContact = _contact;
}
- (NSDictionary *) currentContact
{
return currentContact;
}
- (void) setSearchText: (NSString *) _txt
{
ASSIGNCOPY (searchText, _txt);
}
- (id) searchText
{
if (!searchText)
[self setSearchText: [self queryParameterForKey:@"search"]];
return searchText;
}
- (NSString *) selectorComponentClass
{
return selectorComponentClass;
}
- (id) schedulerContactsAction
{
selectorComponentClass = @"UIxContactsSchedulerSelection";
return self;
}
- (id) mailerContactsAction
{
selectorComponentClass = @"UIxContactsMailerSelection";
return self;
}
- (NSString *) defaultSortKey
{
return @"fn";
}
- (NSString *) displayName
{
NSString *displayName;
displayName = [currentContact objectForKey: @"displayName"];
if (!(displayName && [displayName length] > 0))
displayName = [currentContact objectForKey: @"cn"];
return displayName;
}
- (NSString *) sortKey
{
NSString *s;
s = [self queryParameterForKey: @"sort"];
if ([s length] == 0)
s = [self defaultSortKey];
return s;
}
- (NSComparisonResult) sortOrdering
{
return ([[self queryParameterForKey:@"desc"] boolValue]
? NSOrderedDescending
: NSOrderedAscending);
}
- (NSArray *) contactInfos
{
id <SOGoContactFolder> folder;
folder = [self clientObject];
return [folder lookupContactsWithFilter: [self searchText]
sortBy: [self sortKey]
ordering: [self sortOrdering]];
}
/* notifications */
- (void) sleep
{
if (searchText)
{
[searchText release];
searchText = nil;
}
currentContact = nil;
// [allRecords release];
// allRecords = nil;
// [filteredRecords release];
// filteredRecords = nil;
[super sleep];
}
/* actions */
- (BOOL) shouldTakeValuesFromRequest: (WORequest *) _rq
inContext: (WOContext*) _c
{
return YES;
}
- (BOOL) isPopup
{
return [[self queryParameterForKey: @"popup"] boolValue];
}
@end /* UIxContactsListView */

View File

@@ -1,139 +0,0 @@
/*
Copyright (C) 2004-2005 SKYRIX Software AG
This file is part of OpenGroupware.org.
OGo is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
OGo 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 Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public
License along with OGo; see the file COPYING. If not, write to the
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
#import <Contacts/SOGoContactObject.h>
#import <Contacts/SOGoContactFolder.h>
#import <Contacts/SOGoContactFolders.h>
#import "common.h"
#import "UIxContactsListViewBase.h"
@implementation UIxContactsListViewBase
- (void) dealloc
{
if (searchText)
[searchText release];
[super dealloc];
}
/* accessors */
- (void) setCurrentContact: (NSDictionary *) _contact
{
currentContact = _contact;
}
- (NSDictionary *) currentContact
{
return currentContact;
}
- (void) setSearchText: (NSString *) _txt
{
ASSIGNCOPY (searchText, _txt);
}
- (id) searchText
{
if (!searchText)
[self setSearchText: [self queryParameterForKey:@"search"]];
return searchText;
}
- (NSString *) defaultSortKey
{
return @"fn";
}
- (NSString *) displayName
{
NSString *displayName;
displayName = [currentContact objectForKey: @"displayName"];
if (!(displayName && [displayName length] > 0))
displayName = [currentContact objectForKey: @"cn"];
return displayName;
}
- (NSString *) sortKey
{
NSString *s;
s = [self queryParameterForKey: @"sort"];
if ([s length] == 0)
s = [self defaultSortKey];
return s;
}
- (NSComparisonResult) sortOrdering
{
return ([[self queryParameterForKey:@"desc"] boolValue]
? NSOrderedDescending
: NSOrderedAscending);
}
- (NSArray *) contactInfos
{
id <SOGoContactFolder> folder;
folder = [self clientObject];
return [folder lookupContactsWithFilter: [self searchText]
sortBy: [self sortKey]
ordering: [self sortOrdering]];
}
/* notifications */
- (void) sleep
{
if (searchText)
{
[searchText release];
searchText = nil;
}
currentContact = nil;
// [allRecords release];
// allRecords = nil;
// [filteredRecords release];
// filteredRecords = nil;
[super sleep];
}
/* actions */
- (BOOL) shouldTakeValuesFromRequest: (WORequest *) _rq
inContext: (WOContext*) _c
{
return YES;
}
- (BOOL) isPopup
{
return [[self queryParameterForKey: @"popup"] boolValue];
}
@end /* UIxContactsListViewBase */

View File

@@ -20,13 +20,31 @@
* Boston, MA 02111-1307, USA.
*/
#ifndef UIXCONTACTSLISTVIEWCONTAINER_H
#define UIXCONTACTSLISTVIEWCONTAINER_H
#ifndef UIXCONTACTSLISTVIEWCONTAINERBASE_H
#define UIXCONTACTSLISTVIEWCONTAINERBASE_H
#import "UIxContactsListViewContainerBase.h"
#import <SOGoUI/UIxComponent.h>
@interface UIxContactsListViewContainer : UIxContactsListViewContainerBase
@class NSArray;
@class SOGoContactFolder;
@interface UIxContactsListViewContainer : UIxComponent
{
NSString *foldersPrefix;
NSString *selectorComponentClass;
id currentFolder;
}
- (void) setCurrentFolder: (id) folder;
- (NSString *) foldersPrefix;
- (NSArray *) contactFolders;
- (NSString *) contactFolderId;
- (NSString *) currentContactFolderId;
- (NSString *) currentContactFolderName;
@end
#endif /* UIXCONTACTSLISTVIEWCONTAINER_H */
#endif /* UIXCONTACTSLISTVIEWCONTAINERBASE_H */

View File

@@ -1,49 +0,0 @@
/* UIxContactsListViewContainerBase.h - this file is part of SOGo
*
* Copyright (C) 2006 Inverse groupe conseil
*
* 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 SOGoContactFolder;
@interface UIxContactsListViewContainerBase : UIxComponent
{
NSString *foldersPrefix;
id currentFolder;
}
- (void) setCurrentFolder: (id) folder;
- (NSString *) foldersPrefix;
- (NSArray *) contactFolders;
- (NSString *) contactFolderId;
- (NSString *) currentContactFolderId;
- (NSString *) currentContactFolderName;
@end
#endif /* UIXCONTACTSLISTVIEWCONTAINERBASE_H */

View File

@@ -51,11 +51,13 @@
};
scheduler-contacts = {
protectedBy = "View";
pageName = "UIxContactsSchedulerSelection";
pageName = "UIxContactsListView";
actionName = "schedulerContacts";
};
mailer-contacts = {
protectedBy = "View";
pageName = "UIxContactsMailerSelection";
pageName = "UIxContactsListView";
actionName = "mailerContacts";
};
};
};
@@ -77,6 +79,16 @@
pageName = "UIxContactEditor";
actionName = "new";
};
scheduler-contacts = {
protectedBy = "View";
pageName = "UIxContactsListView";
actionName = "schedulerContacts";
};
mailer-contacts = {
protectedBy = "View";
pageName = "UIxContactsListView";
actionName = "mailerContacts";
};
};
};