mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-04-14 09:48:51 +00:00
Monotone-Parent: 502a9aa4532803bb1e5b3526f2e9e8e019a93abc
Monotone-Revision: 755524b00e9b962e6240a95f6bfdd559ca240f5a Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2006-08-14T20:41:04 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -9,16 +9,19 @@ ContactsUI_PRINCIPAL_CLASS = ContactsUIProduct
|
||||
ContactsUI_LANGUAGES = English French
|
||||
|
||||
ContactsUI_OBJC_FILES = \
|
||||
UIxContactsListViewBase.m \
|
||||
UIxContactEditorBase.m \
|
||||
UIxContactsListViewBase.m \
|
||||
UIxContactsListViewContainerBase.m \
|
||||
\
|
||||
ContactsUIProduct.m \
|
||||
UIxContactsFilterPanel.m \
|
||||
UIxContactView.m \
|
||||
UIxContactSelector.m \
|
||||
UIxContactEditor.m \
|
||||
UIxContactsListView.m \
|
||||
UIxContactsListViewContainer.m \
|
||||
UIxContactSelector.m \
|
||||
UIxContactsSelectionView.m \
|
||||
UIxContactsSelectionViewContainer.m \
|
||||
UIxContactFoldersView.m \
|
||||
|
||||
ContactsUI_RESOURCE_FILES += \
|
||||
|
||||
@@ -38,4 +38,19 @@
|
||||
return [self redirectToLocation: [folders defaultSourceName]];
|
||||
}
|
||||
|
||||
- (id) selectAction
|
||||
{
|
||||
SOGoContactFolders *folders;
|
||||
NSString *url, *selectorId;
|
||||
|
||||
folders = [self clientObject];
|
||||
selectorId = [self queryParameterForKey: @"selectorId"];
|
||||
|
||||
url = [NSString stringWithFormat: @"%@/select?selectorId=%@",
|
||||
[folders defaultSourceName],
|
||||
selectorId];
|
||||
|
||||
return [self redirectToLocation: url];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -20,23 +20,32 @@
|
||||
*/
|
||||
// $Id: UIxContactSelector.m 394 2004-10-14 08:47:35Z znek $
|
||||
|
||||
|
||||
#include <SOGoUI/UIxComponent.h>
|
||||
#import <SOGoUI/UIxComponent.h>
|
||||
#import <SOGo/AgenorUserManager.h>
|
||||
#import <Scheduler/iCalPerson+UIx.h>
|
||||
|
||||
@interface UIxContactSelector : UIxComponent
|
||||
{
|
||||
NSString *title;
|
||||
NSString *windowId;
|
||||
NSString *selectorId;
|
||||
NSString *callback;
|
||||
|
||||
NSArray *contacts;
|
||||
}
|
||||
|
||||
- (void)setTitle:(NSString *)_title;
|
||||
- (NSString *)title;
|
||||
- (void)setWindowId:(NSString *)_winId;
|
||||
- (NSString *)windowId;
|
||||
- (void)setSelectorId:(NSString *)_selId;
|
||||
- (NSString *)selectorId;
|
||||
- (void)setCallback:(NSString *)_callback;
|
||||
- (NSString *)callback;
|
||||
|
||||
- (void) setContacts: (NSArray *) _contacts;
|
||||
- (NSArray *) contacts;
|
||||
|
||||
- (NSString *)relativeContactsPath;
|
||||
|
||||
- (NSString *)jsFunctionName;
|
||||
@@ -81,6 +90,22 @@
|
||||
return self->windowId;
|
||||
}
|
||||
|
||||
- (void)setSelectorId:(NSString *)_selId {
|
||||
ASSIGNCOPY(selectorId, _selId);
|
||||
}
|
||||
|
||||
- (NSString *)selectorId {
|
||||
return selectorId;
|
||||
}
|
||||
|
||||
- (NSString *)selectorIdList {
|
||||
return [NSString stringWithFormat: @"uixselector-%@-uidList", selectorId];
|
||||
}
|
||||
|
||||
- (NSString *)selectorIdDisplay {
|
||||
return [NSString stringWithFormat: @"uixselector-%@-display", selectorId];
|
||||
}
|
||||
|
||||
- (void)setCallback:(NSString *)_callback {
|
||||
ASSIGNCOPY(self->callback, _callback);
|
||||
}
|
||||
@@ -120,4 +145,87 @@
|
||||
[self windowId]];
|
||||
}
|
||||
|
||||
- (void) setContacts: (NSArray *) _contacts
|
||||
{
|
||||
contacts = _contacts;
|
||||
}
|
||||
|
||||
- (NSArray *) contacts
|
||||
{
|
||||
return contacts;
|
||||
}
|
||||
|
||||
- (NSArray *) getICalPersonsFromValue: (NSString *) selectorValue
|
||||
{
|
||||
NSMutableArray *persons;
|
||||
NSEnumerator *uids;
|
||||
NSString *uid;
|
||||
|
||||
persons = [NSMutableArray new];
|
||||
[persons autorelease];
|
||||
|
||||
if ([selectorValue length] > 0)
|
||||
{
|
||||
uids = [[selectorValue componentsSeparatedByString: @","]
|
||||
objectEnumerator];
|
||||
uid = [uids nextObject];
|
||||
while (uid)
|
||||
{
|
||||
[persons addObject: [iCalPerson personWithUid: uid]];
|
||||
uid = [uids nextObject];
|
||||
}
|
||||
}
|
||||
|
||||
return persons;
|
||||
}
|
||||
|
||||
- (void) takeValuesFromRequest: (WORequest *) _rq
|
||||
inContext: (WOContext *) _ctx
|
||||
{
|
||||
contacts = [self getICalPersonsFromValue: [_rq formValueForKey: selectorId]];
|
||||
if ([contacts count] > 0)
|
||||
NSLog (@" got %i attendees: %@", [contacts count], contacts);
|
||||
else
|
||||
NSLog (@"go no attendees!");
|
||||
}
|
||||
|
||||
- (NSString *) initialParticipantIds
|
||||
{
|
||||
NSMutableArray *uids;
|
||||
NSEnumerator *persons;
|
||||
iCalPerson *person;
|
||||
AgenorUserManager *um;
|
||||
|
||||
um = [AgenorUserManager sharedUserManager];
|
||||
|
||||
uids = [NSMutableArray arrayWithCapacity: [contacts count]];
|
||||
persons = [contacts objectEnumerator];
|
||||
person = [persons nextObject];
|
||||
while (person)
|
||||
{
|
||||
[uids addObject: [um getUIDForICalPerson: person]];
|
||||
person = [persons nextObject];
|
||||
}
|
||||
|
||||
return [uids componentsJoinedByString: @","];
|
||||
}
|
||||
|
||||
- (NSString *) initialParticipants
|
||||
{
|
||||
NSMutableArray *participants;
|
||||
NSEnumerator *persons;
|
||||
iCalPerson *person;
|
||||
|
||||
participants = [NSMutableArray arrayWithCapacity: [contacts count]];
|
||||
persons = [contacts objectEnumerator];
|
||||
person = [persons nextObject];
|
||||
while (person)
|
||||
{
|
||||
[participants addObject: [person cn]];
|
||||
person = [persons nextObject];
|
||||
}
|
||||
|
||||
return [participants componentsJoinedByString: @","];
|
||||
}
|
||||
|
||||
@end /* UIxContactSelector */
|
||||
|
||||
32
UI/Contacts/UIxContactsListViewContainer.h
Normal file
32
UI/Contacts/UIxContactsListViewContainer.h
Normal file
@@ -0,0 +1,32 @@
|
||||
/* UIxContactsListViewContainer.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 UIXCONTACTSLISTVIEWCONTAINER_H
|
||||
#define UIXCONTACTSLISTVIEWCONTAINER_H
|
||||
|
||||
#import "UIxContactsListViewContainerBase.h"
|
||||
|
||||
@interface UIxContactsListViewContainer : UIxContactsListViewContainerBase
|
||||
|
||||
@end
|
||||
|
||||
#endif /* UIXCONTACTSLISTVIEWCONTAINER_H */
|
||||
27
UI/Contacts/UIxContactsListViewContainer.m
Normal file
27
UI/Contacts/UIxContactsListViewContainer.m
Normal file
@@ -0,0 +1,27 @@
|
||||
/* UIxContactsListViewContainer.m - 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.
|
||||
*/
|
||||
|
||||
#import "UIxContactsListViewContainer.h"
|
||||
|
||||
@implementation UIxContactsListViewContainer
|
||||
|
||||
@end
|
||||
@@ -27,89 +27,89 @@
|
||||
NSString *callback;
|
||||
}
|
||||
|
||||
- (NSString *)_getCN;
|
||||
- (NSString *)getCN;
|
||||
- (NSString *)getSN;
|
||||
- (NSString *)getMail;
|
||||
- (NSString *)getUID;
|
||||
// - (NSString *)_getCN;
|
||||
// - (NSString *)getCN;
|
||||
// - (NSString *)getSN;
|
||||
// - (NSString *)getMail;
|
||||
// - (NSString *)getUID;
|
||||
|
||||
@end
|
||||
|
||||
#include "common.h"
|
||||
#include <SOGo/AgenorUserManager.h>
|
||||
// #include "common.h"
|
||||
// #include <SOGo/AgenorUserManager.h>
|
||||
|
||||
@implementation UIxContactsSelectionView
|
||||
|
||||
static SOGoJSStringFormatter *jsFormatter = nil;
|
||||
// static SOGoJSStringFormatter *jsFormatter = nil;
|
||||
|
||||
+ (void)initialize {
|
||||
static BOOL didInit = NO;
|
||||
// + (void)initialize {
|
||||
// static BOOL didInit = NO;
|
||||
|
||||
if(didInit)
|
||||
return;
|
||||
// if(didInit)
|
||||
// return;
|
||||
|
||||
didInit = YES;
|
||||
jsFormatter = [SOGoJSStringFormatter sharedFormatter];
|
||||
}
|
||||
// didInit = YES;
|
||||
// jsFormatter = [SOGoJSStringFormatter sharedFormatter];
|
||||
// }
|
||||
|
||||
- (void)dealloc {
|
||||
[self->callback release];
|
||||
[super dealloc];
|
||||
}
|
||||
// - (void)dealloc {
|
||||
// [self->callback release];
|
||||
// [super dealloc];
|
||||
// }
|
||||
|
||||
- (NSString *)callback {
|
||||
if(!self->callback) {
|
||||
WORequest *r = [[self context] request];
|
||||
self->callback = [[r formValueForKey:@"callback"] retain];
|
||||
}
|
||||
return self->callback;
|
||||
}
|
||||
// - (NSString *)callback {
|
||||
// if(!self->callback) {
|
||||
// WORequest *r = [[self context] request];
|
||||
// self->callback = [[r formValueForKey:@"callback"] retain];
|
||||
// }
|
||||
// return self->callback;
|
||||
// }
|
||||
|
||||
- (NSString *)_getCN {
|
||||
return [self->contact valueForKey:@"cn"];
|
||||
}
|
||||
// - (NSString *)_getCN {
|
||||
// return [self->contact valueForKey:@"cn"];
|
||||
// }
|
||||
|
||||
- (NSString *)getCN {
|
||||
return [jsFormatter stringByEscapingQuotesInString:[self _getCN]];
|
||||
}
|
||||
// - (NSString *)getCN {
|
||||
// return [jsFormatter stringByEscapingQuotesInString:[self _getCN]];
|
||||
// }
|
||||
|
||||
- (NSString *)getSN {
|
||||
NSString *sn = [self->contact valueForKey:@"sn"];
|
||||
return [jsFormatter stringByEscapingQuotesInString:sn];
|
||||
}
|
||||
// - (NSString *)getSN {
|
||||
// NSString *sn = [self->contact valueForKey:@"sn"];
|
||||
// return [jsFormatter stringByEscapingQuotesInString:sn];
|
||||
// }
|
||||
|
||||
- (NSString *)getMail {
|
||||
return [self->contact valueForKey:@"mail"];
|
||||
}
|
||||
// - (NSString *)getMail {
|
||||
// return [self->contact valueForKey:@"mail"];
|
||||
// }
|
||||
|
||||
- (NSString *)getUID {
|
||||
return [[AgenorUserManager sharedUserManager] getUIDForEmail:[self getMail]];
|
||||
}
|
||||
// - (NSString *)getUID {
|
||||
// return [[AgenorUserManager sharedUserManager] getUIDForEmail:[self getMail]];
|
||||
// }
|
||||
|
||||
- (NSString *)jsOnClickCode {
|
||||
/* callback parameters: (type, cn, dn, email, uid, sn) */
|
||||
// - (NSString *)jsOnClickCode {
|
||||
// /* callback parameters: (type, cn, dn, email, uid, sn) */
|
||||
|
||||
|
||||
|
||||
/* changed to : type, email, uid, sn, cn, dn */
|
||||
static NSString *jsCode = \
|
||||
@"javascript:opener.window.%@('', '%@', '%@', '%@', '%@', '');";
|
||||
// /* changed to : type, email, uid, sn, cn, dn */
|
||||
// static NSString *jsCode = \
|
||||
// @"javascript:opener.window.%@('', '%@', '%@', '%@', '%@', '');";
|
||||
|
||||
return [NSString stringWithFormat:jsCode,
|
||||
[self callback],
|
||||
[self getMail],
|
||||
[self getUID],
|
||||
[self getSN],
|
||||
[self getCN]];
|
||||
// return [NSString stringWithFormat:jsCode,
|
||||
// [self callback],
|
||||
// [self getMail],
|
||||
// [self getUID],
|
||||
// [self getSN],
|
||||
// [self getCN]];
|
||||
|
||||
|
||||
|
||||
// return [NSString stringWithFormat:jsCode,
|
||||
// [self callback],
|
||||
// [self getCN],
|
||||
// [self getMail],
|
||||
// [self getUID],
|
||||
// [self getSN]];
|
||||
}
|
||||
// // return [NSString stringWithFormat:jsCode,
|
||||
// // [self callback],
|
||||
// // [self getCN],
|
||||
// // [self getMail],
|
||||
// // [self getUID],
|
||||
// // [self getSN]];
|
||||
// }
|
||||
|
||||
@end /* UIxContactsInlineListView */
|
||||
|
||||
32
UI/Contacts/UIxContactsSelectionViewContainer.h
Normal file
32
UI/Contacts/UIxContactsSelectionViewContainer.h
Normal file
@@ -0,0 +1,32 @@
|
||||
/* UIxContactsSelectionViewContainer.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 UIXCONTACTSSELECTIONVIEWCONTAINER_H
|
||||
#define UIXCONTACTSSELECTIONVIEWCONTAINER_H
|
||||
|
||||
#import "UIxContactsListViewContainerBase.h"
|
||||
|
||||
@interface UIxContactsSelectionViewContainer : UIxContactsListViewContainerBase
|
||||
|
||||
@end
|
||||
|
||||
#endif /* UIXCONTACTSSELECTIONVIEWCONTAINER_H */
|
||||
27
UI/Contacts/UIxContactsSelectionViewContainer.m
Normal file
27
UI/Contacts/UIxContactsSelectionViewContainer.m
Normal file
@@ -0,0 +1,27 @@
|
||||
/* UIxContactsSelectionViewContainer.m - 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.
|
||||
*/
|
||||
|
||||
#import "UIxContactsSelectionViewContainer.h"
|
||||
|
||||
@implementation UIxContactsSelectionViewContainer
|
||||
|
||||
@end
|
||||
@@ -14,6 +14,11 @@
|
||||
protectedBy = "View";
|
||||
pageName = "UIxContactFoldersView";
|
||||
};
|
||||
select = {
|
||||
protectedBy = "View";
|
||||
pageName = "UIxContactFoldersView";
|
||||
actionName = "select";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -37,6 +42,7 @@
|
||||
select = {
|
||||
protectedBy = "View";
|
||||
pageName = "UIxContactsSelectionView";
|
||||
actionName = "select";
|
||||
};
|
||||
};
|
||||
};
|
||||
@@ -61,6 +67,7 @@
|
||||
select = {
|
||||
protectedBy = "View";
|
||||
pageName = "UIxContactsSelectionView";
|
||||
actionName = "select";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user