mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-05-23 04:15:26 +00:00
Monotone-Parent: 5ce544e4196355529d09f53ee1f29a26e0df0733
Monotone-Revision: 2cf3be019f697c04a2f19de8e9693b7b7a1ddf8d Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2006-08-09T21:37:35 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -29,3 +29,6 @@
|
|||||||
"edit" = "Editer";
|
"edit" = "Editer";
|
||||||
"invalidemailwarn" = "Champ de l'email invalide, continuer quand même ?";
|
"invalidemailwarn" = "Champ de l'email invalide, continuer quand même ?";
|
||||||
"new" = "Nouveau";
|
"new" = "Nouveau";
|
||||||
|
|
||||||
|
"Name or Address" = "Le nom ou l'adresse";
|
||||||
|
"Personal Addressbook" = "Adresses personnelles";
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ ContactsUI_OBJC_FILES = \
|
|||||||
\
|
\
|
||||||
ContactsUIProduct.m \
|
ContactsUIProduct.m \
|
||||||
UIxContactsFilterPanel.m \
|
UIxContactsFilterPanel.m \
|
||||||
UIxContactsSelectionView.m \
|
|
||||||
UIxContactView.m \
|
UIxContactView.m \
|
||||||
UIxContactSelector.m \
|
UIxContactSelector.m \
|
||||||
UIxContactEditor.m \
|
UIxContactEditor.m \
|
||||||
|
|||||||
@@ -19,11 +19,12 @@
|
|||||||
02111-1307, USA.
|
02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "UIxContactEditorBase.h"
|
|
||||||
#include <Contacts/SOGoContactObject.h>
|
#include <Contacts/SOGoContactObject.h>
|
||||||
#include <Contacts/SOGoContactFolder.h>
|
#include <Contacts/SOGoContactFolder.h>
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
|
||||||
|
#include "UIxContactEditorBase.h"
|
||||||
|
|
||||||
@implementation UIxContactEditorBase
|
@implementation UIxContactEditorBase
|
||||||
|
|
||||||
- (id)init {
|
- (id)init {
|
||||||
@@ -43,9 +44,11 @@
|
|||||||
|
|
||||||
/* accessors */
|
/* accessors */
|
||||||
|
|
||||||
- (void)setContentString:(NSString *)_cstr {
|
- (void)setContentString:(NSString *)_cstr
|
||||||
|
{
|
||||||
ASSIGNCOPY(self->contentString, _cstr);
|
ASSIGNCOPY(self->contentString, _cstr);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSString *)contentString {
|
- (NSString *)contentString {
|
||||||
return self->contentString;
|
return self->contentString;
|
||||||
}
|
}
|
||||||
@@ -185,31 +188,36 @@
|
|||||||
|
|
||||||
- (void) initSnapshot
|
- (void) initSnapshot
|
||||||
{
|
{
|
||||||
NSString *c;
|
NGVCard *vCard;
|
||||||
|
|
||||||
/* load iCalendar file */
|
/* load iCalendar file */
|
||||||
|
|
||||||
c = [[self clientObject] contentAsString];
|
vCard = [[self clientObject] vCard];
|
||||||
if ([c length] == 0) /* a new contact */
|
if (vCard)
|
||||||
c = [self contentStringTemplate];
|
// if ([c length] == 0) /* a new contact */
|
||||||
|
// c = [self contentStringTemplate];
|
||||||
[self setContentString:c];
|
{
|
||||||
[self loadValuesFromContentString:c];
|
// [self setContent: record];
|
||||||
|
// [self loadValuesFromContentString: record];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id<WOActionResults>)defaultAction {
|
- (id <WOActionResults>) defaultAction
|
||||||
|
{
|
||||||
// TODO: very similiar to apt-editor (apt editor would need to use std names
|
// TODO: very similiar to apt-editor (apt editor would need to use std names
|
||||||
[self initSnapshot];
|
[self initSnapshot];
|
||||||
|
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSString *)viewActionName {
|
- (NSString *) viewActionName
|
||||||
|
{
|
||||||
/* this is overridden in the mail based contacts UI to redirect to tb.edit */
|
/* this is overridden in the mail based contacts UI to redirect to tb.edit */
|
||||||
return @"";
|
return @"";
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSString *)editActionName {
|
- (NSString *) editActionName
|
||||||
|
{
|
||||||
/* this is overridden in the mail based contacts UI to redirect to tb.edit */
|
/* this is overridden in the mail based contacts UI to redirect to tb.edit */
|
||||||
return @"edit";
|
return @"edit";
|
||||||
}
|
}
|
||||||
@@ -218,48 +226,48 @@
|
|||||||
{
|
{
|
||||||
NSException *ex;
|
NSException *ex;
|
||||||
NSString *uri;
|
NSString *uri;
|
||||||
NSDictionary *record;
|
// NSDictionary *record;
|
||||||
NSMutableDictionary *newRecord;
|
NSMutableDictionary *newRecord;
|
||||||
|
|
||||||
if ([[self clientObject]
|
// if ([[self clientObject]
|
||||||
respondsToSelector: @selector (saveContentString:)])
|
// respondsToSelector: @selector (saveContentString:)])
|
||||||
{
|
// {
|
||||||
if (contentString)
|
// if (contentString)
|
||||||
{
|
// {
|
||||||
record = [contentString propertyList];
|
// record = [contentString propertyList];
|
||||||
if (record)
|
// if (record)
|
||||||
{
|
// {
|
||||||
newRecord = [[record mutableCopy] autorelease];
|
// newRecord = [[record mutableCopy] autorelease];
|
||||||
[self saveValuesIntoRecord: newRecord];
|
// [self saveValuesIntoRecord: newRecord];
|
||||||
ex = [[self clientObject] saveRecord: newRecord];
|
// ex = [[self clientObject] saved];
|
||||||
if (ex)
|
// if (ex)
|
||||||
{
|
// {
|
||||||
[self setErrorText: [ex reason]];
|
// [self setErrorText: [ex reason]];
|
||||||
|
|
||||||
return self;
|
// return self;
|
||||||
}
|
// }
|
||||||
else
|
// else
|
||||||
{
|
// {
|
||||||
uri = [self viewActionName];
|
// uri = [self viewActionName];
|
||||||
if ([uri length] <= 0)
|
// if ([uri length] <= 0)
|
||||||
uri = @"..";
|
// uri = @"..";
|
||||||
|
|
||||||
return [self redirectToLocation: [self _completeURIForMethod: uri]];
|
// return [self redirectToLocation: [self _completeURIForMethod: uri]];
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
else
|
// else
|
||||||
{
|
// {
|
||||||
[self setErrorText: @"Invalid property list data ..."]; // localize
|
// [self setErrorText: @"Invalid property list data ..."]; // localize
|
||||||
return self;
|
// return self;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
else
|
// else
|
||||||
{
|
// {
|
||||||
[self setErrorText: @"Missing object content!"]; // localize
|
// [self setErrorText: @"Missing object content!"]; // localize
|
||||||
return self;
|
// return self;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
else
|
// else
|
||||||
return [NSException exceptionWithHTTPStatus: 400 /* Bad Request */
|
return [NSException exceptionWithHTTPStatus: 400 /* Bad Request */
|
||||||
reason: @"method cannot be invoked on "
|
reason: @"method cannot be invoked on "
|
||||||
@"the specified object"];
|
@"the specified object"];
|
||||||
|
|||||||
@@ -75,18 +75,20 @@
|
|||||||
/* action */
|
/* action */
|
||||||
|
|
||||||
- (id<WOActionResults>)defaultAction {
|
- (id<WOActionResults>)defaultAction {
|
||||||
if ([[self clientObject] record] == nil) {
|
if ([[self clientObject] vCard] == nil) {
|
||||||
return [NSException exceptionWithHTTPStatus:404 /* Not Found */
|
return [NSException exceptionWithHTTPStatus:404 /* Not Found */
|
||||||
reason:@"could not locate contact"];
|
reason:@"could not locate contact"];
|
||||||
}
|
}
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL)isDeletableClientObject {
|
- (BOOL) isDeletableClientObject
|
||||||
return [[self clientObject] respondsToSelector:@selector(delete)];
|
{
|
||||||
|
return [[self clientObject] respondsToSelector: @selector(delete)];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id)deleteAction {
|
- (id) deleteAction
|
||||||
|
{
|
||||||
NSException *ex;
|
NSException *ex;
|
||||||
id url;
|
id url;
|
||||||
|
|
||||||
|
|||||||
@@ -19,9 +19,9 @@
|
|||||||
02111-1307, USA.
|
02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <NGObjWeb/WOComponent.h>
|
#include <SOGoUI/UIxComponent.h>
|
||||||
|
|
||||||
@interface UIxContactsFilterPanel : WOComponent
|
@interface UIxContactsFilterPanel : UIxComponent
|
||||||
{
|
{
|
||||||
NSString *searchText;
|
NSString *searchText;
|
||||||
NSString *searchCriteria;
|
NSString *searchCriteria;
|
||||||
@@ -36,10 +36,10 @@
|
|||||||
|
|
||||||
static NSArray *filters = nil;
|
static NSArray *filters = nil;
|
||||||
|
|
||||||
+ (void)initialize {
|
+ (void) initialize
|
||||||
|
{
|
||||||
NSMutableDictionary *md;
|
NSMutableDictionary *md;
|
||||||
NSMutableArray *ma;
|
NSMutableArray *ma;
|
||||||
unsigned i;
|
|
||||||
|
|
||||||
md = [[NSMutableDictionary alloc] initWithCapacity:8];
|
md = [[NSMutableDictionary alloc] initWithCapacity:8];
|
||||||
ma = [[NSMutableArray alloc] initWithCapacity:4];
|
ma = [[NSMutableArray alloc] initWithCapacity:4];
|
||||||
@@ -60,7 +60,8 @@ static NSArray *filters = nil;
|
|||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)dealloc {
|
- (void) dealloc
|
||||||
|
{
|
||||||
[self->searchCriteria release];
|
[self->searchCriteria release];
|
||||||
[self->searchText release];
|
[self->searchText release];
|
||||||
[super dealloc];
|
[super dealloc];
|
||||||
@@ -68,34 +69,30 @@ static NSArray *filters = nil;
|
|||||||
|
|
||||||
/* accessors */
|
/* accessors */
|
||||||
|
|
||||||
- (void)setSearchText: (NSString *)_txt
|
- (void) setSearchText: (NSString *)_txt
|
||||||
{
|
{
|
||||||
ASSIGNCOPY(self->searchText, _txt);
|
ASSIGNCOPY(self->searchText, _txt);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)setSearchCriteria: (NSString *)_txt
|
- (void) setSearchCriteria: (NSString *)_txt
|
||||||
{
|
{
|
||||||
ASSIGNCOPY(self->searchText, _txt);
|
ASSIGNCOPY(self->searchText, _txt);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSString *)searchText
|
- (NSString *) searchText
|
||||||
{
|
{
|
||||||
if (self->searchText == nil)
|
if (!searchText)
|
||||||
{
|
searchText = [[self queryParameterForKey: @"search"] copy];
|
||||||
self->searchText =
|
|
||||||
[[[[self context] request] formValueForKey:@"search"] copy];
|
return searchText;
|
||||||
}
|
|
||||||
return self->searchText;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSString *)searchCriteria
|
- (NSString *) searchCriteria
|
||||||
{
|
{
|
||||||
if (self->searchCriteria == nil)
|
if (!searchCriteria)
|
||||||
{
|
searchCriteria = [[self queryParameterForKey: @"criteria"] copy];
|
||||||
self->searchCriteria =
|
|
||||||
[[[[self context] request] formValueForKey:@"criteria"] copy];
|
return searchCriteria;
|
||||||
}
|
|
||||||
return self->searchCriteria;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* filters */
|
/* filters */
|
||||||
@@ -118,7 +115,7 @@ static NSArray *filters = nil;
|
|||||||
|
|
||||||
- (NSString *) selectedFilter
|
- (NSString *) selectedFilter
|
||||||
{
|
{
|
||||||
return [[[self context] request] formValueForKey: @"filterpopup"];
|
return [self queryParameterForKey: @"filterpopup"];
|
||||||
}
|
}
|
||||||
|
|
||||||
@end /* UIxContactsFilterPanel */
|
@end /* UIxContactsFilterPanel */
|
||||||
|
|||||||
@@ -22,16 +22,16 @@
|
|||||||
#ifndef __UIxContactsListViewBase_H__
|
#ifndef __UIxContactsListViewBase_H__
|
||||||
#define __UIxContactsListViewBase_H__
|
#define __UIxContactsListViewBase_H__
|
||||||
|
|
||||||
#include <SOGoUI/UIxComponent.h>
|
#import <SOGoUI/UIxComponent.h>
|
||||||
|
|
||||||
@class NSString, NSArray;
|
@class NSString;
|
||||||
|
|
||||||
|
@protocol SOGoContactObject;
|
||||||
|
|
||||||
@interface UIxContactsListViewBase : UIxComponent
|
@interface UIxContactsListViewBase : UIxComponent
|
||||||
{
|
{
|
||||||
NSArray *allRecords;
|
|
||||||
NSArray *filteredRecords;
|
|
||||||
NSString *searchText;
|
NSString *searchText;
|
||||||
id contact;
|
id <SOGoContactObject> currentContact;
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|||||||
@@ -19,112 +19,104 @@
|
|||||||
02111-1307, USA.
|
02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "UIxContactsListViewBase.h"
|
#import <Contacts/SOGoContactObject.h>
|
||||||
#include <Contacts/SOGoContactFolder.h>
|
#import <Contacts/SOGoContactFolder.h>
|
||||||
#include "common.h"
|
#import <Contacts/SOGoContactFolders.h>
|
||||||
|
|
||||||
|
#import "common.h"
|
||||||
|
|
||||||
|
#import "UIxContactsListViewBase.h"
|
||||||
|
|
||||||
@implementation UIxContactsListViewBase
|
@implementation UIxContactsListViewBase
|
||||||
|
|
||||||
- (void)dealloc {
|
- (void) dealloc
|
||||||
[self->allRecords release];
|
{
|
||||||
[self->filteredRecords release];
|
if (searchText)
|
||||||
[self->searchText release];
|
[searchText release];
|
||||||
[self->contact release];
|
|
||||||
[super dealloc];
|
[super dealloc];
|
||||||
}
|
}
|
||||||
|
|
||||||
/* accessors */
|
/* accessors */
|
||||||
|
|
||||||
- (void)setContact:(id)_contact {
|
- (void) setCurrentContact: (id <SOGoContactObject>) _contact
|
||||||
ASSIGN(self->contact, _contact);
|
{
|
||||||
}
|
currentContact = _contact;
|
||||||
- (id)contact {
|
|
||||||
return self->contact;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)setSearchText:(NSString *)_txt {
|
- (id <SOGoContactObject>) currentContact
|
||||||
ASSIGNCOPY(self->searchText, _txt);
|
{
|
||||||
}
|
return currentContact;
|
||||||
- (id)searchText {
|
|
||||||
if (self->searchText == nil)
|
|
||||||
[self setSearchText:[[[self context] request] formValueForKey:@"search"]];
|
|
||||||
return self->searchText;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (EOQualifier *)qualifier {
|
- (void) setSearchText: (NSString *) _txt
|
||||||
NSString *qs, *s;
|
{
|
||||||
|
ASSIGNCOPY (searchText, _txt);
|
||||||
s = [self searchText];
|
|
||||||
if ([s length] == 0)
|
|
||||||
return nil;
|
|
||||||
|
|
||||||
// TODO: just use qualifier vars
|
|
||||||
qs = [NSString stringWithFormat:
|
|
||||||
@"(sn isCaseInsensitiveLike: '%@*') OR "
|
|
||||||
@"(givenname isCaseInsensitiveLike: '%@*') OR "
|
|
||||||
@"(mail isCaseInsensitiveLike: '*%@*') OR "
|
|
||||||
@"(telephonenumber isCaseInsensitiveLike: '*%@*')",
|
|
||||||
s, s, s, s];
|
|
||||||
return [EOQualifier qualifierWithQualifierFormat:qs];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSString *)defaultSortKey {
|
- (id) searchText
|
||||||
return @"sn";
|
{
|
||||||
|
if (!searchText)
|
||||||
|
[self setSearchText: [self queryParameterForKey:@"search"]];
|
||||||
|
|
||||||
|
return searchText;
|
||||||
}
|
}
|
||||||
- (NSString *)sortKey {
|
|
||||||
|
- (NSString *) defaultSortKey
|
||||||
|
{
|
||||||
|
return @"fn";
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSString *) sortKey
|
||||||
|
{
|
||||||
NSString *s;
|
NSString *s;
|
||||||
|
|
||||||
s = [[[self context] request] formValueForKey:@"sort"];
|
s = [self queryParameterForKey: @"sort"];
|
||||||
return [s length] > 0 ? s : [self defaultSortKey];
|
if ([s length] == 0)
|
||||||
}
|
s = [self defaultSortKey];
|
||||||
- (EOSortOrdering *)sortOrdering {
|
|
||||||
SEL sel;
|
|
||||||
|
|
||||||
sel = [[[[self context] request] formValueForKey:@"desc"] boolValue]
|
return s;
|
||||||
? EOCompareCaseInsensitiveDescending
|
|
||||||
: EOCompareCaseInsensitiveAscending;
|
|
||||||
|
|
||||||
return [EOSortOrdering sortOrderingWithKey:[self sortKey] selector:sel];
|
|
||||||
}
|
|
||||||
- (NSArray *)sortOrderings {
|
|
||||||
return [NSArray arrayWithObjects:[self sortOrdering], nil];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSArray *)contactInfos {
|
- (NSComparisonResult) sortOrdering
|
||||||
// TODO: should be done in the backend, but for Agenor AB its OK here
|
{
|
||||||
NSArray *records;
|
return ([[self queryParameterForKey:@"desc"] boolValue]
|
||||||
EOQualifier *q;
|
? NSOrderedDescending
|
||||||
|
: NSOrderedAscending);
|
||||||
|
}
|
||||||
|
|
||||||
if (self->filteredRecords != nil)
|
- (NSArray *) contactInfos
|
||||||
return self->filteredRecords;
|
{
|
||||||
|
id <SOGoContactFolder> folder;
|
||||||
|
|
||||||
records = [[self clientObject] fetchCoreInfos];
|
folder = [self clientObject];
|
||||||
self->allRecords =
|
|
||||||
[[records sortedArrayUsingKeyOrderArray:[self sortOrderings]] retain];
|
|
||||||
|
|
||||||
if ((q = [self qualifier]) != nil) {
|
return [folder lookupContactsWithFilter: [self searchText]
|
||||||
[self debugWithFormat:@"qs: %@", q];
|
sortBy: [self sortKey]
|
||||||
self->filteredRecords =
|
ordering: [self sortOrdering]];
|
||||||
[[self->allRecords filteredArrayUsingQualifier:q] retain];
|
|
||||||
}
|
|
||||||
else
|
|
||||||
self->filteredRecords = [self->allRecords retain];
|
|
||||||
|
|
||||||
return self->filteredRecords;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* notifications */
|
/* notifications */
|
||||||
|
|
||||||
- (void)sleep {
|
- (void) sleep
|
||||||
[self->contact release]; self->contact = nil;
|
{
|
||||||
[self->allRecords release]; self->allRecords = nil;
|
if (searchText)
|
||||||
[self->filteredRecords release]; self->filteredRecords = nil;
|
{
|
||||||
|
[searchText release];
|
||||||
|
searchText = nil;
|
||||||
|
}
|
||||||
|
currentContact = nil;
|
||||||
|
// [allRecords release];
|
||||||
|
// allRecords = nil;
|
||||||
|
// [filteredRecords release];
|
||||||
|
// filteredRecords = nil;
|
||||||
[super sleep];
|
[super sleep];
|
||||||
}
|
}
|
||||||
|
|
||||||
/* actions */
|
/* actions */
|
||||||
|
|
||||||
- (BOOL)shouldTakeValuesFromRequest:(WORequest *)_rq inContext:(WOContext*)_c{
|
- (BOOL) shouldTakeValuesFromRequest: (WORequest *) _rq
|
||||||
|
inContext: (WOContext*) _c
|
||||||
|
{
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,24 @@
|
|||||||
|
|
||||||
#import <SOGoUI/UIxComponent.h>
|
#import <SOGoUI/UIxComponent.h>
|
||||||
|
|
||||||
|
@class NSArray;
|
||||||
|
@class SOGoContactFolder;
|
||||||
|
|
||||||
@interface UIxContactsListViewContainer : UIxComponent
|
@interface UIxContactsListViewContainer : UIxComponent
|
||||||
|
{
|
||||||
|
NSString *foldersPrefix;
|
||||||
|
id currentFolder;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void) setCurrentFolder: (id) folder;
|
||||||
|
|
||||||
|
- (NSString *) foldersPrefix;
|
||||||
|
|
||||||
|
- (NSArray *) contactFolders;
|
||||||
|
|
||||||
|
- (NSString *) contactFolderId;
|
||||||
|
- (NSString *) currentContactFolderId;
|
||||||
|
- (NSString *) currentContactFolderName;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|||||||
@@ -25,29 +25,84 @@
|
|||||||
|
|
||||||
#import <NGObjWeb/SoObjects.h>
|
#import <NGObjWeb/SoObjects.h>
|
||||||
|
|
||||||
#import <SoObjects/Contacts/SOGoContactFolders.h>
|
#import <SoObjects/Contacts/SOGoContactFolder.h>
|
||||||
|
|
||||||
#import "UIxContactsListViewContainer.h"
|
#import "UIxContactsListViewContainer.h"
|
||||||
|
|
||||||
|
@class SOGoContactFolders;
|
||||||
|
|
||||||
@implementation UIxContactsListViewContainer
|
@implementation UIxContactsListViewContainer
|
||||||
|
|
||||||
- (NSString *) contactFolderName
|
- (id) init
|
||||||
|
{
|
||||||
|
if ((self = [super init]))
|
||||||
|
{
|
||||||
|
foldersPrefix = nil;
|
||||||
|
}
|
||||||
|
|
||||||
|
return self;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void) setCurrentFolder: (id) folder
|
||||||
|
{
|
||||||
|
currentFolder = folder;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSString *) foldersPrefix
|
||||||
{
|
{
|
||||||
NSMutableArray *folders;
|
NSMutableArray *folders;
|
||||||
SOGoObject *currentObject;
|
SOGoObject *currentObject;
|
||||||
|
|
||||||
folders = [NSMutableArray new];
|
if (!foldersPrefix)
|
||||||
[folders autorelease];
|
|
||||||
|
|
||||||
currentObject = [self clientObject];
|
|
||||||
while (![currentObject isKindOfClass: [SOGoContactFolders class]])
|
|
||||||
{
|
{
|
||||||
[folders insertObject: [currentObject nameInContainer] atIndex: 0];
|
folders = [NSMutableArray new];
|
||||||
currentObject = [currentObject container];
|
[folders autorelease];
|
||||||
|
|
||||||
|
currentObject = [[self clientObject] container];
|
||||||
|
while (![currentObject isKindOfClass: [SOGoContactFolders class]])
|
||||||
|
{
|
||||||
|
[folders insertObject: [currentObject nameInContainer] atIndex: 0];
|
||||||
|
currentObject = [currentObject container];
|
||||||
|
}
|
||||||
|
|
||||||
|
foldersPrefix = [folders componentsJoinedByString: @"/"];
|
||||||
|
[foldersPrefix retain];
|
||||||
}
|
}
|
||||||
|
|
||||||
return [NSString stringWithFormat: @"/%@",
|
return foldersPrefix;
|
||||||
[folders componentsJoinedByString: @"/"]];
|
}
|
||||||
|
|
||||||
|
- (NSString *) contactFolderId
|
||||||
|
{
|
||||||
|
return [NSString stringWithFormat: @"%@/%@",
|
||||||
|
[self foldersPrefix],
|
||||||
|
[[self clientObject] nameInContainer]];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSArray *) contactFolders
|
||||||
|
{
|
||||||
|
SOGoContactFolders *folderContainer;
|
||||||
|
|
||||||
|
folderContainer = [[self clientObject] container];
|
||||||
|
|
||||||
|
return [folderContainer contactFolders];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSString *) currentContactFolderId
|
||||||
|
{
|
||||||
|
return [NSString stringWithFormat: @"%@/%@",
|
||||||
|
[self foldersPrefix],
|
||||||
|
[currentFolder nameInContainer]];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSString *) currentContactFolderName
|
||||||
|
{
|
||||||
|
return [self labelForKey: [currentFolder displayName]];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (BOOL) isFolderCurrent
|
||||||
|
{
|
||||||
|
return [[self currentContactFolderId] isEqualToString: [self contactFolderId]];
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
SOGoContactFolder = {
|
SOGoContactGCSFolder = {
|
||||||
slots = {
|
slots = {
|
||||||
toolbar = {
|
toolbar = {
|
||||||
protectedBy = "View";
|
protectedBy = "View";
|
||||||
@@ -41,13 +41,59 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
SOGoContactObject = {
|
SOGoContactLDAPFolder = {
|
||||||
slots = {
|
slots = {
|
||||||
toolbar = {
|
toolbar = {
|
||||||
protectedBy = "View";
|
protectedBy = "View";
|
||||||
value = "SOGoContactObject.toolbar";
|
value = "SOGoContactFolder.toolbar";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
methods = {
|
||||||
|
view = {
|
||||||
|
protectedBy = "View";
|
||||||
|
pageName = "UIxContactsListView";
|
||||||
|
};
|
||||||
|
new = {
|
||||||
|
protectedBy = "View";
|
||||||
|
pageName = "UIxContactEditor";
|
||||||
|
actionName = "new";
|
||||||
|
};
|
||||||
|
select = {
|
||||||
|
protectedBy = "View";
|
||||||
|
pageName = "UIxContactsSelectionView";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
SOGoContactGCSEntry = {
|
||||||
|
methods = {
|
||||||
|
view = {
|
||||||
|
protectedBy = "View";
|
||||||
|
pageName = "UIxContactView";
|
||||||
|
};
|
||||||
|
delete = {
|
||||||
|
protectedBy = "View";
|
||||||
|
pageName = "UIxContactView";
|
||||||
|
actionName = "delete";
|
||||||
|
};
|
||||||
|
edit = {
|
||||||
|
protectedBy = "View";
|
||||||
|
pageName = "UIxContactEditor";
|
||||||
|
};
|
||||||
|
save = {
|
||||||
|
protectedBy = "View";
|
||||||
|
pageName = "UIxContactEditor";
|
||||||
|
actionName = "save";
|
||||||
|
};
|
||||||
|
write = {
|
||||||
|
protectedBy = "View";
|
||||||
|
pageName = "UIxContactEditor";
|
||||||
|
actionName = "write";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
SOGoContactLDAPEntry = {
|
||||||
methods = {
|
methods = {
|
||||||
view = {
|
view = {
|
||||||
protectedBy = "View";
|
protectedBy = "View";
|
||||||
|
|||||||
Reference in New Issue
Block a user