]> err.no Git - scalable-opengroupware.org/commitdiff
new formatters, new user manager
authorznek <znek@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Fri, 13 Aug 2004 17:44:00 +0000 (17:44 +0000)
committerznek <znek@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Fri, 13 Aug 2004 17:44:00 +0000 (17:44 +0000)
git-svn-id: http://svn.opengroupware.org/SOGo/trunk@205 d1b88da0-ebda-0310-925b-ed51d893ca5b

18 files changed:
SOGo/SOGo.xcode/project.pbxproj
SOGo/UI/SOGoUI/ChangeLog
SOGo/UI/SOGoUI/GNUmakefile
SOGo/UI/SOGoUI/SOGoAptFormatter.h [new file with mode: 0644]
SOGo/UI/SOGoUI/SOGoAptFormatter.m [new file with mode: 0644]
SOGo/UI/SOGoUI/UIxComponent.m
SOGo/UI/SOGoUI/Version
SOGo/UI/Scheduler/ChangeLog
SOGo/UI/Scheduler/UIxAppointmentEditor.m
SOGo/UI/Scheduler/UIxCalDayOverview.m
SOGo/UI/Scheduler/UIxCalView.h
SOGo/UI/Scheduler/UIxCalView.m
SOGoLogic/AgenorUserManager.h [new file with mode: 0644]
SOGoLogic/AgenorUserManager.m [new file with mode: 0644]
SOGoLogic/ChangeLog
SOGoLogic/GNUmakefile
SOGoLogic/GNUmakefile.preamble
SOGoLogic/Version

index 4a20be5da75e27b12f8d26deb00d23da4640bc3e..312d1459fa41d548d0000856b7a008e68f98d025 100644 (file)
                        refType = 4;
                        sourceTree = "<group>";
                };
+               AD071B3C06CCFA2000A9EEF4 = {
+                       fileEncoding = 4;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       path = "iCalPerson+UIx.h";
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               AD071B3D06CCFA2000A9EEF4 = {
+                       fileEncoding = 4;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.objc;
+                       path = "iCalPerson+UIx.m";
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               AD071C7D06CD214600A9EEF4 = {
+                       fileEncoding = 4;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       path = SOGoAptFormatter.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               AD071C7E06CD214700A9EEF4 = {
+                       fileEncoding = 4;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.objc;
+                       path = SOGoAptFormatter.m;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               AD071CE306CD2AB800A9EEF4 = {
+                       children = (
+                               AD071CE806CD2ACE00A9EEF4,
+                               AD071CE706CD2ACE00A9EEF4,
+                               AD071CE506CD2ACE00A9EEF4,
+                               AD071CF006CD2ACE00A9EEF4,
+                               AD071CF406CD2B0400A9EEF4,
+                               AD071CF706CD2B1900A9EEF4,
+                       );
+                       isa = PBXGroup;
+                       name = Logic;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               AD071CE506CD2ACE00A9EEF4 = {
+                       fileEncoding = 4;
+                       indentWidth = 8;
+                       isa = PBXFileReference;
+                       lastKnownFileType = text;
+                       name = ChangeLog;
+                       path = ../SOGoLogic/ChangeLog;
+                       refType = 4;
+                       sourceTree = "<group>";
+                       tabWidth = 8;
+                       usesTabs = 1;
+               };
+               AD071CE606CD2ACE00A9EEF4 = {
+                       fileEncoding = 4;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       path = common.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               AD071CE706CD2ACE00A9EEF4 = {
+                       fileEncoding = 4;
+                       isa = PBXFileReference;
+                       lastKnownFileType = text;
+                       name = COPYING;
+                       path = ../SOGoLogic/COPYING;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               AD071CE806CD2ACE00A9EEF4 = {
+                       fileEncoding = 4;
+                       isa = PBXFileReference;
+                       lastKnownFileType = text;
+                       name = COPYRIGHT;
+                       path = ../SOGoLogic/COPYRIGHT;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               AD071CE906CD2ACE00A9EEF4 = {
+                       explicitFileType = sourcecode.make;
+                       fileEncoding = 4;
+                       indentWidth = 8;
+                       isa = PBXFileReference;
+                       path = GNUmakefile;
+                       refType = 4;
+                       sourceTree = "<group>";
+                       tabWidth = 8;
+               };
+               AD071CEA06CD2ACE00A9EEF4 = {
+                       explicitFileType = sourcecode.make;
+                       fileEncoding = 4;
+                       indentWidth = 8;
+                       isa = PBXFileReference;
+                       path = GNUmakefile.preamble;
+                       refType = 4;
+                       sourceTree = "<group>";
+                       tabWidth = 8;
+               };
+               AD071CEC06CD2ACE00A9EEF4 = {
+                       fileEncoding = 4;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       path = SOGoAppointment.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               AD071CED06CD2ACE00A9EEF4 = {
+                       fileEncoding = 4;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.objc;
+                       path = SOGoAppointment.m;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               AD071CF006CD2ACE00A9EEF4 = {
+                       fileEncoding = 4;
+                       isa = PBXFileReference;
+                       lastKnownFileType = text;
+                       name = Version;
+                       path = ../SOGoLogic/Version;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               AD071CF406CD2B0400A9EEF4 = {
+                       children = (
+                               AD071CE906CD2ACE00A9EEF4,
+                               AD071CEA06CD2ACE00A9EEF4,
+                       );
+                       isa = PBXGroup;
+                       name = Makefiles;
+                       path = ../SOGoLogic;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               AD071CF706CD2B1900A9EEF4 = {
+                       children = (
+                               AD071CE606CD2ACE00A9EEF4,
+                               AD071CEC06CD2ACE00A9EEF4,
+                               AD071CED06CD2ACE00A9EEF4,
+                               AD071D1206CD2BCB00A9EEF4,
+                               AD071D1306CD2BCB00A9EEF4,
+                       );
+                       isa = PBXGroup;
+                       name = Classes;
+                       path = ../SOGoLogic;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               AD071D1206CD2BCB00A9EEF4 = {
+                       fileEncoding = 4;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       path = AgenorUserManager.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               AD071D1306CD2BCB00A9EEF4 = {
+                       fileEncoding = 4;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.objc;
+                       path = AgenorUserManager.m;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
                AD152B6F06AC159A002375D2 = {
                        fileEncoding = 4;
                        isa = PBXFileReference;
                                AD6BCF11069D77E9003664CD,
                                AD0712CA06C917A600A9EEF4,
                                AD0712CB06C917A600A9EEF4,
+                               AD071C7D06CD214600A9EEF4,
+                               AD071C7E06CD214700A9EEF4,
                        );
                        isa = PBXGroup;
                        path = SOGoUI;
                                E872058F0692E3D00099CBBD,
                                E87205F50692E3D00099CBBD,
                                E87206A40692E3D10099CBBD,
+                               AD071CE306CD2AB800A9EEF4,
                        );
                        isa = PBXGroup;
                        refType = 4;
                                E872090B0692E3D30099CBBD,
                                E87209020692E3D30099CBBD,
                                E87209030692E3D30099CBBD,
+                               AD071B3C06CCFA2000A9EEF4,
+                               AD071B3D06CCFA2000A9EEF4,
                        );
                        isa = PBXGroup;
                        name = Classes;
index f545d9d8bca2b49b08735702d0dc401a63c2d2f9..392ec75dbbdee9f4e32d42469629bd770aee4bd8 100644 (file)
@@ -1,3 +1,13 @@
+2004-08-13  Marcus Mueller  <znek@mulle-kybernetik.com>
+
+       * v0.9.8
+
+       * SOGoAptFormatter.[hm]: added new formatter for appointments.
+
+       * UIxComponent.m: added warning.
+
+       * GNUmakefile: added SOGoAptFormatter.[hm]
+
 2004-08-11  Marcus Mueller  <znek@mulle-kybernetik.com>
 
        * UIxComponent.[hm]: added -SoUser (v0.9.7)
index 860efb4f82cbcbe15c41c215b720c150ad4fbd75..ff9bc807615e6dc8805f73842ead440b387421a2 100644 (file)
@@ -7,13 +7,15 @@ LIBRARY_NAME = libSOGoUI
 libSOGoUI_HEADER_FILES_DIR         = .
 libSOGoUI_HEADER_FILES_INSTALL_DIR = /SOGoUI
 
-libSOGoUI_HEADER_FILES +=   \
-       UIxComponent.h      \
-       SOGoDateFormatter.h \
+libSOGoUI_HEADER_FILES +=      \
+       UIxComponent.h          \
+       SOGoDateFormatter.h     \
+       SOGoAptFormatter.h      \
 
-libSOGoUI_OBJC_FILES +=     \
-       UIxComponent.m      \
-       SOGoDateFormatter.m \
+libSOGoUI_OBJC_FILES +=                \
+       UIxComponent.m          \
+       SOGoDateFormatter.m     \
+       SOGoAptFormatter.m      \
 
 # make
 
diff --git a/SOGo/UI/SOGoUI/SOGoAptFormatter.h b/SOGo/UI/SOGoUI/SOGoAptFormatter.h
new file mode 100644 (file)
index 0000000..62e14b1
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+  Copyright (C) 2000-2004 SKYRIX Software AG
+
+  This file is part of OGo
+
+  OGo is free software; you can redistribute it and/or modify it under
+  the terms of the GNU Lesser General Public License as published by the
+  Free Software Foundation; either version 2, or (at your option) any
+  later version.
+
+  OGo 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 Lesser General Public
+  License for more details.
+
+  You should have received a copy of the GNU Lesser General Public
+  License along with OGo; see the file COPYING.  If not, write to the
+  Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+  02111-1307, USA.
+*/
+// $Id$
+
+
+#ifndef        __SOGoAptFormatter_H_
+#define        __SOGoAptFormatter_H_
+
+
+#include <Foundation/Foundation.h>
+
+
+@interface SOGoAptFormatter : NSFormatter
+{
+    NSTimeZone *tz;
+    SEL formatAction;
+}
+
+- (id)initWithDisplayTimeZone:(NSTimeZone *)_tz;
+
+- (void)setTooltip;
+- (void)setFullDetails;
+
+@end
+
+#endif /* __SOGoAptFormatter_H_ */
diff --git a/SOGo/UI/SOGoUI/SOGoAptFormatter.m b/SOGo/UI/SOGoUI/SOGoAptFormatter.m
new file mode 100644 (file)
index 0000000..71cd80a
--- /dev/null
@@ -0,0 +1,154 @@
+/*
+  Copyright (C) 2000-2004 SKYRIX Software AG
+
+  This file is part of OGo
+
+  OGo is free software; you can redistribute it and/or modify it under
+  the terms of the GNU Lesser General Public License as published by the
+  Free Software Foundation; either version 2, or (at your option) any
+  later version.
+
+  OGo 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 Lesser General Public
+  License for more details.
+
+  You should have received a copy of the GNU Lesser General Public
+  License along with OGo; see the file COPYING.  If not, write to the
+  Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+  02111-1307, USA.
+*/
+// $Id$
+
+
+#import "SOGoAptFormatter.h"
+
+
+@interface SOGoAptFormatter (PrivateAPI)
+- (NSString *)shortTitleForApt:(id)_apt;
+- (NSTimeZone *)displayTZ;
+@end
+
+@implementation SOGoAptFormatter
+
+- (id)initWithDisplayTimeZone:(NSTimeZone *)_tz {
+    self = [super init];
+    if(self) {
+        ASSIGN(self->tz, _tz);
+        [self setFullDetails];
+    }
+    return self;
+}
+
+- (void)dealloc {
+    [self->tz release];
+    [super dealloc];
+}
+
+- (void)setTooltip {
+    self->formatAction = @selector(tooltipForApt:);
+}
+
+- (void)setFullDetails {
+    self->formatAction = @selector(fullDetailsForApt:);
+}
+
+- (NSString *)stringForObjectValue:(id)_obj {
+    return [self performSelector:self->formatAction
+                      withObject:_obj];
+}
+
+
+/* Helpers */
+
+- (NSString *)shortTitleForApt:(id)_apt {
+    NSString *title;
+    
+    title = [_apt valueForKey:@"title"];
+    if ([title length] > 12)
+        title = [[title substringToIndex:11] stringByAppendingString:@"..."];
+    
+    return title;
+}
+
+/* Private */
+
+- (NSTimeZone *)displayTZ {
+    return self->tz;
+}
+
+- (NSString *)fullDetailsForApt:(id)_apt {
+    NSCalendarDate *startDate, *endDate;
+    NSMutableString *aptDescr;
+    NSString *s;
+    BOOL spansRange;
+    
+    spansRange = NO;
+    startDate = [_apt valueForKey:@"startDate"];
+    [startDate setTimeZone:[self displayTZ]];
+    endDate = [_apt valueForKey:@"endDate"];
+    if(endDate != nil) {
+        [endDate setTimeZone:[self displayTZ]];
+        spansRange = ![endDate isEqualToDate:startDate];
+    }
+    aptDescr = [[NSMutableString alloc] init];
+    [aptDescr appendFormat:@"%02i:%02i",
+        [startDate hourOfDay],
+        [startDate minuteOfHour]];
+    if(spansRange) {
+        [aptDescr appendFormat:@", %02i:%02i",
+            [endDate hourOfDay],
+            [endDate minuteOfHour]];
+    }
+    s = [_apt valueForKey:@"location"];
+    if(s) {
+        if([s length] > 12) {
+            s = [NSString stringWithFormat:@"%@...",
+                [s substringToIndex:11]];
+        }
+        [aptDescr appendFormat:@" (%@)", s];
+    }
+    s = [_apt valueForKey:@"title"];
+    if(s) {
+        [aptDescr appendFormat:@"<br />%@",
+            [self shortTitleForApt:_apt]];
+    }
+    return [aptDescr autorelease];
+}
+
+- (NSString *)tooltipForApt:(id)_apt {
+    NSCalendarDate *startDate, *endDate;
+    NSMutableString *aptDescr;
+    NSString *s;
+    BOOL spansRange;
+    
+    spansRange = NO;
+    startDate = [_apt valueForKey:@"startDate"];
+    [startDate setTimeZone:[self displayTZ]];
+    endDate = [_apt valueForKey:@"endDate"];
+    if(endDate != nil) {
+        [endDate setTimeZone:[self displayTZ]];
+        spansRange = ![endDate isEqualToDate:startDate];
+    }
+    aptDescr = [[NSMutableString alloc] init];
+    [aptDescr appendString:@"appointment"];
+    [aptDescr appendFormat:@"\n%02i:%02i",
+        [startDate hourOfDay],
+        [startDate minuteOfHour]];
+    if(spansRange) {
+        [aptDescr appendFormat:@" - %02i:%02i",
+            [endDate hourOfDay],
+            [endDate minuteOfHour]];
+    }
+    s = [_apt valueForKey:@"title"];
+    if(s) {
+        [aptDescr appendFormat:@"\n%@", s];
+    }
+    s = [_apt valueForKey:@"location"];
+    if(s) {
+        [aptDescr appendFormat:@"\n%@", s];
+    }
+    return [aptDescr autorelease];
+}
+
+@end
index bb92702021984838fbc28eb8d891ffd786b8027d..ccbcba10ef25b46b2628a5c518828a1f06cbae25 100644 (file)
@@ -266,7 +266,9 @@ static NSMutableArray *abbrMonthLabelKeys = nil;
     // TODO: better use a SoUser formatter?
     NSString *s;
     NSRange  r;
-    
+
+#warning !! USE USER MANAGER INSTEAD!
+
     s = [[self user] login];
     if ([s length] < 10)
         return s;
index cab297dce179f93daddb8c8e20c17af86c0b5d3b..28292b549059af8a6800e33ac74ed5ab727067ed 100644 (file)
@@ -1,3 +1,3 @@
 # $Id$
 
-SUBMINOR_VERSION:=7
+SUBMINOR_VERSION:=8
index ffdd4deee3ee779387c12d7605e275b059cbf097..317a88bdd25b47548d61195e3d61c578b84f97dd 100644 (file)
@@ -1,3 +1,13 @@
+2004-08-13  Marcus Mueller  <znek@mulle-kybernetik.com>
+
+       * v0.9.34
+
+       * UIxCalView.[hm]: use new formatters.
+
+       * UIxCalDayOverview.m: fixed build warnings.
+
+       * UIxAppointmentEditor.m: added warnings.
+
 2004-08-13  Marcus Mueller  <znek@mulle-kybernetik.com>
 
        * v0.9.33
index 36d4da4a9dd93485c1177d3079b9f31d02cb8f0d..dce7694d57830b12a336c3cd594b5c43bda60fad 100644 (file)
     NSString *uid;
     NSRange r;
 
+#warning !! USE USER MANAGER INSTEAD!
     uid = [[self user] login];
     r = [uid rangeOfString:@"@"];
     if(r.length > 0)
index 3e3db0c77131cf5f0c1d7ecd873a7dc744d72004..3539b7088b37e44ddd05963fa7bd86d4d903537f 100644 (file)
@@ -22,6 +22,7 @@
 
 
 #include "UIxCalDayOverview.h"
+#include "common.h"
 
 @implementation UIxCalDayOverview
 
index d5bbff95e69f976f70f700146c34e90d7a9ae3b8..daac43dea120b169c2642d99cb1f35b8b23d8e7f 100644 (file)
@@ -12,7 +12,7 @@
   a SOPE clientObject (which usually is an SOGoAppointmentFolder).
 */
 
-@class NSString, NSArray, NSDictionary, NSCalendarDate;
+@class NSString, NSArray, NSDictionary, NSCalendarDate, SOGoAptFormatter;
 
 @interface UIxCalView : UIxComponent
 {
@@ -20,6 +20,8 @@
   NSArray        *allDayApts;
   id             appointment;
   NSCalendarDate *currentDay;
+  SOGoAptFormatter *aptFormatter;
+  SOGoAptFormatter *aptTooltipFormatter;
 }
 
 /* accessors */
@@ -35,6 +37,8 @@
 - (NSDictionary *)aptTypeDict;
 - (NSString *)aptTypeLabel;
 - (NSString *)aptTypeIcon;
+- (SOGoAptFormatter *)aptFormatter;
+
 - (NSString *)shortTextForApt;
 - (NSString *)shortTitleForApt;
 - (NSString *)tooltipForApt;
index b08b88cc5dcc2fb3b8a3539f086774a833caf9cc..8aa76178a688cf3e5f4b510a447bd570cc6192b2 100644 (file)
@@ -6,6 +6,7 @@
 #include <OGoContentStore/OCSFolder.h>
 #include "SoObjects/Appointments/SOGoAppointmentFolder.h"
 #include <NGObjWeb/SoUser.h>
+#include <SOGoUI/SOGoAptFormatter.h>
 
 @interface UIxCalView (PrivateAPI)
 - (NSString *)_userFolderURI;
@@ -23,8 +24,10 @@ static BOOL shouldDisplayWeekend = NO;
 - (void)dealloc {
   [self->appointments release];
   [self->allDayApts release];
-  [self->appointment  release];
-  [self->currentDay   release];
+  [self->appointment release];
+  [self->currentDay release];
+  [self->aptFormatter release];
+  [self->aptTooltipFormatter release];
   [super dealloc];
 }
 
@@ -56,45 +59,27 @@ static BOOL shouldDisplayWeekend = NO;
     return @"";
 }
 
+- (SOGoAptFormatter *)aptFormatter {
+    if(self->aptFormatter)
+        return self->aptFormatter;
+    self->aptFormatter = [[SOGoAptFormatter alloc]
+                         initWithDisplayTimeZone:[self viewTimeZone]];
+    [self->aptFormatter setFullDetails];
+    return self->aptFormatter;
+}
+
+- (SOGoAptFormatter *)aptTooltipFormatter {
+    if(self->aptTooltipFormatter)
+        return self->aptTooltipFormatter;
+    self->aptTooltipFormatter = [[SOGoAptFormatter alloc]
+                                initWithDisplayTimeZone:[self viewTimeZone]];
+    [self->aptTooltipFormatter setTooltip];
+    return self->aptTooltipFormatter;
+}
+
+/* TODO: remove this */
 - (NSString *)shortTextForApt {
-    NSCalendarDate *startDate, *endDate;
-    NSMutableString *aptDescr;
-    NSString *s;
-    BOOL spansRange;
-    id apt;
-    
-    apt = [self appointment];
-    spansRange = NO;
-    startDate = [apt valueForKey:@"startDate"];
-    [startDate setTimeZone:[self viewTimeZone]];
-    endDate = [apt valueForKey:@"endDate"];
-    if(endDate != nil) {
-        [endDate setTimeZone:[self viewTimeZone]];
-        spansRange = ![endDate isEqualToDate:startDate];
-    }
-    aptDescr = [[NSMutableString alloc] init];
-    [aptDescr appendFormat:@"%02i:%02i",
-        [startDate hourOfDay],
-        [startDate minuteOfHour]];
-    if(spansRange) {
-        [aptDescr appendFormat:@", %02i:%02i",
-            [endDate hourOfDay],
-            [endDate minuteOfHour]];
-    }
-    s = [apt valueForKey:@"location"];
-    if(s) {
-        if([s length] > 12) {
-            s = [NSString stringWithFormat:@"%@...",
-                [s substringToIndex:11]];
-        }
-        [aptDescr appendFormat:@" (%@)", s];
-    }
-    s = [apt valueForKey:@"title"];
-    if(s) {
-        [aptDescr appendFormat:@"<br />%@",
-            [self shortTitleForApt]];
-    }
-    return [aptDescr autorelease];
+    return [[self aptFormatter] stringForObjectValue:self->appointment];
 }
 
 - (NSString *)shortTitleForApt {
@@ -107,41 +92,9 @@ static BOOL shouldDisplayWeekend = NO;
   return title;
 }
 
+/* TODO: remove this */
 - (NSString *)tooltipForApt {
-    NSCalendarDate *startDate, *endDate;
-    NSMutableString *aptDescr;
-    NSString *s;
-    BOOL spansRange;
-    id apt;
-    
-    apt = [self appointment];
-    spansRange = NO;
-    startDate = [apt valueForKey:@"startDate"];
-    [startDate setTimeZone:[self viewTimeZone]];
-    endDate = [apt valueForKey:@"endDate"];
-    if(endDate != nil) {
-        [endDate setTimeZone:[self viewTimeZone]];
-        spansRange = ![endDate isEqualToDate:startDate];
-    }
-    aptDescr = [[NSMutableString alloc] init];
-    [aptDescr appendString:[self labelForKey:@"appointment"]];
-    [aptDescr appendFormat:@"\n%02i:%02i",
-        [startDate hourOfDay],
-        [startDate minuteOfHour]];
-    if(spansRange) {
-        [aptDescr appendFormat:@" - %02i:%02i",
-            [endDate hourOfDay],
-            [endDate minuteOfHour]];
-    }
-    s = [apt valueForKey:@"title"];
-    if(s) {
-        [aptDescr appendFormat:@"\n%@", s];
-    }
-    s = [apt valueForKey:@"location"];
-    if(s) {
-        [aptDescr appendFormat:@"\n%@", s];
-    }
-    return [aptDescr autorelease];
+    return [[self aptTooltipFormatter] stringForObjectValue:self->appointment];
 }
 
 - (NSCalendarDate *)referenceDateForFormatter {
diff --git a/SOGoLogic/AgenorUserManager.h b/SOGoLogic/AgenorUserManager.h
new file mode 100644 (file)
index 0000000..6dff70e
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+  Copyright (C) 2000-2004 SKYRIX Software AG
+
+  This file is part of OGo
+
+  OGo is free software; you can redistribute it and/or modify it under
+  the terms of the GNU Lesser General Public License as published by the
+  Free Software Foundation; either version 2, or (at your option) any
+  later version.
+
+  OGo 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 Lesser General Public
+  License for more details.
+
+  You should have received a copy of the GNU Lesser General Public
+  License along with OGo; see the file COPYING.  If not, write to the
+  Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+  02111-1307, USA.
+*/
+// $Id$
+
+
+#ifndef        __AgenorUserManager_H_
+#define        __AgenorUserManager_H_
+
+
+#import <Foundation/Foundation.h>
+
+
+@interface AgenorUserManager : NSObject
+{
+
+}
+
++ (id)sharedUserManager;
+
+- (NSString *)getUIDForEMail:(NSString *)_email;
+- (NSString *)getEmailForUID:(NSString *)_uid;
+
+@end
+
+#endif /* __AgenorUserManager_H_ */
diff --git a/SOGoLogic/AgenorUserManager.m b/SOGoLogic/AgenorUserManager.m
new file mode 100644 (file)
index 0000000..aec2deb
--- /dev/null
@@ -0,0 +1,87 @@
+/*
+  Copyright (C) 2000-2004 SKYRIX Software AG
+
+  This file is part of OGo
+
+  OGo is free software; you can redistribute it and/or modify it under
+  the terms of the GNU Lesser General Public License as published by the
+  Free Software Foundation; either version 2, or (at your option) any
+  later version.
+
+  OGo 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 Lesser General Public
+  License for more details.
+
+  You should have received a copy of the GNU Lesser General Public
+  License along with OGo; see the file COPYING.  If not, write to the
+  Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+  02111-1307, USA.
+*/
+// $Id$
+
+
+#import "AgenorUserManager.h"
+
+
+@implementation AgenorUserManager
+
++ (id)sharedUserManager {
+    static id mgr = nil;
+    if(mgr == nil) {
+        mgr = [[self alloc] init];
+    }
+    return mgr;
+}
+
+- (id)init {
+    self = [super init];
+    if(self) {
+    }
+    return self;
+}
+
+- (void)dealloc {
+    [super dealloc];
+}
+
+
+- (NSString *)getUIDForEMail:(NSString *)_email {
+    NSRange r;
+    NSString *domain;
+
+    r = [_email rangeOfString:@"@"];
+    domain = [_email substringFromIndex:r.location + 1];
+    if(![domain isEqualToString:@"equipement.gouv.fr"])
+        return _email;
+    return [_email substringToIndex:r.location];
+}
+
+- (NSString *)getEmailForUID:(NSString *)_uid {
+    NSRange r;
+    
+    r = [_uid rangeOfString:@"@"];
+    if(r.length > 0)
+        return _uid;
+    return [NSString stringWithFormat:@"%@@equipement.gouv.fr", _uid];
+    
+}
+
+- (NSString *)getCNForUID:(NSString *)_uid {
+#warning !! IMPLEMENT ME!!
+    NSString *s;
+    NSRange  r;
+    
+    s = _uid;
+    if ([s length] < 10)
+        return s;
+    
+    // TODO: algorithm might be inappropriate, depends on the actual UID
+    r = [s rangeOfString:@"."];
+    if (r.length == 0)
+        return s;
+    
+    return [s substringToIndex:r.location];
+}
+
+@end
index c865704c4700d4d34d496ea6a1930091b73c3835..d92abf7f7bff76dccba48858f1e1ae460f8decc9 100644 (file)
@@ -1,3 +1,8 @@
+2004-08-13  Marcus Mueller  <znek@mulle-kybernetik.com>
+
+       * AgenorUserManager.[hm]: new singleton object to manage Agenor
+         related user tasks. (v0.9.3)
+
 2004-08-12  Helge Hess  <helge.hess@skyrix.com>
 
        * SOGoAppointment.h: added -iCalString prototype (v0.9.2)
index 2a402c00f665f1d0ccc7b54466ee69a88e4cbebc..2696df682f6505c04dc0c13085697d05c2efc91c 100644 (file)
@@ -9,11 +9,13 @@ libSOGoLogic_HEADER_FILES_DIR         = .
 libSOGoLogic_HEADER_FILES_INSTALL_DIR = /SOGoLogic
 libSOGoLogic_SOVERSION=$(MAJOR_VERSION).$(MINOR_VERSION)
 
-libSOGoLogic_HEADER_FILES += \
-       SOGoAppointment.h \
+libSOGoLogic_HEADER_FILES +=   \
+       SOGoAppointment.h       \
+       AgenorUserManager.h     \
 
-libSOGoLogic_OBJC_FILES += \
+libSOGoLogic_OBJC_FILES +=     \
        SOGoAppointment.m       \
+       AgenorUserManager.m     \
 
 -include GNUmakefile.preamble
 include $(GNUSTEP_MAKEFILES)/library.make
index ba805980051c909d196190a962d5e762439d0522..0bd280ab331607d200284fb1e67cb23d6f33a757 100644 (file)
@@ -1,6 +1,7 @@
 # $Id$
 
-libSOGoLogic_LIBRARIES_DEPEND_UPON += \
-       -lNGiCal        \
+libSOGoLogic_LIBRARIES_DEPEND_UPON +=  \
+       -lNGiCal                        \
+       -lNGLdap                        \
        -lSaxObjC
 
index 1bf86739af6e070f2b3946837285f951d5e6a275..fc795f55c1387b14d99ba68f17adc4f527276f1f 100644 (file)
@@ -1,3 +1,3 @@
 # $Id$
 
-SUBMINOR_VERSION:=2
+SUBMINOR_VERSION:=3