]> err.no Git - scalable-opengroupware.org/commitdiff
rewritten the UID selector to display CN's instead of UIDs
authorznek <znek@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Mon, 18 Jul 2005 16:21:57 +0000 (16:21 +0000)
committerznek <znek@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Mon, 18 Jul 2005 16:21:57 +0000 (16:21 +0000)
git-svn-id: http://svn.opengroupware.org/SOGo/trunk@803 d1b88da0-ebda-0310-925b-ed51d893ca5b

SOGo/SOGo.xcodeproj/project.pbxproj
SOGo/UI/Anais/AnaisUidSelector.m
SOGo/UI/Anais/ChangeLog
SOGo/UI/Anais/Version
SOGo/UI/Templates/AnaisUidSelector.wox
SOGo/UI/Templates/ChangeLog

index 832ca1532bc9610d85ccc9a8b5613d8ada8db4f0..24a5151510fa5c2d6e8efb6d6d23e9be03bfafbb 100644 (file)
@@ -49,7 +49,7 @@
                AD0712CA06C917A600A9EEF4 /* SOGoDateFormatter.h */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 2; lastKnownFileType = sourcecode.c.h; path = SOGoDateFormatter.h; sourceTree = "<group>"; };
                AD0712CB06C917A600A9EEF4 /* SOGoDateFormatter.m */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 2; lastKnownFileType = sourcecode.c.objc; path = SOGoDateFormatter.m; sourceTree = "<group>"; };
                AD07137606C926BF00A9EEF4 /* ChangeLog */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 8; lastKnownFileType = text; path = ChangeLog; sourceTree = "<group>"; tabWidth = 8; usesTabs = 1; };
-               AD0715CB06CA711600A9EEF4 /* AnaisUidSelector.m */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 2; lastKnownFileType = sourcecode.c.objc; path = AnaisUidSelector.m; sourceTree = "<group>"; };
+               AD0715CB06CA711600A9EEF4 /* AnaisUidSelector.m */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 2; lastKnownFileType = sourcecode.c.objc; path = AnaisUidSelector.m; sourceTree = "<group>"; tabWidth = 2; };
                AD071B3C06CCFA2000A9EEF4 /* iCalPerson+UIx.h */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 2; lastKnownFileType = sourcecode.c.h; path = "iCalPerson+UIx.h"; sourceTree = "<group>"; };
                AD071B3D06CCFA2000A9EEF4 /* iCalPerson+UIx.m */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 2; lastKnownFileType = sourcecode.c.objc; path = "iCalPerson+UIx.m"; sourceTree = "<group>"; };
                AD071C7D06CD214600A9EEF4 /* SOGoAptFormatter.h */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 2; lastKnownFileType = sourcecode.c.h; path = SOGoAptFormatter.h; sourceTree = "<group>"; };
                AD2FAA4708840BB8009A91E7 /* common.make */ = {isa = PBXFileReference; explicitFileType = sourcecode.make; fileEncoding = 5; path = common.make; sourceTree = "<group>"; };
                AD2FAA81088417AB009A91E7 /* AgenorUserDefaults.h */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.h; path = AgenorUserDefaults.h; sourceTree = "<group>"; };
                AD2FAA82088417AB009A91E7 /* AgenorUserDefaults.m */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.objc; path = AgenorUserDefaults.m; sourceTree = "<group>"; };
+               AD3D6100088BF4E600CBB51B /* UIxContactEditorBase.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = UIxContactEditorBase.h; sourceTree = "<group>"; };
+               AD3D6101088BF4E600CBB51B /* UIxContactEditorBase.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = UIxContactEditorBase.m; sourceTree = "<group>"; };
+               AD3D6102088BF4E600CBB51B /* UIxContactsListViewBase.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = UIxContactsListViewBase.h; sourceTree = "<group>"; };
+               AD3D6103088BF4E600CBB51B /* UIxContactsListViewBase.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = UIxContactsListViewBase.m; sourceTree = "<group>"; };
                AD494C6206F5EA6600E51EC9 /* UIxContactSelector.m */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 2; lastKnownFileType = sourcecode.c.objc; path = UIxContactSelector.m; sourceTree = "<group>"; };
                AD494C8E06F606F900E51EC9 /* UIxContactsSelectionView.m */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 2; lastKnownFileType = sourcecode.c.objc; path = UIxContactsSelectionView.m; sourceTree = "<group>"; };
-               AD494C9006F6072C00E51EC9 /* UIxContactsListView.h */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 2; lastKnownFileType = sourcecode.c.h; path = UIxContactsListView.h; sourceTree = "<group>"; };
                AD494D1806F6EB3A00E51EC9 /* SOGoMailAccount.h */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 2; lastKnownFileType = sourcecode.c.h; path = SOGoMailAccount.h; sourceTree = "<group>"; };
                AD494D1906F6EB3A00E51EC9 /* SOGoMailAccount.m */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 2; lastKnownFileType = sourcecode.c.objc; path = SOGoMailAccount.m; sourceTree = "<group>"; };
                AD494D1A06F6EB3A00E51EC9 /* SOGoMailAccounts.h */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 2; lastKnownFileType = sourcecode.c.h; path = SOGoMailAccounts.h; sourceTree = "<group>"; };
                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 */,
index 99ce1c2529a7c0e422379e50a7c00a33c7df9c40..3afb9d3a85a1f50e6294fb1e73a122cf94aeef42 100644 (file)
     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 <NGObjWeb/SoUser.h>
+#include <SOGo/AgenorUserManager.h>
+#include <SOGo/SOGoUser.h>
+#include <SOGo/WOContext+Agenor.h>
 
 @implementation AnaisUidSelector
 
     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:@"<span class=\""
                                           @"anais_me\">%@</span>",
             _uid];
 /* 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 {
     @"  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"
     @"  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"
     @"    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"
     @"";
     
     return [NSString stringWithFormat:script,
-        [self userUid], [self userUid]];
+                                     [self userUid],
+                                     [self userCN],
+                                     [self userUid]];
 }
 
 @end
index b5ec70622408b112f50911380f0816aa46505d5d..2bfca1c409204090243ff74d8e0632973670e6ce 100644 (file)
@@ -1,3 +1,8 @@
+2005-07-18  Marcus Mueller  <znek@mulle-kybernetik.com>
+
+       * AnaisUidSelector.m: rewritten to add the CN's to the displayed
+         list instead of the UIDs. (v0.9.22)
+
 2005-07-07  Marcus Mueller  <znek@mulle-kybernetik.com>
 
        * v0.9.21
index 22150ddbc165afdc051e056f4ecd5c05d186409b..57a068113f8ac53fc285ec4edac31e094f676c2f 100644 (file)
@@ -1,3 +1,3 @@
 # $Id: Version 165 2004-08-05 17:55:50Z znek $
 
-SUBMINOR_VERSION:=21
+SUBMINOR_VERSION:=22
index abf85770d810f67b1eb6f57dec14f8ef442477b8..efe50a4ac56adddd0d7930826bc71b7310b46b9e 100644 (file)
@@ -17,6 +17,7 @@
                          label:title="Search in Anais"
                          const:windowId="UidSelector"
                          const:callback="addUidFromAnais"
+                         const:extraAttributes="cn,dn"
           />
           <var:component className="UIxContactSelector"
                          label:title="Search in Addressbook"
index 96be0a8c868a743dc2da4feb1e1919cd4bb40618..8803bc3977b1d0b3af4e2eb71065b17c9fcea0e2 100644 (file)
@@ -1,9 +1,17 @@
+2005-07-18  Marcus Mueller  <znek@mulle-kybernetik.com>
+
+       * AnaisUidSelector.wox: added extraAttributes to pass on from
+         Anais which we need now
+
 2005-07-18  Helge Hess  <helge.hess@opengroupware.org>
 
        * MailerUI/UIxMailFilterPanel.wox: disabled auto-search field
 
 2005-07-18  Marcus Mueller  <znek@mulle-kybernetik.com>
 
+       * UIxContactsSelectionView.wox: fixed targets of sort actions and
+         form processing
+
        * UIxMailAddressbook.wox: changed template text explaining why there's
          nothing to be rendered