]> err.no Git - scalable-opengroupware.org/commitdiff
work in progress
authorznek <znek@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Sun, 15 Aug 2004 12:46:44 +0000 (12:46 +0000)
committerznek <znek@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Sun, 15 Aug 2004 12:46:44 +0000 (12:46 +0000)
git-svn-id: http://svn.opengroupware.org/SOGo/trunk@218 d1b88da0-ebda-0310-925b-ed51d893ca5b

SOGo/SOGo.xcode/project.pbxproj
SOGo/UI/Scheduler/ChangeLog
SOGo/UI/Scheduler/GNUmakefile
SOGo/UI/Scheduler/UIxAppointmentEditor.m
SOGo/UI/Scheduler/UIxCalView.m
SOGo/UI/Scheduler/UIxCalWeekOverview.wox
SOGo/UI/Scheduler/UIxComponent+Agenor.h [new file with mode: 0644]
SOGo/UI/Scheduler/UIxComponent+Agenor.m [new file with mode: 0644]

index d051677a2fd0e1e028b46116ae8fec21f7be4780..c432df32cc1409dfee2d0eefc378826df516e0a7 100644 (file)
                                AD071CE606CD2ACE00A9EEF4,
                                AD071CEC06CD2ACE00A9EEF4,
                                AD071CED06CD2ACE00A9EEF4,
+                               AD73BE4A06CF88BF00226A2D,
+                               AD73BE4B06CF88BF00226A2D,
                                AD071D1206CD2BCB00A9EEF4,
                                AD071D1306CD2BCB00A9EEF4,
                        );
                        refType = 4;
                        sourceTree = "<group>";
                };
+               AD73BE4A06CF88BF00226A2D = {
+                       fileEncoding = 4;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       path = SOGoAppointmentICalRenderer.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               AD73BE4B06CF88BF00226A2D = {
+                       fileEncoding = 4;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.objc;
+                       path = SOGoAppointmentICalRenderer.m;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               AD73BE6106CF8CC500226A2D = {
+                       fileEncoding = 4;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       path = "UIxComponent+Agenor.h";
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               AD73BE6206CF8CC500226A2D = {
+                       fileEncoding = 4;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.objc;
+                       path = "UIxComponent+Agenor.m";
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               AD73BE7D06CF90EA00226A2D = {
+                       fileEncoding = 4;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       path = "NSCalendarDate+UIx.h";
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               AD73BE7E06CF90EA00226A2D = {
+                       fileEncoding = 4;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.objc;
+                       path = "NSCalendarDate+UIx.m";
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
                ADCDE53106ADA8AC00BFCE2B = {
                        fileEncoding = 5;
                        isa = PBXFileReference;
                E87208930692E3D30099CBBD = {
                        explicitFileType = sourcecode.make;
                        fileEncoding = 4;
+                       indentWidth = 8;
                        isa = PBXFileReference;
                        path = GNUmakefile;
                        refType = 4;
                        sourceTree = "<group>";
-                       tabWidth = 4;
+                       tabWidth = 8;
                };
                E87208940692E3D30099CBBD = {
                        explicitFileType = sourcecode.make;
                                E872090B0692E3D30099CBBD,
                                E87209020692E3D30099CBBD,
                                E87209030692E3D30099CBBD,
+                               AD73BE7D06CF90EA00226A2D,
+                               AD73BE7E06CF90EA00226A2D,
                                AD071B3C06CCFA2000A9EEF4,
                                AD071B3D06CCFA2000A9EEF4,
+                               AD73BE6106CF8CC500226A2D,
+                               AD73BE6206CF8CC500226A2D,
                        );
                        isa = PBXGroup;
                        name = Classes;
index cfc807ff1212708f3a84560e26d83d29f5ca57a2..8c333dbbd1d6d47b6789dc3754e9a20768b6a179 100644 (file)
@@ -1,3 +1,20 @@
+2004-08-14  Marcus Mueller  <znek@mulle-kybernetik.com>
+
+       * v0.9.38
+
+       * UIxComponent+Agenor.[hm]: -cnForUser and -emailForUser require the
+         AgenorUserManager from Logic.
+
+       * UIxAppointmentEditor.m: refactored -cnForUser and -emailForUser,
+         moved to extra category.
+
+       * UIxCalWeekView.wox: added custom style if apt belongs to user.
+
+       * UIxCalView.m: added some extra logic in redirect, provided extra
+         style sheet selector for appointments.
+
+       * GNUmakefile: added new files
+
 2004-08-14  Marcus Mueller  <znek@mulle-kybernetik.com>
 
        * v0.9.37
index 4828361d8b2404c53564c3b42cc34addb12e719c..49b2c924eea15a8b15f74807fe52a8411179392d 100644 (file)
@@ -15,6 +15,7 @@ SchedulerUI_OBJC_FILES =              \
        UIxAppointmentFormatter.m       \
        iCalPerson+UIx.m                \
        NSCalendarDate+UIx.m            \
+       UIxComponent+Agenor.m           \
        \
        UIxCalView.m                    \
        UIxCalDayView.m                 \
index 12c296cb45461cf2f78daf16a19b81ef1828c3f7..99b326d689e86061de283d671d9698562d7f358a 100644 (file)
@@ -37,9 +37,6 @@
 - (NSString *)iCalStringTemplate;
 - (NSString *)iCalString;
 
-- (NSString *)emailForUser;
-- (NSString *)cnForUser;
-
 - (NSString *)_completeURIForMethod:(NSString *)_method;
 
 - (iCalPerson *)getOrganizer;
@@ -55,6 +52,7 @@
 #include <NGiCal/NGiCal.h>
 #include <SOGoLogic/AgenorUserManager.h>
 #include "iCalPerson+UIx.h"
+#include "UIxComponent+Agenor.h"
 
 @interface NSDate(UsedPrivates)
 - (NSString *)icalString; // TODO: this is in NGiCal
 
 /* email, cn */
 
-- (NSString *)emailForUser {
-    NSString *uid;
-
-    uid = [[self user] login];
-    return [[AgenorUserManager sharedUserManager] getEmailForUID:uid];
-}
-
-- (NSString *)cnForUser {
-    NSString *uid;
-    
-    uid = [[self user] login];
-    return [[AgenorUserManager sharedUserManager] getCNForUID:uid];
-}
-
 - (NSString *)combinedCNAndEmailForUser {
     return [NSString stringWithFormat:@"%@;%@",
         [self emailForUser],
index 9cef50ae16bf997256a93e03c38770cd43208ada..066f6c5747be3aa69fe5357bce30b44a5980c422 100644 (file)
@@ -7,6 +7,7 @@
 #include "SoObjects/Appointments/SOGoAppointmentFolder.h"
 #include <NGObjWeb/SoUser.h>
 #include <SOGoUI/SOGoAptFormatter.h>
+#include <SOGoLogic/AgenorUserManager.h>
 
 @interface UIxCalView (PrivateAPI)
 - (NSString *)_userFolderURI;
@@ -92,11 +93,20 @@ static BOOL shouldDisplayWeekend = NO;
   return title;
 }
 
-/* TODO: remove this */
 - (NSString *)tooltipForApt {
     return [[self aptTooltipFormatter] stringForObjectValue:self->appointment];
 }
 
+- (BOOL)isMyApt {
+    return YES;
+}
+
+- (NSString *)aptStyle {
+    if(![self isMyApt])
+        return @"other_apt";
+    return nil;
+}
+
 - (NSCalendarDate *)referenceDateForFormatter {
   return [self selectedDate];
 }
@@ -214,7 +224,6 @@ static BOOL shouldDisplayWeekend = NO;
                               stringByAppendingString:@"/view"];
 }
 
-
 /* backend */
 
 /* resource URLs (TODO?) */
@@ -401,10 +410,11 @@ static BOOL shouldDisplayWeekend = NO;
 
 - (id)redirectForUIDsAction {
   NSMutableString *uri;
-  NSString   *uidsString, *loc, *prevMethod;
+  NSString   *uidsString, *loc, *prevMethod, *userFolderID;
   WORequest  *req;
   id <WOActionResults> r;
   BOOL useGroups;
+  unsigned index;
 
   req = [[self context] request];
 
@@ -418,8 +428,19 @@ static BOOL shouldDisplayWeekend = NO;
   uri = [[NSMutableString alloc] initWithString:[self _userFolderURI]];
   /* if we have more than one entry, use groups - otherwise don't */
   useGroups = [uidsString rangeOfString:@","].length > 0;
-
+  userFolderID = [uri lastPathComponent];
   if(useGroups) {
+    NSArray *uids;
+
+    uids = [uidsString componentsSeparatedByString:@","];
+    /* guarantee that our id is the first */
+    if(((index = [uids indexOfObject:userFolderID]) != NSNotFound) &&
+       (index != 0)) {
+        uids = [[uids mutableCopy] autorelease];
+        [(NSMutableArray *)uids removeObjectAtIndex:index];
+        [(NSMutableArray *)uids insertObject:userFolderID atIndex:0];
+        uidsString = [uids componentsJoinedByString:@","];
+    }
     [uri appendString:@"Groups/_custom_"];
     [uri appendString:uidsString];
     [uri appendString:@"/"];
@@ -427,7 +448,7 @@ static BOOL shouldDisplayWeekend = NO;
   else {
       /* check if lastPathComponent is the base that we want to have */
       if((([uidsString length] != 0) &&
-          (![[uri lastPathComponent] isEqualToString:uidsString]))) {
+          (![userFolderID isEqualToString:uidsString]))) {
           NSRange r;
           
           /* uri ends with an '/', so we have to adjust the range a little */
index a00b2357ae575f6af66a6edfa6684b56d99556a7..603b83652b0cd31f431744986e73815f21fc7c91 100644 (file)
           <var:foreach list="allDayApts" item="appointment">
             <a var:href="appointmentViewURL"
                var:queryDictionary="currentDayQueryParameters"
-            ><var:string value="shortTextForApt"
+            ><var:string value="appointment"
+                         formatter="aptFormatter"
                          const:escapeHTML="NO"
+                         style="aptStyle"
              /></a>
           </var:foreach>
         </var:week-info>
       <var:week>
         <a var:href="appointmentViewURL" 
            var:title="tooltipForApt"
-          ><small><var:string value="shortTextForApt"
+          ><small><var:string value="appointment"
+                              formatter="aptFormatter"
                               const:escapeHTML="NO"
+                              style="aptStyle"
                   /></small></a><br />
       </var:week>
     </var:week-overview>
diff --git a/SOGo/UI/Scheduler/UIxComponent+Agenor.h b/SOGo/UI/Scheduler/UIxComponent+Agenor.h
new file mode 100644 (file)
index 0000000..9e4c214
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+  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        __UIxComponent_Agenor_H_
+#define        __UIxComponent_Agenor_H_
+
+
+#import <SOGoUI/UIxComponent.h>
+
+
+@interface UIxComponent (Agenor)
+/* email, cn */
+- (NSString *)emailForUser;
+- (NSString *)cnForUser;
+@end
+
+#endif /* __UIxComponent_Agenor_H_ */
diff --git a/SOGo/UI/Scheduler/UIxComponent+Agenor.m b/SOGo/UI/Scheduler/UIxComponent+Agenor.m
new file mode 100644 (file)
index 0000000..2240b5d
--- /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$
+
+
+#include "UIxComponent+Agenor.h"
+#include <SOGoLogic/AgenorUserManager.h>
+#include "common.h"
+
+@implementation UIxComponent (Agenor)
+
+- (NSString *)emailForUser {
+    NSString *uid;
+    
+    uid = [[self user] login];
+    return [[AgenorUserManager sharedUserManager] getEmailForUID:uid];
+}
+
+- (NSString *)cnForUser {
+    NSString *uid;
+    
+    uid = [[self user] login];
+    return [[AgenorUserManager sharedUserManager] getCNForUID:uid];
+}
+
+@end