2 Copyright (C) 2004-2005 SKYRIX Software AG
4 This file is part of OpenGroupware.org.
6 OGo is free software; you can redistribute it and/or modify it under
7 the terms of the GNU Lesser General Public License as published by the
8 Free Software Foundation; either version 2, or (at your option) any
11 OGo is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
14 License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with OGo; see the file COPYING. If not, write to the
18 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
22 #include "UIxContactsListViewBase.h"
23 #include <SOGoUI/SOGoJSStringFormatter.h>
25 @interface UIxContactsSelectionView : UIxContactsListViewBase
33 - (NSString *)getMail;
39 #include <SOGo/AgenorUserManager.h>
41 @implementation UIxContactsSelectionView
43 static SOGoJSStringFormatter *jsFormatter = nil;
46 static BOOL didInit = NO;
52 jsFormatter = [SOGoJSStringFormatter sharedFormatter];
56 [self->callback release];
60 - (NSString *)callback {
62 WORequest *r = [[self context] request];
63 self->callback = [[r formValueForKey:@"callback"] retain];
65 return self->callback;
68 - (NSString *)_getCN {
69 return [self->contact valueForKey:@"cn"];
73 return [jsFormatter stringByEscapingQuotesInString:[self _getCN]];
77 NSString *sn = [self->contact valueForKey:@"sn"];
78 return [jsFormatter stringByEscapingQuotesInString:sn];
81 - (NSString *)getMail {
82 return [self->contact valueForKey:@"mail"];
85 - (NSString *)getUID {
86 return [[AgenorUserManager sharedUserManager] getUIDForEmail:[self getMail]];
89 - (NSString *)jsOnClickCode {
90 /* callback parameters: (type, cn, dn, email, uid, sn) */
94 /* changed to : type, email, uid, sn, cn, dn */
95 static NSString *jsCode = \
96 @"javascript:opener.window.%@('', '%@', '%@', '%@', '%@', '');";
98 return [NSString stringWithFormat:jsCode,
107 // return [NSString stringWithFormat:jsCode,
115 @end /* UIxContactsInlineListView */