From 75172dabcfb619b8a37adab550acee870689fd7a Mon Sep 17 00:00:00 2001 From: znek Date: Mon, 18 Jul 2005 16:21:57 +0000 Subject: [PATCH] rewritten the UID selector to display CN's instead of UIDs git-svn-id: http://svn.opengroupware.org/SOGo/trunk@803 d1b88da0-ebda-0310-925b-ed51d893ca5b --- SOGo/SOGo.xcodeproj/project.pbxproj | 12 +++++-- SOGo/UI/Anais/AnaisUidSelector.m | 46 ++++++++++++++++++-------- SOGo/UI/Anais/ChangeLog | 5 +++ SOGo/UI/Anais/Version | 2 +- SOGo/UI/Templates/AnaisUidSelector.wox | 1 + SOGo/UI/Templates/ChangeLog | 8 +++++ 6 files changed, 56 insertions(+), 18 deletions(-) diff --git a/SOGo/SOGo.xcodeproj/project.pbxproj b/SOGo/SOGo.xcodeproj/project.pbxproj index 832ca153..24a51515 100644 --- a/SOGo/SOGo.xcodeproj/project.pbxproj +++ b/SOGo/SOGo.xcodeproj/project.pbxproj @@ -49,7 +49,7 @@ AD0712CA06C917A600A9EEF4 /* SOGoDateFormatter.h */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 2; lastKnownFileType = sourcecode.c.h; path = SOGoDateFormatter.h; sourceTree = ""; }; AD0712CB06C917A600A9EEF4 /* SOGoDateFormatter.m */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 2; lastKnownFileType = sourcecode.c.objc; path = SOGoDateFormatter.m; sourceTree = ""; }; AD07137606C926BF00A9EEF4 /* ChangeLog */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 8; lastKnownFileType = text; path = ChangeLog; sourceTree = ""; tabWidth = 8; usesTabs = 1; }; - AD0715CB06CA711600A9EEF4 /* AnaisUidSelector.m */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 2; lastKnownFileType = sourcecode.c.objc; path = AnaisUidSelector.m; sourceTree = ""; }; + AD0715CB06CA711600A9EEF4 /* AnaisUidSelector.m */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 2; lastKnownFileType = sourcecode.c.objc; path = AnaisUidSelector.m; sourceTree = ""; tabWidth = 2; }; AD071B3C06CCFA2000A9EEF4 /* iCalPerson+UIx.h */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 2; lastKnownFileType = sourcecode.c.h; path = "iCalPerson+UIx.h"; sourceTree = ""; }; AD071B3D06CCFA2000A9EEF4 /* iCalPerson+UIx.m */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 2; lastKnownFileType = sourcecode.c.objc; path = "iCalPerson+UIx.m"; sourceTree = ""; }; AD071C7D06CD214600A9EEF4 /* SOGoAptFormatter.h */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 2; lastKnownFileType = sourcecode.c.h; path = SOGoAptFormatter.h; sourceTree = ""; }; @@ -97,9 +97,12 @@ AD2FAA4708840BB8009A91E7 /* common.make */ = {isa = PBXFileReference; explicitFileType = sourcecode.make; fileEncoding = 5; path = common.make; sourceTree = ""; }; AD2FAA81088417AB009A91E7 /* AgenorUserDefaults.h */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.h; path = AgenorUserDefaults.h; sourceTree = ""; }; AD2FAA82088417AB009A91E7 /* AgenorUserDefaults.m */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.objc; path = AgenorUserDefaults.m; sourceTree = ""; }; + AD3D6100088BF4E600CBB51B /* UIxContactEditorBase.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = UIxContactEditorBase.h; sourceTree = ""; }; + AD3D6101088BF4E600CBB51B /* UIxContactEditorBase.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = UIxContactEditorBase.m; sourceTree = ""; }; + AD3D6102088BF4E600CBB51B /* UIxContactsListViewBase.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = UIxContactsListViewBase.h; sourceTree = ""; }; + AD3D6103088BF4E600CBB51B /* UIxContactsListViewBase.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = UIxContactsListViewBase.m; sourceTree = ""; }; AD494C6206F5EA6600E51EC9 /* UIxContactSelector.m */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 2; lastKnownFileType = sourcecode.c.objc; path = UIxContactSelector.m; sourceTree = ""; }; AD494C8E06F606F900E51EC9 /* UIxContactsSelectionView.m */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 2; lastKnownFileType = sourcecode.c.objc; path = UIxContactsSelectionView.m; sourceTree = ""; }; - AD494C9006F6072C00E51EC9 /* UIxContactsListView.h */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 2; lastKnownFileType = sourcecode.c.h; path = UIxContactsListView.h; sourceTree = ""; }; AD494D1806F6EB3A00E51EC9 /* SOGoMailAccount.h */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 2; lastKnownFileType = sourcecode.c.h; path = SOGoMailAccount.h; sourceTree = ""; }; AD494D1906F6EB3A00E51EC9 /* SOGoMailAccount.m */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 2; lastKnownFileType = sourcecode.c.objc; path = SOGoMailAccount.m; sourceTree = ""; }; AD494D1A06F6EB3A00E51EC9 /* SOGoMailAccounts.h */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 2; lastKnownFileType = sourcecode.c.h; path = SOGoMailAccounts.h; sourceTree = ""; }; @@ -964,7 +967,10 @@ ADDF4B6D06DCEBB400C4E7F8 /* Components */ = { isa = PBXGroup; children = ( - AD494C9006F6072C00E51EC9 /* UIxContactsListView.h */, + AD3D6100088BF4E600CBB51B /* UIxContactEditorBase.h */, + AD3D6101088BF4E600CBB51B /* UIxContactEditorBase.m */, + AD3D6102088BF4E600CBB51B /* UIxContactsListViewBase.h */, + AD3D6103088BF4E600CBB51B /* UIxContactsListViewBase.m */, ADDF4B7006DCEC4300C4E7F8 /* UIxContactsListView.m */, AD494C8E06F606F900E51EC9 /* UIxContactsSelectionView.m */, ADDF4B7306DCEC5200C4E7F8 /* UIxContactView.m */, diff --git a/SOGo/UI/Anais/AnaisUidSelector.m b/SOGo/UI/Anais/AnaisUidSelector.m index 99ce1c25..3afb9d3a 100644 --- a/SOGo/UI/Anais/AnaisUidSelector.m +++ b/SOGo/UI/Anais/AnaisUidSelector.m @@ -34,10 +34,12 @@ NSArray *calendarUIDs; NSString *uid; NSString *userUid; + NSString *userCN; } - (NSString *)prettyUid; - (NSString *)userUid; +- (NSString *)userCN; - (NSString *)_colorizedUid:(NSString *)_uid; - (NSString *)showHref; @@ -47,6 +49,9 @@ #include "common.h" #include +#include +#include +#include @implementation AnaisUidSelector @@ -77,13 +82,19 @@ return self->uid; } - (NSString *)prettyUid { + AgenorUserManager *um; + NSString *cn; + if([self->calendarUIDs objectAtIndex:0] == self->uid) - return [self _colorizedUid:self->uid]; - return [NSString stringWithFormat:@", %@", [self _colorizedUid:self->uid]]; + return [self _colorizedUid:[self userCN]]; + + um = [AgenorUserManager sharedUserManager]; + cn = [um getCNForUID:self->uid]; + return [NSString stringWithFormat:@", %@", [self _colorizedUid:cn]]; } - (NSString *)_colorizedUid:(NSString *)_uid { - if([_uid isEqualToString:[self userUid]]) { + if([_uid isEqualToString:[self userCN]]) { _uid = [NSString stringWithFormat:@"%@", _uid]; @@ -101,11 +112,17 @@ /* Helper */ - (NSString *)userUid { - if(self->userUid) - return self->userUid; - + if(!self->userUid) { ASSIGN(self->userUid, [[self user] login]); - return self->userUid; + } + return self->userUid; +} + +- (NSString *)userCN { + if (!self->userCN) { + ASSIGN(self->userCN, [[[self context] activeUser] cn]); + } + return self->userCN; } - (NSString *)calendarUIDString { @@ -144,7 +161,7 @@ @" td.setAttribute('style', 'visibility:hidden');\n" @"}\n" @"function addMeToo() {\n" - @" addUid('', '', '', '', '%@', '');\n" + @" addUid('', '', '%@', '', '%@', '');\n" @" var td = document.getElementById('addMeToo');\n" @" td.setAttribute('style', 'visibility:hidden');\n" @"}\n" @@ -152,11 +169,10 @@ @" clearUidList();\n" @" addMeToo();\n" @"}\n" - @"function addUidFromAnais() {\n" - @" var uid = arguments[2]; \n" - @" addUid('','','','',uid,''); \n" + @"function addUidFromAnais(type, email, uid, sn, cn, dn) {\n" + @" addUid(type, email, uid, sn, cn, dn); \n" @"}\n" - @"function addUid(division, cn, dn, email, uid, sn) {\n" + @"function addUid(type, email, uid, sn, cn, dn) {\n" @" if(!uid)\n" @" return;\n" @" var e = document.getElementById('anaisUIDString');\n" @@ -172,7 +188,7 @@ @" text = document.createTextNode(', ');\n" @" td.appendChild(text);\n" @" }\n" - @" text = document.createTextNode(uid);\n" + @" text = document.createTextNode(cn);\n" @" if(uid == '%@') {\n" @" var span = document.createElement('span');\n" @" span.setAttribute('class', 'anais_me');\n" @@ -190,7 +206,9 @@ @""; return [NSString stringWithFormat:script, - [self userUid], [self userUid]]; + [self userUid], + [self userCN], + [self userUid]]; } @end diff --git a/SOGo/UI/Anais/ChangeLog b/SOGo/UI/Anais/ChangeLog index b5ec7062..2bfca1c4 100644 --- a/SOGo/UI/Anais/ChangeLog +++ b/SOGo/UI/Anais/ChangeLog @@ -1,3 +1,8 @@ +2005-07-18 Marcus Mueller + + * AnaisUidSelector.m: rewritten to add the CN's to the displayed + list instead of the UIDs. (v0.9.22) + 2005-07-07 Marcus Mueller * v0.9.21 diff --git a/SOGo/UI/Anais/Version b/SOGo/UI/Anais/Version index 22150ddb..57a06811 100644 --- a/SOGo/UI/Anais/Version +++ b/SOGo/UI/Anais/Version @@ -1,3 +1,3 @@ # $Id: Version 165 2004-08-05 17:55:50Z znek $ -SUBMINOR_VERSION:=21 +SUBMINOR_VERSION:=22 diff --git a/SOGo/UI/Templates/AnaisUidSelector.wox b/SOGo/UI/Templates/AnaisUidSelector.wox index abf85770..efe50a4a 100644 --- a/SOGo/UI/Templates/AnaisUidSelector.wox +++ b/SOGo/UI/Templates/AnaisUidSelector.wox @@ -17,6 +17,7 @@ label:title="Search in Anais" const:windowId="UidSelector" const:callback="addUidFromAnais" + const:extraAttributes="cn,dn" /> + + * AnaisUidSelector.wox: added extraAttributes to pass on from + Anais which we need now + 2005-07-18 Helge Hess * MailerUI/UIxMailFilterPanel.wox: disabled auto-search field 2005-07-18 Marcus Mueller + * UIxContactsSelectionView.wox: fixed targets of sort actions and + form processing + * UIxMailAddressbook.wox: changed template text explaining why there's nothing to be rendered -- 2.39.5