]> err.no Git - scalable-opengroupware.org/commitdiff
git-svn-id: http://svn.opengroupware.org/SOGo/inverse/trunk@1045 d1b88da0-ebda-0310...
authorwolfgang <wolfgang@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Wed, 11 Apr 2007 20:13:07 +0000 (20:13 +0000)
committerwolfgang <wolfgang@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Wed, 11 Apr 2007 20:13:07 +0000 (20:13 +0000)
49 files changed:
ChangeLog
SoObjects/Appointments/SOGoAppointmentFolder.h
SoObjects/Appointments/SOGoAppointmentFolder.m
SoObjects/Appointments/SOGoAppointmentObject.h
SoObjects/Appointments/SOGoAppointmentObject.m
SoObjects/Appointments/SOGoCalendarComponent.h
SoObjects/Appointments/SOGoCalendarComponent.m
SoObjects/Appointments/SOGoFreeBusyObject.m
SoObjects/Appointments/SOGoGroupAppointmentFolder.m
SoObjects/Appointments/SOGoTaskObject.h
SoObjects/Appointments/SOGoTaskObject.m
SoObjects/Contacts/SOGoContactFolders.m
SoObjects/Contacts/SOGoContactLDAPFolder.m
SoObjects/Mailer/SOGoDraftObject.m
SoObjects/Mailer/SOGoMailAccount.m
SoObjects/Mailer/SOGoMailAccounts.m
SoObjects/Mailer/SOGoMailBaseObject.m
SoObjects/SOGo/NSString+Utilities.h
SoObjects/SOGo/NSString+Utilities.m
SoObjects/SOGo/SOGoContentObject.m
SoObjects/SOGo/SOGoGroupFolder.m
SoObjects/SOGo/SOGoObject.h
SoObjects/SOGo/SOGoObject.m
SoObjects/SOGo/SOGoUser.h
SoObjects/SOGo/SOGoUser.m
SoObjects/SOGo/SOGoUserFolder.m
UI/MailPartViewers/UIxMailPartICalViewer.m
UI/MainUI/SOGoUserHomePage.m
UI/MainUI/product.plist
UI/SOGoUI/UIxComponent.m
UI/Scheduler/GNUmakefile
UI/Scheduler/UIxAppointmentEditor.m
UI/Scheduler/UIxAppointmentProposal.m
UI/Scheduler/UIxAppointmentView.h
UI/Scheduler/UIxAppointmentView.m
UI/Scheduler/UIxCalAptListView.m
UI/Scheduler/UIxCalDateSelector.m
UI/Scheduler/UIxCalMonthView.m
UI/Scheduler/UIxCalSelectTab.m [deleted file]
UI/Scheduler/UIxCalView.h
UI/Scheduler/UIxCalView.m
UI/Scheduler/UIxCalendarSelector.m
UI/Scheduler/UIxComponentEditor.m
UI/Scheduler/UIxTaskEditor.m
UI/Scheduler/UIxTaskProposal.m
UI/Scheduler/UIxTaskView.m
UI/Scheduler/UIxTimeDateControl.m
UI/Templates/SchedulerUI/UIxCalMonthOverview.wox [deleted file]
UI/Templates/SchedulerUI/UIxCalSelectTab.wox [deleted file]

index 60b5ef6e7049a5428cc023e255417d65e2b42775..f3d2c8f400bc8ec9b3b622b235bf60cb9d38198d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,27 @@
+2007-04-11  Wolfgang Sourdeau  <wsourdeau@inverse.ca>
+
+       * SoObjects/SOGo/NSString+Utilities.m ([NSString -boolValue]): new
+       method that SOGo will need with non-gnustep Foundation
+       implementation.
+       ([NSString -stringByAppendingPathComponent:component]): new method
+       that SOGo will need when building with libFoundation. Method
+       removed later since it is available from
+       Foundation/NSPathUtilities.h.
+
+       * SoObjects/SOGo/SOGoUser.m ([SOGoUser -timeZone]): method moved
+       from SOGoObject.m.
+
+       * SoObjects/SOGo/SOGoObject.m: new ivar "context" that permits
+       every subclass to access [WOApplication context] without having to
+       invoke it more than once.
+
+       * SoObjects/Appointments/SOGoCalendarComponent.m
+       ([SOGoCalendarComponent -changeParticipationStatus:_status]):
+       moved method from SOGoTaskObject and SOGoAppointmentObject up to
+       their parent class.
+
+       * UI/Scheduler/UIxCalSelectTab.m: removed module.
+
 2007-04-10  Wolfgang Sourdeau  <wsourdeau@inverse.ca>
 
        * SoObjects/Contacts/SOGoContactGCSEntry.m ([SOGoContactGCSEntry
index b072bb20fff645d177440564cd88d68c2d911f4b..0ca7c0868fce6169a047f5fbeb6cacf08155e2c3 100644 (file)
 
 #import "SOGo/SOGoFolder.h"
 
-@class NSString, NSArray, NSCalendarDate, NSException, NSMutableDictionary;
+@class NSArray;
+@class NSCalendarDate;
+@class NSException;
+@class NSMutableDictionary;
+@class NSString;
+@class NSTimeZone;
 @class GCSFolder;
 
 @interface SOGoAppointmentFolder : SOGoFolder
 {
+  NSTimeZone *timeZone;
   NSMutableDictionary *uidToFilename;
 }
 
 
 - (NSArray *) fetchAllSOGoAppointments;
 
-- (NSArray *) calendarFoldersInContext: (WOContext *) context;
+- (NSArray *) calendarFolders;
 
 @end
 
index 8069190031f455fc492387058507cfd29c6c4b16..b877f3007b34cecfba56a223acf165f42552cf1a 100644 (file)
@@ -84,12 +84,23 @@ static NSNumber   *sharedYes = nil;
 //                                        SOGoRole_Assistant, nil]
 //                 asDefaultForPermission: SoPerm_View];
 
-  sharedYes = [[NSNumber numberWithBool:YES] retain];
+  sharedYes = [[NSNumber numberWithBool: YES] retain];
+}
+
+- (id) initWithName: (NSString *) name
+       inContainer: (id) newContainer
+{
+  if ((self = [super initWithName: name inContainer: newContainer]))
+    {
+      timeZone = [[context activeUser] timeZone];
+    }
+
+  return self;
 }
 
 - (void) dealloc
 {
-  [self->uidToFilename release];
+  [uidToFilename release];
   [super dealloc];
 }
 
@@ -108,8 +119,7 @@ static NSNumber   *sharedYes = nil;
   NSString *s;
   
   s = [[self container] nameInContainer];
-#warning HH DEBUG
-  [self logWithFormat:@"CAL UID: %@", s];
+//   [self logWithFormat:@"CAL UID: %@", s];
   return [s isNotNull] ? [NSArray arrayWithObjects:&s count:1] : nil;
 }
 
@@ -237,7 +247,6 @@ static NSNumber   *sharedYes = nil;
 
 - (void) _appendComponentsMatchingFilters: (NSArray *) filters
                                toResponse: (WOResponse *) response
-                                inContext: (WOContext *) context
 {
   NSArray *apts;
   unsigned int count, max;
@@ -266,7 +275,7 @@ static NSNumber   *sharedYes = nil;
     }
 }
 
-- (id) davCalendarQuery: (id) context
+- (id) davCalendarQuery: (id) queryContext
 {
   WOResponse *r;
   NSArray *filters;
@@ -285,8 +294,7 @@ static NSNumber   *sharedYes = nil;
   document = [[context request] contentAsDOMDocument];
   filters = [self _parseCalendarFilters: [document documentElement]];
   [self _appendComponentsMatchingFilters: filters
-        toResponse: r
-        inContext: context];
+        toResponse: r];
   [r appendContentString:@"</D:multistatus>\r\n"];
 
   return r;
@@ -342,7 +350,6 @@ static NSNumber   *sharedYes = nil;
 }
 
 - (BOOL) requestNamedIsHandledLater: (NSString *) name
-                          inContext: (WOContext *) context
 {
   return [name isEqualToString: @"OPTIONS"];
 }
@@ -356,7 +363,7 @@ static NSNumber   *sharedYes = nil;
   BOOL handledLater;
 
   /* first check attributes directly bound to the application */
-  handledLater = [self requestNamedIsHandledLater: _key inContext: _ctx];
+  handledLater = [self requestNamedIsHandledLater: _key];
   if (handledLater)
     obj = nil;
   else
@@ -467,7 +474,7 @@ static NSNumber   *sharedYes = nil;
   
   if (![_uid isNotNull])
     return nil;
-  if ((rname = [self->uidToFilename objectForKey:_uid]) != nil)
+  if ((rname = [uidToFilename objectForKey:_uid]) != nil)
     return [rname isNotNull] ? rname : nil;
   
   if ((folder = [self ocsFolder]) == nil) {
@@ -476,13 +483,13 @@ static NSNumber   *sharedYes = nil;
     return nil;
   }
 
-  if (self->uidToFilename == nil)
-    self->uidToFilename = [[NSMutableDictionary alloc] initWithCapacity:16];
+  if (uidToFilename == nil)
+    uidToFilename = [[NSMutableDictionary alloc] initWithCapacity:16];
   
   if ((rname = [self resourceNameForEventUID:_uid inFolder:folder]) == nil)
-    [self->uidToFilename setObject:[NSNull null] forKey:_uid];
+    [uidToFilename setObject:[NSNull null] forKey:_uid];
   else
-    [self->uidToFilename setObject:rname forKey:_uid];
+    [uidToFilename setObject:rname forKey:_uid];
   
   return rname;
 }
@@ -527,7 +534,7 @@ static NSNumber   *sharedYes = nil;
   if ((tmp = [_record objectForKey:@"startdate"])) {
     tmp = [[NSCalendarDate alloc] initWithTimeIntervalSince1970:
           (NSTimeInterval)[tmp unsignedIntValue]];
-    [tmp setTimeZone: [self userTimeZone]];
+    [tmp setTimeZone: timeZone];
     if (tmp) [md setObject:tmp forKey:@"startDate"];
     [tmp release];
   }
@@ -537,7 +544,7 @@ static NSNumber   *sharedYes = nil;
   if ((tmp = [_record objectForKey:@"enddate"])) {
     tmp = [[NSCalendarDate alloc] initWithTimeIntervalSince1970:
           (NSTimeInterval)[tmp unsignedIntValue]];
-    [tmp setTimeZone: [self userTimeZone]];
+    [tmp setTimeZone: timeZone];
     if (tmp) [md setObject:tmp forKey:@"endDate"];
     [tmp release];
   }
@@ -557,15 +564,41 @@ static NSNumber   *sharedYes = nil;
   
   /* cycle is in _r */
   tmp = [_r startDate];
-  [tmp setTimeZone:[self userTimeZone]];
+  [tmp setTimeZone: timeZone];
   [md setObject:tmp forKey:@"startDate"];
   tmp = [_r endDate];
-  [tmp setTimeZone:[self userTimeZone]];
+  [tmp setTimeZone: timeZone];
   [md setObject:tmp forKey:@"endDate"];
   
   return md;
 }
 
+- (NSArray *) fixupRecords: (NSArray *) records
+                fetchRange: (NGCalendarDateRange *) r
+{
+  // TODO: is the result supposed to be sorted by date?
+  NSMutableArray *ma;
+  unsigned count, max;
+  id row; // TODO: what is the type of the record?
+
+  if (records)
+    {
+      max = [records count];
+      ma = [NSMutableArray arrayWithCapacity: max];
+      for (count = 0; count < max; count++)
+       {
+         row = [self fixupRecord: [records objectAtIndex: count]
+                     fetchRange: r];
+         if (row)
+           [ma addObject: row];
+       }
+    }
+  else
+    ma = nil;
+
+  return ma;
+}
+
 - (void) _flattenCycleRecord: (NSDictionary *) _row
                     forRange: (NGCalendarDateRange *) _r
                    intoArray: (NSMutableArray *) _ma
@@ -611,28 +644,6 @@ static NSNumber   *sharedYes = nil;
   }
 }
 
-- (NSArray *) fixupRecords: (NSArray *) _records
-                fetchRange: (NGCalendarDateRange *) _r
-{
-  // TODO: is the result supposed to be sorted by date?
-  NSMutableArray *ma;
-  unsigned i, count;
-
-  if (_records == nil) return nil;
-  if ((count = [_records count]) == 0)
-    return _records;
-  
-  ma = [NSMutableArray arrayWithCapacity:count];
-  for (i = 0; i < count; i++) {
-    id row; // TODO: what is the type of the record?
-    
-    row = [_records objectAtIndex:i];
-    row = [self fixupRecord:row fetchRange:_r];
-    if (row != nil) [ma addObject:row];
-  }
-  return ma;
-}
-
 - (NSArray *) fixupCyclicRecords: (NSArray *) _records
                       fetchRange: (NGCalendarDateRange *) _r
 {
@@ -692,10 +703,8 @@ static NSNumber   *sharedYes = nil;
 - (NSString *) _privacySqlString
 {
   NSString *privacySqlString, *owner, *currentUser, *email;
-  WOContext *context;
   SOGoUser *activeUser;
 
-  context = [[WOApplication application] context];
   activeUser = [context activeUser];
   currentUser = [activeUser login];
   owner = [self ownerInContext: context];
@@ -876,10 +885,8 @@ static NSNumber   *sharedYes = nil;
   Class objectClass;
   unsigned int count, max;
   NSString *currentId, *currentUser;
-  WOContext *context;
   id deleteObject;
 
-  context = [[WOApplication application] context];
   currentUser = [[context activeUser] login];
 
   max = [ids count];
@@ -927,11 +934,9 @@ static NSNumber   *sharedYes = nil;
   if (![_uid isNotNull])
     return nil;
   
-  if (_ctx == nil) _ctx = [[WOApplication application] context];
-  
   /* create subcontext, so that we don't destroy our environment */
   
-  if ((ctx = [_ctx createSubContext]) == nil) {
+  if ((ctx = [context createSubContext]) == nil) {
     [self errorWithFormat:@"could not create SOPE subcontext!"];
     return nil;
   }
@@ -1166,7 +1171,7 @@ static NSNumber   *sharedYes = nil;
   return firstShouldBeActive;
 }
 
-- (NSArray *) calendarFoldersInContext: (WOContext *) context
+- (NSArray *) calendarFolders
 {
   NSMutableDictionary *userCalendar, *calendarDict;
   NSMutableArray *calendarFolders;
@@ -1177,7 +1182,6 @@ static NSNumber   *sharedYes = nil;
   [calendarFolders autorelease];
 
   activeUser = [context activeUser];
-
   userCalendar = [NSMutableDictionary new];
   [userCalendar autorelease];
   [userCalendar setObject: @"/" forKey: @"folder"];
index 17e9b24b0d179dd0cbfdff61252f4c2f16c5b8c2..d6fe91e865f9ee70a8017a6ab4670ce788730821 100644 (file)
 
 /* folder management */
 
-- (id) lookupHomeFolderForUID: (NSString *) _uid inContext: (id)_ctx;
+- (id) lookupHomeFolderForUID: (NSString *) _uid
+                   inContext: (id) _ctx;
 - (NSArray *) lookupCalendarFoldersForUIDs: (NSArray *) _uids
                                  inContext: (id) _ctx;
 
 /* "iCal multifolder saves" */
 
-- (NSException *) saveContentString: (NSString *)_iCal
+- (NSException *) saveContentString: (NSString *) _iCal
                        baseSequence: (int) _v;
 - (NSException *) deleteWithBaseSequence: (int) _v;
-
 - (NSException *) saveContentString: (NSString *) _iCalString;
 
-- (NSException *) changeParticipationStatus: (NSString *) _status
-                                  inContext: (id) _ctx;
-
-
 @end
 
 #endif /* __Appointments_SOGoAppointmentObject_H__ */
index 4fbebbdb036eb91768c95413860982d2d09d18d2..ea76ffb2ba42c0c73b3d5139a889c2d7d5db94ee 100644 (file)
   NSEnumerator *e;
   id folder;
   NSException *allErrors = nil;
-  id ctx;
-
-  ctx = [[WOApplication application] context];
   
-  e = [[self lookupCalendarFoldersForUIDs:_uids inContext:ctx]
+  e = [[self lookupCalendarFoldersForUIDs:_uids inContext: context]
             objectEnumerator];
   while ((folder = [e nextObject]) != nil) {
     NSException           *error;
     if (![folder isNotNull]) /* no folder was found for given UID */
       continue;
 
-    apt = [folder lookupName: [self nameInContainer] inContext:ctx
+    apt = [folder lookupName: [self nameInContainer] inContext: context
                  acquire: NO];
     if ([apt isKindOfClass: [NSException class]])
       {
   NSEnumerator *e;
   id folder;
   NSException *allErrors = nil;
-  id ctx;
-  
-  ctx = [[WOApplication application] context];
   
-  e = [[self lookupCalendarFoldersForUIDs:_uids inContext:ctx]
+  e = [[self lookupCalendarFoldersForUIDs:_uids inContext: context]
             objectEnumerator];
   while ((folder = [e nextObject])) {
     NSException           *error;
     SOGoAppointmentObject *apt;
     
-    apt = [folder lookupName:[self nameInContainer] inContext:ctx
+    apt = [folder lookupName:[self nameInContainer] inContext: context
                  acquire:NO];
     if ([apt isKindOfClass: [NSException class]]) {
       [self logWithFormat: @"%@", [(NSException *) apt reason]];
   return [self saveContentString: _iCalString baseSequence: 0];
 }
 
-- (NSException *) changeParticipationStatus: (NSString *) _status
-                                  inContext: (id) _ctx
-{
-  iCalEvent *apt;
-  iCalPerson *p;
-  NSString *newContent;
-  NSException *ex;
-  NSString *myEMail;
-  
-  ex = nil;
-
-  // TODO: do we need to use SOGoAppointment? (prefer iCalEvent?)
-  apt = (iCalEvent *) [self component: NO];
-
-  if (apt)
-    {
-      myEMail = [[_ctx activeUser] email];
-      p = [apt findParticipantWithEmail: myEMail];
-      if (p)
-        {
-  // TODO: send iMIP reply mails?
-  
-          [p setPartStat:_status];
-          newContent = [[apt parent] versitString];
-          if (newContent)
-            {
-              ex = [self saveContentString:newContent];
-              if (ex)
-                // TODO: why is the exception wrapped?
-                /* Server Error */
-                ex = [NSException exceptionWithHTTPStatus: 500
-                                  reason: [ex reason]];
-            }
-          else
-            ex
-              = [NSException exceptionWithHTTPStatus: 500 /* Server Error */
-                             reason: @"Could not generate iCalendar data ..."];
-        }
-      else
-        ex = [NSException exceptionWithHTTPStatus: 404 /* Not Found */
-                          reason: @"user does not participate in this "
-                          @"appointment"];
-    }
-  else
-    ex = [NSException exceptionWithHTTPStatus:500 /* Server Error */
-                      reason:@"unable to parse appointment record"];
-
-  return ex;
-}
-
-
 /* message type */
 
 - (NSString *) outlookMessageClass
index 80230884c85701c934d80d3c22b7cc10c27905a1..1f7299bc4d00480465c9810aeffcb01f4810577f 100644 (file)
@@ -48,6 +48,8 @@
 
 - (NSException *) delete;
 
+- (NSException *) changeParticipationStatus: (NSString *) _status;
+
 /* mail notifications */
 - (BOOL) sendEMailNotifications;
 - (void) sendEMailUsingTemplateNamed: (NSString *) _pageName
index 12ba6c6e1abcbd12d5e639432acde070f0af58c5..d240805a341acaf992b8b5965da36d0bcfe09d4c 100644 (file)
@@ -29,9 +29,9 @@
 #import <NGMail/NGMail.h>
 #import <NGMail/NGSendMail.h>
 
-#import <SOGo/AgenorUserManager.h>
-#import <SOGo/SOGoPermissions.h>
-#import <SOGo/SOGoUser.h>
+#import <SoObjects/SOGo/AgenorUserManager.h>
+#import <SoObjects/SOGo/SOGoPermissions.h>
+#import <SoObjects/SOGo/SOGoUser.h>
 
 #import "common.h"
 
@@ -113,7 +113,6 @@ static BOOL sendEMailNotifications = NO;
   NSString *tmpContent, *email;
   iCalCalendar *tmpCalendar;
   iCalRepeatableEntityObject *tmpComponent;
-  WOContext *context;
 
   if (!calContent)
     {
@@ -125,7 +124,6 @@ static BOOL sendEMailNotifications = NO;
           tmpComponent = (iCalRepeatableEntityObject *) [tmpCalendar firstChildWithTag: [self componentTag]];
           if (![tmpComponent isPublic])
             {
-              context = [[WOApplication application] context];
               email = [[context activeUser] email];
               if (!([tmpComponent isOrganizer: email]
                     || [tmpComponent isParticipant: email]))
@@ -231,14 +229,12 @@ static BOOL sendEMailNotifications = NO;
 {
   NSString *baseURL;
   NSString *uid;
-  WOContext *ctx;
   NSArray *traversalObjects;
 
   /* generate URL from traversal stack */
-  ctx = [[WOApplication application] context];
-  traversalObjects = [ctx objectTraversalStack];
+  traversalObjects = [context objectTraversalStack];
   if ([traversalObjects count] > 0)
-    baseURL = [[traversalObjects objectAtIndex:0] baseURLInContext:ctx];
+    baseURL = [[traversalObjects objectAtIndex:0] baseURLInContext: context];
   else
     {
       baseURL = @"http://localhost/";
@@ -252,11 +248,66 @@ static BOOL sendEMailNotifications = NO;
           : nil);
 }
 
+- (NSException *) changeParticipationStatus: (NSString *) _status
+{
+  iCalRepeatableEntityObject *component;
+  iCalPerson *p;
+  NSString *newContent;
+  NSException *ex;
+  NSString *myEMail;
+  
+  ex = nil;
+
+  component = [self component: NO];
+  if (component)
+    {
+      myEMail = [[context activeUser] email];
+      p = [component findParticipantWithEmail: myEMail];
+      if (p)
+        {
+         // TODO: send iMIP reply mails?
+          [p setPartStat: _status];
+          newContent = [[component parent] versitString];
+          if (newContent)
+            {
+              ex = [self saveContentString:newContent];
+              if (ex)
+                // TODO: why is the exception wrapped?
+                /* Server Error */
+                ex = [NSException exceptionWithHTTPStatus: 500
+                                  reason: [ex reason]];
+            }
+          else
+            ex
+              = [NSException exceptionWithHTTPStatus: 500 /* Server Error */
+                             reason: @"Could not generate iCalendar data ..."];
+        }
+      else
+        ex = [NSException exceptionWithHTTPStatus: 404 /* Not Found */
+                          reason: @"user does not participate in this "
+                          @"calendar component"];
+    }
+  else
+    ex = [NSException exceptionWithHTTPStatus: 500 /* Server Error */
+                      reason: @"unable to parse component record"];
+
+  return ex;
+}
+
 - (BOOL) sendEMailNotifications
 {
   return sendEMailNotifications;
 }
 
+- (NSTimeZone *) timeZoneForUser: (NSString *) email
+{
+  NSString *uid;
+
+  uid = [[AgenorUserManager sharedUserManager] getUIDForEmail: email];
+
+  return [[SOGoUser userWithLogin: uid andRoles: nil] timeZone];
+}
+
 - (void) sendEMailUsingTemplateNamed: (NSString *) _pageName
                         forOldObject: (iCalRepeatableEntityObject *) _oldObject
                         andNewObject: (iCalRepeatableEntityObject *) _newObject
@@ -264,7 +315,7 @@ static BOOL sendEMailNotifications = NO;
 {
   NSString *pageName;
   iCalPerson *organizer;
-  NSString *cn, *sender, *iCalString;
+  NSString *cn, *email, *sender, *iCalString;
   NGSendMail *sendmail;
   WOApplication *app;
   unsigned i, count;
@@ -308,12 +359,12 @@ static BOOL sendEMailNotifications = NO;
 
           /* construct recipient */
           cn = [attendee cn];
+         email = [attendee rfc822Email];
           if (cn)
             recipient = [NSString stringWithFormat: @"%@ <%@>",
-                                  cn,
-                                  [attendee rfc822Email]];
+                                  cn, email];
           else
-            recipient = [attendee rfc822Email];
+            recipient = email;
 
           /* create page name */
           // TODO: select user's default language?
@@ -321,11 +372,11 @@ static BOOL sendEMailNotifications = NO;
                                mailTemplateDefaultLanguage,
                                _pageName];
           /* construct message content */
-          p = [app pageWithName: pageName inContext: [WOContext context]];
+          p = [app pageWithName: pageName inContext: context];
           [p setNewApt: _newObject];
           [p setOldApt: _oldObject];
           [p setHomePageURL: [self homePageURLForPerson: attendee]];
-          [p setViewTZ: [self userTimeZone: cn]];
+          [p setViewTZ: [self timeZoneForUser: email]];
           subject = [p getSubject];
           text = [p getBody];
 
@@ -375,14 +426,13 @@ static BOOL sendEMailNotifications = NO;
 
           /* send the damn thing */
           [sendmail sendMimePart: msg
-                    toRecipients: [NSArray arrayWithObject: [attendee rfc822Email]]
+                    toRecipients: [NSArray arrayWithObject: email]
                     sender: [organizer rfc822Email]];
         }
     }
 }
 
 - (NSArray *) rolesOfUser: (NSString *) login
-                inContext: (WOContext *) context
 {
   AgenorUserManager *um;
   iCalRepeatableEntityObject *component;
@@ -403,15 +453,14 @@ static BOOL sendEMailNotifications = NO;
         [sogoRoles addObject: SOGoRole_Organizer];
       else if ([component isParticipant: email])
         [sogoRoles addObject: SOGoRole_Participant];
-      else if ([[container ownerInContext: nil] isEqualToString: login])
+      else if ([[container ownerInContext: context] isEqualToString: login])
         [sogoRoles addObject: SoRole_Owner];
     }
   else
     {
-      user = [[SOGoUser alloc] initWithLogin: login roles: nil];
+      user = [SOGoUser userWithLogin: login andRoles: nil];
       [sogoRoles addObjectsFromArray: [user rolesForObject: container
                                             inContext: context]];
-      [user release];
     }
 
   return sogoRoles;
@@ -431,7 +480,7 @@ static BOOL sendEMailNotifications = NO;
       = ([organizerEmail caseInsensitiveCompare: email] == NSOrderedSame);
   else
     isOrganizerOrOwner
-      = [[container ownerInContext: nil] isEqualToString: login];
+      = [[container ownerInContext: context] isEqualToString: login];
 
   return isOrganizerOrOwner;
 }
index 1c469aa05390887dd5b176905313ceb9f82211ee..5edd59e4ce32ee6c9c1b2e64d426f22980ba1fed 100644 (file)
 - (NSString *) contentAsString
 {
   NSCalendarDate *today, *startDate, *endDate;
+  NSTimeZone *timeZone;
   
   today = [[NSCalendarDate calendarDate] beginOfDay];
-  [today setTimeZone: [self userTimeZone]];
+  timeZone = [[context activeUser] timeZone];
+  [today setTimeZone: timeZone];
 
   startDate = [today dateByAddingYears: 0 months: 0 days: -14
                      hours: 0 minutes: 0 seconds: 0];
   endDate = [startDate dateByAddingYears: 0 months: 1 days: 0
                        hours: 0 minutes: 0 seconds: 0];
+
   return [self contentAsStringFrom: startDate to: endDate];
 }
 
 {
   id calFolder;
   SoSecurityManager *sm;
-  WOApplication *woApp;
   NSArray *infos;
 
-  woApp = [WOApplication application];
-
   calFolder = [container lookupName: @"Calendar" inContext: nil acquire: NO];
   sm = [SoSecurityManager sharedSecurityManager];
   if (![sm validatePermission: SOGoPerm_FreeBusyLookup
            onObject: calFolder
-           inContext: [woApp context]])
+           inContext: context])
     infos = [calFolder fetchFreeBusyInfosFrom: _startDate
                        to: _endDate];
   else
index c154c5b30d7164131a94218c5f4142d271dd5cb0..099fdf4f46ada919f6cce59e7d349c1adedf38f5 100644 (file)
   NSMutableArray      *result;
   NSMutableDictionary *uidToRecord;
   unsigned            i, count;
-  WOContext *context;
   SoSecurityManager *securityManager;
 
-  context = [[WOApplication application] context];
   securityManager = [SoSecurityManager sharedSecurityManager];
 
   folders = [[self container] memberFolders];
                          onObject: aptFolder
                          inContext: context]) {
       [self debugWithFormat:@"no permission to read the content of calendar: %@",
-             [folders objectAtIndex:i]];
+           [folders objectAtIndex:i]];
       continue;
     }
 
index 23436263330221ce32cef979ccacebf40594392f..9f57bf588f9b33591c640c5129cb1194742ef135 100644 (file)
 
 /* folder management */
 
-- (id)lookupHomeFolderForUID:(NSString *)_uid inContext:(id)_ctx;
-- (NSArray *)lookupCalendarFoldersForUIDs:(NSArray *)_uids inContext:(id)_ctx;
+- (id) lookupHomeFolderForUID: (NSString *) _uid
+                   inContext: (id) _ctx;
+- (NSArray *) lookupCalendarFoldersForUIDs: (NSArray *) _uids
+                                inContext: (id) _ctx;
 
 /* "iCal multifolder saves" */
 
-- (NSException *)saveContentString:(NSString *)_iCal baseSequence:(int)_v;
-- (NSException *)deleteWithBaseSequence:(int)_v;
-
-- (NSException *)saveContentString:(NSString *)_iCalString;
-
-- (NSException *)changeParticipationStatus:(NSString *)_status
-                                 inContext:(id)_ctx;
-
+- (NSException *) saveContentString: (NSString *) _iCal
+                      baseSequence: (int) _v;
+- (NSException *) deleteWithBaseSequence: (int) _v;
+- (NSException *) saveContentString: (NSString *) _iCalString;
 
 @end
 
index c364b922bf8ce17c54b8e029e9ec3762dc8f6fe6..861b32c0ff8839999398039651924b5dc926b87f 100644 (file)
@@ -121,6 +121,7 @@ static NSString                  *mailTemplateDefaultLanguage = nil;
   // TODO: what does this do? lookup the home of the organizer?
   return [[self container] lookupHomeFolderForUID:_uid inContext:_ctx];
 }
+
 - (NSArray *)lookupCalendarFoldersForUIDs:(NSArray *)_uids inContext:(id)_ctx {
   return [[self container] lookupCalendarFoldersForUIDs:_uids inContext:_ctx];
 }
@@ -131,11 +132,8 @@ static NSString                  *mailTemplateDefaultLanguage = nil;
   NSEnumerator *e;
   id           folder;
   NSException  *allErrors = nil;
-  id ctx;
 
-  ctx = [[WOApplication application] context];
-  
-  e = [[self lookupCalendarFoldersForUIDs:_uids inContext:ctx]
+  e = [[self lookupCalendarFoldersForUIDs: _uids inContext: context]
             objectEnumerator];
   while ((folder = [e nextObject]) != nil) {
     NSException           *error;
@@ -144,7 +142,7 @@ static NSString                  *mailTemplateDefaultLanguage = nil;
     if (![folder isNotNull]) /* no folder was found for given UID */
       continue;
     
-    task = [folder lookupName:[self nameInContainer] inContext:ctx
+    task = [folder lookupName:[self nameInContainer] inContext: context
                  acquire:NO];
     if ([task isKindOfClass: [NSException class]])
       {
@@ -173,18 +171,16 @@ static NSString                  *mailTemplateDefaultLanguage = nil;
   NSEnumerator *e;
   id           folder;
   NSException  *allErrors = nil;
-  id           ctx;
-  
-  ctx = [[WOApplication application] context];
   
-  e = [[self lookupCalendarFoldersForUIDs:_uids inContext:ctx]
+  e = [[self lookupCalendarFoldersForUIDs: _uids inContext: context]
             objectEnumerator];
   while ((folder = [e nextObject])) {
     NSException           *error;
     SOGoTaskObject *task;
     
-    task = [folder lookupName:[self nameInContainer] inContext:ctx
-                   acquire:NO];
+    task = [folder lookupName: [self nameInContainer]
+                  inContext: context
+                   acquire: NO];
     if (![task isNotNull]) {
       [self logWithFormat:@"Note: did not find '%@' in folder: %@",
              [self nameInContainer], folder];
@@ -452,52 +448,6 @@ static NSString                  *mailTemplateDefaultLanguage = nil;
   return [self saveContentString:_iCalString baseSequence:0];
 }
 
-- (NSException *)changeParticipationStatus:(NSString *)_status
-  inContext:(id)_ctx
-{
-  iCalToDo *task;
-  iCalPerson      *p;
-  NSString        *newContent;
-  NSException     *ex;
-  NSString        *myEMail;
-  
-  // TODO: do we need to use SOGoTask? (prefer iCalToDo?)
-  task = (iCalToDo *) [self component: NO];
-
-  if (task == nil) {
-    return [NSException exceptionWithHTTPStatus:500 /* Server Error */
-                        reason:@"unable to parse task record"];
-  }
-  
-  myEMail = [[_ctx activeUser] email];
-  if ((p = [task findParticipantWithEmail:myEMail]) == nil) {
-    return [NSException exceptionWithHTTPStatus:404 /* Not Found */
-                        reason:@"user does not participate in this "
-                               @"task"];
-  }
-  
-  [p setPartStat:_status];
-  newContent = [[task parent] versitString];
-  
-  // TODO: send iMIP reply mails?
-  
-//   [task release]; task = nil;
-  
-  if (newContent == nil) {
-    return [NSException exceptionWithHTTPStatus:500 /* Server Error */
-                        reason:@"Could not generate iCalendar data ..."];
-  }
-  
-  if ((ex = [self saveContentString:newContent]) != nil) {
-    // TODO: why is the exception wrapped?
-    return [NSException exceptionWithHTTPStatus:500 /* Server Error */
-                        reason:[ex reason]];
-  }
-  
-  return nil /* means: no error */;
-}
-
-
 /* message type */
 
 - (NSString *)outlookMessageClass {
index fb81bb53a408f15f079c6250f197c3191c5f2aec..6e61cc6753a73da770fdc0e130d20d942888dd70 100644 (file)
     }
 }
 
-- (void) initContactSourcesInContext: (WOContext *) context;
+- (void) initContactSources
 {
   if (!contactFolders)
     {
 }
 
 - (id) lookupName: (NSString *) name
-        inContext: (WOContext *) context
+        inContext: (WOContext *) lookupContext
           acquire: (BOOL) acquire
 {
   id obj;
   id folder;
 
   /* first check attributes directly bound to the application */
-  obj = [super lookupName: name inContext: context acquire: NO];
+  obj = [super lookupName: name inContext: lookupContext acquire: NO];
   if (!obj)
     {
       if (!contactFolders)
-        [self initContactSourcesInContext: context];
+        [self initContactSources];
 
       folder = [contactFolders objectForKey: name];
       obj = ((folder)
 
 - (NSArray *) toManyRelationshipKeys
 {
-  WOContext *context;
-
   if (!contactFolders)
-    {
-      context = [[WOApplication application] context];
-      [self initContactSourcesInContext: context];
-    }
+    [self initContactSources];
 
   return [contactFolders allKeys];
 }
 
 - (NSArray *) contactFolders
 {
-  WOContext *context;
-
   if (!contactFolders)
-    {
-      context = [[WOApplication application] context];
-      [self initContactSourcesInContext: context];
-    }
+    [self initContactSources];
 
   return [contactFolders allValues];
 }
 
 - (NSString *) roleOfUser: (NSString *) uid
-                inContext: (WOContext *) context
 {
   NSArray *roles, *traversalPath;
   NSString *objectName, *role;
index fb51aa20d71328fecd620f0113cc0352d766e245..3338f05cc10f7c4ebaf0cd02c1bb5a1ca7ce409e 100644 (file)
 }
 
 - (id) lookupName: (NSString *) name
-        inContext: (WOContext *) context
+        inContext: (WOContext *) lookupContext
           acquire: (BOOL) acquire
 {
   id obj;
 //   NSLog (@"looking up name '%@'...", name);
 
   /* first check attributes directly bound to the application */
-  obj = [super lookupName: name inContext: context acquire: NO];
+  obj = [super lookupName: name inContext: lookupContext acquire: NO];
   if (!obj)
     {
       [self _loadEntries: name];
index e82cd1ff76a104df91e8dc27fd86c264d1d6720e..9f66bb9e752b5876513f6a64af50548b6305c1bf 100644 (file)
@@ -344,7 +344,6 @@ static NSString    *fromInternetSuffixPattern = nil;
 {
   NSDictionary  *lInfo;
   NGMimeMessage *message;  
-  WOContext     *ctx;
   NSString *fromInternetSuffix;
   BOOL     addSuffix;
   id       body;
@@ -352,12 +351,11 @@ static NSString    *fromInternetSuffixPattern = nil;
   if ((lInfo = [self fetchInfo]) == nil)
     return nil;
   
-  ctx       = [[WOApplication application] context];
-  addSuffix = [ctx isAccessFromIntranet] ? NO : YES;
+  addSuffix = [context isAccessFromIntranet] ? NO : YES;
   if (addSuffix) {
     fromInternetSuffix = 
       [fromInternetSuffixPattern stringByReplacingVariablesWithBindings:
-                                  [ctx request]
+                                  [context request]
                                 stringForUnknownBindings:@""];
     
     addSuffix = [fromInternetSuffix length] > 0 ? YES : NO;
index 8a362fddf26fb3794b679fdaf0262e6320dae993..a1c6285d92eb7a5411bebde5c5fea337cce9c66b 100644 (file)
@@ -124,16 +124,8 @@ static BOOL     useAltNamespace       = NO;
 /* identity */
 
 - (SOGoMailIdentity *)preferredIdentity {
-  WOContext *ctx;
-  
-  if ((ctx = [[WOApplication application] context]) == nil) {
-    [self logWithFormat:@"ERROR(%s): cannot procede without context!",
-           __PRETTY_FUNCTION__];
-    return nil;
-  }
-  
-  return [[ctx activeUser] primaryMailIdentityForAccount:
-                            [self nameInContainer]];
+  return [[context activeUser] primaryMailIdentityForAccount:
+                                [self nameInContainer]];
 }
 
 /* hierarchy */
@@ -161,7 +153,7 @@ static BOOL     useAltNamespace       = NO;
   NSString  *s;
   NSArray   *creds;
   
-  rq = [[(WOApplication *)[WOApplication application] context] request];
+  rq = [context request];
   
   s = [rq headerForKey:@"x-webobjects-remote-user"];
   if ([s length] > 0)
index d88bb9d5b08e08d29c32d449a0979dcc8be8af8d..ed041aa38c340904bd6bd8664397d08fabe77d68 100644 (file)
@@ -32,8 +32,7 @@ static NSString *AgenorShareLoginMarker  = @".-.";
 /* detect webmail being accessed from the outside */
 
 - (BOOL)isInternetRequest {
-  return [[(WOApplication *)[WOApplication application] context] 
-           isAccessFromIntranet] ? NO : YES;
+  return ([context isAccessFromIntranet] ? NO : YES);
 }
 
 /* listing the available mailboxes */
@@ -41,28 +40,15 @@ static NSString *AgenorShareLoginMarker  = @".-.";
 - (BOOL)isInHomeFolderBranchOfLoggedInAccount:(id)_ctx {
   id user;
 
-  if (_ctx == nil) _ctx = [[WOApplication application] context];
-  if (_ctx == nil) {
-    [self errorWithFormat:@"Missing context!"];
-    return NO;
-  }
-  
   user = [_ctx activeUser];
   return [[[self container] nameInContainer] isEqualToString:[user login]];
 }
 
 - (NSArray *)toManyRelationshipKeys {
-  WOContext *ctx;
   id        user;
   id        account;
   NSArray   *shares;
   
-  if ((ctx = [[WOApplication application] context]) == nil) {
-    [self logWithFormat:@"ERROR(%s): cannot procede without context!",
-           __PRETTY_FUNCTION__];
-    return nil;
-  }
-  
   /*
     Note: this is not strictly correct. The accounts being retrieved should be
           the accounts based on the container object of this folder. Given
@@ -73,10 +59,10 @@ static NSString *AgenorShareLoginMarker  = @".-.";
           functionality which isn't perfect either.
          => TODO
   */
-  user = [ctx activeUser];
+  user = [context activeUser];
   
   /* for now: return nothing if the home-folder does not belong to the login */
-  if (![self isInHomeFolderBranchOfLoggedInAccount:ctx]) {
+  if (![self isInHomeFolderBranchOfLoggedInAccount: context]) {
     [self warnWithFormat:@"User %@ tried to access mail hierarchy of %@",
          [user login], [[self container] nameInContainer]];
     return nil;
@@ -97,17 +83,11 @@ static NSString *AgenorShareLoginMarker  = @".-.";
 - (NSArray *)fetchIdentitiesWithOnlyEmitterAccess:(BOOL)_flag {
   WOContext *ctx;
   
-  if ((ctx = [[WOApplication application] context]) == nil) {
-    [self logWithFormat:@"ERROR(%s): cannot procede without context!",
-           __PRETTY_FUNCTION__];
-    return nil;
-  }
-  
   if ([self isInternetRequest]) { /* only show primary mailbox in Internet */
     // just return the primary identity
     id identity;
     
-    identity = [[ctx activeUser] primaryMailIdentity];
+    identity = [[context activeUser] primaryMailIdentity];
     return [identity isNotNull] ? [NSArray arrayWithObject:identity] : nil;
   }
   
index 26d996b86896b16e2e3c4825d541f6ef1ceb2ef8..7fbbbfc6b5438cfbaf6853dde108a9dcb0c92d2f 100644 (file)
@@ -149,7 +149,7 @@ static BOOL debugOn = YES;
   NSString  *auth;
   NSArray   *creds;
   
-  rq = [[(WOApplication *)[WOApplication application] context] request];
+  rq = [context request];
   if ((auth = [rq headerForKey:@"authorization"]) == nil) {
     /* no basic auth */
     return nil;
index 285c3296bb7ce4f05942e90adce7b7cd50dc99fb..ff120c2f7aa64a2f4e34d390b38300f433f76de4 100644 (file)
 
 - (NSString *) davMethodToObjC;
 
+#ifndef GNUSTEP_BASE_LIBRARY
+- (BOOL) boolValue;
+#endif
+
 @end
 
 #endif /* NSSTRING_URL_H */
index 77c4e4584cfac155e426a2df603600cadb481192..66ddda632bb59acb33e6a68391ceef45d4ddbc34 100644 (file)
@@ -20,6 +20,7 @@
  * Boston, MA 02111-1307, USA.
  */
 
+#import <Foundation/NSArray.h>
 #import <Foundation/NSEnumerator.h>
 
 #import "NSString+Utilities.h"
   return newName;
 }
 
+#ifndef GNUSTEP_BASE_LIBRARY
+- (BOOL) boolValue
+{
+  return !([self isEqualToString: @"0"]
+          || [self isEqualToString: @"NO"]);
+}
+#endif
+
 @end
index 3c7cc1a16b0442a29c495c3b11dedd8ae8a3dbb1..bfacb66ca34d6c5fa80f6d2d713cbe002c1d8b52 100644 (file)
 
 /* security */
 - (NSArray *) rolesOfUser: (NSString *) login
-                inContext: (WOContext *) context
 {
   NSMutableArray *sogoRoles;
   SOGoUser *user;
index 189f0781c8177c311e9cb50ce611ba90c4b20cce..054e4681d420f58acee511a1de12a6f414c463fe 100644 (file)
@@ -92,7 +92,6 @@ static NGLogger *logger = nil;
 }
 
 - (void)_setupFolders {
-  WOContext           *ctx;
   NSMutableDictionary *md;
   NSMutableArray      *ma;
   NSArray  *luids;
@@ -103,8 +102,6 @@ static NGLogger *logger = nil;
   if ((luids = [self uids]) == nil)
     return;
   
-  ctx = [[WOApplication application] context];
-  
   count = [luids count];
   ma = [NSMutableArray arrayWithCapacity:count + 1];
   md = [NSMutableDictionary dictionaryWithCapacity:count];
@@ -114,7 +111,7 @@ static NGLogger *logger = nil;
     id folder;
     
     uid    = [luids objectAtIndex:i];
-    folder = [self _primaryLookupFolderForUID:uid inContext:ctx];
+    folder = [self _primaryLookupFolderForUID:uid inContext: context];
     
     if ([folder isNotNull]) {
       [md setObject:folder forKey:uid];
index e06864b246151665f51ff19e2d64e4d8369407ab..b09b636ccd9956e7a42ea9dba1fc90b3eb2661d7 100644 (file)
@@ -44,9 +44,9 @@
 
 @interface SOGoObject : NSObject
 {
+  WOContext *context;
   NSString *nameInContainer;
   id       container;
-  NSTimeZone *userTimeZone;
   NSString *customOwner;
 }
 
 - (NSString *) nameInContainer;
 - (id) container;
 
-- (NSTimeZone *) serverTimeZone;
-- (NSTimeZone *) userTimeZone;
-- (NSTimeZone *) userTimeZone: (NSString *) username;
-
 /* ownership */
 
 - (void) setOwner: (NSString *) newOwner;
index 5e0ba15c44fda26f26e86a834531c1226cbf2850..a0be82859edc17dfa9b544d087297f79e296c5b0 100644 (file)
 @implementation SOGoObject
 
 static BOOL kontactGroupDAV = YES;
-static NSTimeZone *serverTimeZone = nil;
 
 + (int)version {
   return 0;
@@ -148,8 +147,6 @@ static NSTimeZone *serverTimeZone = nil;
 
 + (void) initialize
 {
-  NSString *tzName;
-
   NSUserDefaults *ud = [NSUserDefaults standardUserDefaults];
 
   kontactGroupDAV = 
@@ -168,15 +165,6 @@ static NSTimeZone *serverTimeZone = nil;
                               asDefaultForPermission: SoPerm_View];
   [[self soClassSecurityInfo] declareRole: SoRole_Owner
                               asDefaultForPermission: SoPerm_WebDAVAccess];
-
-  if (!serverTimeZone)
-    {
-      tzName = [ud stringForKey: @"SOGoServerTimeZone"];
-      if (!tzName)
-        tzName = @"Canada/Eastern";
-      serverTimeZone = [NSTimeZone timeZoneWithName: tzName];
-      [serverTimeZone retain];
-    }
 }
 
 + (void) _fillDictionary: (NSMutableDictionary *) dictionary
@@ -237,20 +225,11 @@ static NSTimeZone *serverTimeZone = nil;
 }
 
 /* DAV ACL properties */
-- (NSString *) _principalForUser: (NSString *) user
+- (NSString *) davOwner
 {
-  WOContext *context;
-
-  context = [[WOApplication application] context];
-
   return [NSString stringWithFormat: @"%@users/%@",
                    [self rootURLInContext: context],
-                   user];
-}
-
-- (NSString *) davOwner
-{
-  return [self _principalForUser: [self ownerInContext: nil]];
+                  [self ownerInContext: nil]];
 }
 
 - (NSString *) davAclRestrictions
@@ -267,9 +246,7 @@ static NSTimeZone *serverTimeZone = nil;
 - (SOGoDAVSet *) davPrincipalCollectionSet
 {
   NSString *usersUrl;
-  WOContext *context;
 
-  context = [[WOApplication application] context];
   usersUrl = [NSString stringWithFormat: @"%@users",
                        [self rootURLInContext: context]];
 
@@ -282,12 +259,10 @@ static NSTimeZone *serverTimeZone = nil;
   SOGoAuthenticator *sAuth;
   SoUser *user;
   NSArray *roles;
-  WOContext *context;
   SoClassSecurityInfo *sInfo;
   NSArray *davPermissions;
 
   sAuth = [SOGoAuthenticator sharedSOGoAuthenticator];
-  context = [[WOApplication application] context];
   user = [sAuth userInContext: context];
   roles = [user rolesForObject: self inContext: context];
   sInfo = [[self class] soClassSecurityInfo];
@@ -318,7 +293,7 @@ static NSTimeZone *serverTimeZone = nil;
   NSArray *privileges;
   NSMutableString *currentAce;
   NSMutableArray *davAces;
-  NSString *currentKey;
+  NSString *currentKey, *principal;
   SOGoDAVSet *privilegesDS;
 
   davAces = [NSMutableArray array];
@@ -332,9 +307,15 @@ static NSTimeZone *serverTimeZone = nil;
           appendFormat: @"<D:principal><D:property><D:%@/></D:property></D:principal>",
           [currentKey substringFromIndex: 1]];
       else
-        [currentAce
-          appendFormat: @"<D:principal><D:href>%@</D:href></D:principal>",
-          [self _principalForUser: currentKey]];
+       {
+         principal = [NSString stringWithFormat: @"%@users/%@",
+                               [self rootURLInContext: context],
+                               currentKey];
+         [currentAce
+           appendFormat: @"<D:principal><D:href>%@</D:href></D:principal>",
+           principal];
+       }
+
       privileges = [[aclsDictionary objectForKey: currentKey]
                      stringsWithFormat: @"<D:%@/>"];
       privilegesDS = [SOGoDAVSet davSetWithArray: privileges
@@ -395,16 +376,18 @@ static NSTimeZone *serverTimeZone = nil;
 
 /* end of properties */
 
-- (BOOL)doesRetainContainer {
+- (BOOL) doesRetainContainer
+{
   return YES;
 }
 
 - (id)initWithName:(NSString *)_name inContainer:(id)_container {
   if ((self = [super init])) {
+    context = [[WOApplication application] context];
+    [context retain];
     nameInContainer = [_name copy];
     container = 
       [self doesRetainContainer] ? [_container retain] : _container;
-    userTimeZone = nil;
     customOwner = nil;
   }
   return self;
@@ -415,12 +398,10 @@ static NSTimeZone *serverTimeZone = nil;
 }
 
 - (void)dealloc {
-  if (customOwner)
-    [customOwner release];
+  [context release];
+  [customOwner release];
   if ([self doesRetainContainer])
     [container release];
-  if (userTimeZone)
-    [userTimeZone release];
   [nameInContainer release];
   [super dealloc];
 }
@@ -709,45 +690,6 @@ static NSTimeZone *serverTimeZone = nil;
   return nil;
 }
 
-- (NSTimeZone *) serverTimeZone
-{
-  return serverTimeZone;
-}
-
-/* TODO: should be moved into SOGoUser */
-- (NSTimeZone *) userTimeZone
-{
-  NSUserDefaults *userPrefs;
-  WOContext *context;
-
-  if (!userTimeZone)
-    {
-      context = [[WOApplication application] context];
-      userPrefs = [[context activeUser] userDefaults];
-      userTimeZone = [NSTimeZone
-                       timeZoneWithName: [userPrefs stringForKey: @"timezonename"]];
-      if (!userTimeZone)
-        userTimeZone = [self serverTimeZone];
-      [userTimeZone retain];
-    }
-
-  return userTimeZone;
-}
-
-- (NSTimeZone *) userTimeZone: (NSString *) username
-{
-  NSUserDefaults *userPrefs;
-  AgenorUserManager *am;
-
-  am = [AgenorUserManager sharedUserManager];
-  userPrefs = [am getUserDefaultsForUID: username];
-  userTimeZone = [NSTimeZone timeZoneWithName: [userPrefs stringForKey: @"timezonename"]];
-  if (!userTimeZone)
-    userTimeZone = [self serverTimeZone];
-
-  return userTimeZone;
-}
-
 /* description */
 
 - (void)appendAttributesToDescription:(NSMutableString *)_ms {
index 62dc2ed9c80ab1ed40748347be4b6cf3372ac46a..3b87aa849d2f76fef1cce50261e810ba2a300f1e 100644 (file)
     context.activeUser
 */
 
-@class NSString, NSArray, NSDictionary, NSURL, NSUserDefaults;
+@class NSString;
+@class NSArray;
+@class NSDictionary;
+@class NSURL;
+@class NSUserDefaults;
+@class NSTimeZone;
 @class WOContext;
 
 @interface SOGoUser : SoUser
   NSString       *email;
   NSUserDefaults *userDefaults;
   NSUserDefaults *userSettings;
+  NSTimeZone *userTimeZone;
 }
 
++ (SOGoUser *) userWithLogin: (NSString *) login
+                   andRoles: (NSArray *) roles;
+
 /* properties */
 
-- (NSString *)email;
-- (NSString *)cn;
-- (NSURL *)freeBusyURL;
+- (NSString *) email;
+- (NSString *) cn;
+- (NSURL *) freeBusyURL;
 
 /* shares and identities */
 
-- (NSString *)primaryIMAP4AccountString;
-- (NSString *)primaryMailServer;
-- (NSArray *)additionalIMAP4AccountStrings;
-- (NSArray *)additionalEMailAddresses;
-- (NSDictionary *)additionalIMAP4AccountsAndEMails;
+- (NSString *) primaryIMAP4AccountString;
+- (NSString *) primaryMailServer;
+- (NSArray *) additionalIMAP4AccountStrings;
+- (NSArray *) additionalEMailAddresses;
+- (NSDictionary *) additionalIMAP4AccountsAndEMails;
 
 /* defaults */
 
 - (NSUserDefaults *) userDefaults;
 - (NSUserDefaults *) userSettings;
 
+- (NSTimeZone *) timeZone;
+- (NSTimeZone *) serverTimeZone;
+
 /* folders */
 
-- (id)homeFolderInContext:(id)_ctx;
-- (id)schedulingCalendarInContext:(id)_ctx;
+- (id) homeFolderInContext: (id) _ctx;
+- (id) schedulingCalendarInContext: (id) _ctx;
 
 - (NSArray *) rolesForObject: (NSObject *) object
                    inContext: (WOContext *) context;
index 6d863d530860ad5c92a2cac001c5fd3340b9741b..e10b9931c895c03adf97eef5889613a32b44bc9d 100644 (file)
 
 #import "SOGoUser.h"
 
+static NSTimeZone *serverTimeZone = nil;
+
 @interface NSObject (SOGoRoles)
 
-- (NSString *) roleOfUser: (NSString *) uid
-                inContext: (WOContext *) context;
-- (NSArray *) rolesOfUser: (NSString *) uid
-                inContext: (WOContext *) context;
+- (NSString *) roleOfUser: (NSString *) uid;
+- (NSArray *) rolesOfUser: (NSString *) uid;
 
 @end
 
 @implementation SOGoUser
 
++ (void) initialize
+{
+  NSString *tzName;
+
+  if (!serverTimeZone)
+    {
+      tzName = [[NSUserDefaults standardUserDefaults]
+                stringForKey: @"SOGoServerTimeZone"];
+      if (!tzName)
+        tzName = @"Canada/Eastern";
+      serverTimeZone = [NSTimeZone timeZoneWithName: tzName];
+      [serverTimeZone retain];
+    }
+}
+
++ (SOGoUser *) userWithLogin: (NSString *) login
+                   andRoles: (NSArray *) roles
+{
+  SOGoUser *user;
+
+  user = [[self alloc] initWithLogin: login roles: roles];
+  [user autorelease];
+
+  return user;
+}
+
 - (id) init
 {
   if ((self = [super init]))
   return self;
 }
 
-- (void)dealloc {
-  [self->userDefaults release];
-  [self->userSettings release];
-  [self->cn    release];
-  [self->email release];
+- (void) dealloc
+{
+  [userDefaults release];
+  [userSettings release];
+  [cn    release];
+  [email release];
   [super dealloc];
 }
 
 /* internals */
 
-- (AgenorUserManager *)userManager {
+- (AgenorUserManager *) userManager
+{
   static AgenorUserManager *um = nil;
   if (um == nil) um = [[AgenorUserManager sharedUserManager] retain];
+
   return um;
 }
 
 /* properties */
 
-- (NSString *)email {
-  if (self->email == nil)
-    self->email = [[[self userManager] getEmailForUID:[self login]] copy];
-  return self->email;
+- (NSString *) email
+{
+  if (email == nil)
+    {
+      email = [[self userManager] getEmailForUID: [self login]];
+      [email retain];
+    }
+
+  return email;
 }
 
-- (NSString *)cn {
-  if (self->cn == nil)
-    self->cn = [[[self userManager] getCNForUID:[self login]] copy];
-  return self->cn;
+- (NSString *) cn
+{
+  if (cn == nil)
+    {
+      cn = [[self userManager] getCNForUID: [self login]];
+      [cn retain];
+    }
+
+  return cn;
 }
 
-- (NSString *)primaryIMAP4AccountString {
-  return [[self userManager] getIMAPAccountStringForUID:[self login]];
+- (NSString *) primaryIMAP4AccountString
+{
+  return [[self userManager] getIMAPAccountStringForUID: [self login]];
 }
-- (NSString *)primaryMailServer {
-  return [[self userManager] getServerForUID:[self login]];
+
+- (NSString *) primaryMailServer
+{
+  return [[self userManager] getServerForUID: [self login]];
 }
 
-- (NSArray *)additionalIMAP4AccountStrings {
-  return [[self userManager]getSharedMailboxAccountStringsForUID:[self login]];
+- (NSArray *) additionalIMAP4AccountStrings
+{
+  return [[self userManager]getSharedMailboxAccountStringsForUID: [self login]];
 }
-- (NSArray *)additionalEMailAddresses {
-  return [[self userManager] getSharedMailboxEMailsForUID:[self login]];
+
+- (NSArray *) additionalEMailAddresses
+{
+  return [[self userManager] getSharedMailboxEMailsForUID: [self login]];
 }
 
-- (NSDictionary *)additionalIMAP4AccountsAndEMails {
-  return [[self userManager] getSharedMailboxesAndEMailsForUID:[self login]];
+- (NSDictionary *) additionalIMAP4AccountsAndEMails
+{
+  return [[self userManager] getSharedMailboxesAndEMailsForUID: [self login]];
 }
 
-- (NSURL *)freeBusyURL {
-  return [[self userManager] getFreeBusyURLForUID:[self login]];
+- (NSURL *) freeBusyURL
+{
+  return [[self userManager] getFreeBusyURLForUID: [self login]];
 }
 
 /* defaults */
   return userSettings;
 }
 
+- (NSTimeZone *) timeZone
+{
+  NSString *timeZoneName;
+
+  if (!userTimeZone)
+    {
+      timeZoneName = [[self userDefaults] stringForKey: @"TimeZone"];
+      if ([timeZoneName length] > 0)
+       userTimeZone = [NSTimeZone timeZoneWithName: timeZoneName];
+      else
+       userTimeZone = nil;
+      if (!userTimeZone)
+       userTimeZone = [self serverTimeZone];
+      [userTimeZone retain];
+    }
+
+  return userTimeZone;
+}
+
+- (NSTimeZone *) serverTimeZone
+{
+  return serverTimeZone;
+}
+
 /* folders */
 
 // TODO: those methods should check whether the traversal stack in the context
 //       already contains proper folders to improve caching behaviour
 
-- (id)homeFolderInContext:(id)_ctx {
+- (id) homeFolderInContext: (id) _ctx
+{
   /* Note: watch out for cyclic references */
   // TODO: maybe we should add an [activeUser reset] method to SOPE
   id folder;
   return folder;
 }
 
-- (id)schedulingCalendarInContext:(id)_ctx {
+- (id) schedulingCalendarInContext: (id) _ctx
+{
   /* Note: watch out for cyclic references */
   id folder;
 
     }
   if ([object respondsToSelector: @selector (rolesOfUser:inContext:)])
     {
-      sogoRoles = [object rolesOfUser: login inContext: context];
+      sogoRoles = [object rolesOfUser: login];
       if (sogoRoles)
         [rolesForObject addObjectsFromArray: sogoRoles];
     }
   if ([object respondsToSelector: @selector (roleOfUser:inContext:)])
     {
-      role = [object roleOfUser: login inContext: context];
+      role = [object roleOfUser: login];
       if (role)
         [rolesForObject addObject: role];
     }
index d0d6a34eb7c203bf8ee87a2c832c72a32458cc5f..8664beeda9b79b776abf8dc8073336c5944dd953 100644 (file)
   return self;
 }
 
-- (SOGoGroupsFolder *) lookupGroupsFolder
-{
-  return [self lookupName: @"Groups" inContext: nil acquire: NO];
-}
+// - (SOGoGroupsFolder *) lookupGroupsFolder
+// {
+//   return [self lookupName: @"Groups" inContext: nil acquire: NO];
+// }
 
 /* pathes */
 
   return contacts;
 }
 
-- (id) groupsFolder: (NSString *) _key
-          inContext: (WOContext *) _ctx
-{
-  return [$(@"SOGoGroupsFolder") objectWithName: _key inContainer: self];
-}
+// - (id) groupsFolder: (NSString *) _key
+//           inContext: (WOContext *) _ctx
+// {
+//   return [$(@"SOGoGroupsFolder") objectWithName: _key inContainer: self];
+// }
 
 - (id) mailAccountsFolder: (NSString *) _key
                 inContext: (WOContext *) _ctx
         }
       else if ([_key isEqualToString: @"Contacts"])
         obj = [self privateContacts: _key inContext: _ctx];
-      else if ([_key isEqualToString: @"Groups"])
-        obj = [self groupsFolder: _key inContext: _ctx];
+//       else if ([_key isEqualToString: @"Groups"])
+//         obj = [self groupsFolder: _key inContext: _ctx];
       else if ([_key isEqualToString: @"Mail"])
         obj = [self mailAccountsFolder: _key inContext: _ctx];
       else if ([_key isEqualToString: @"freebusy.ifb"])
-        obj = [self freeBusyObject:_key inContext:_ctx];
+        obj = [self freeBusyObject:_key inContext: _ctx];
       else
         obj = [NSException exceptionWithHTTPStatus: 404 /* Not Found */];
     }
   return obj;
 }
 
-/* FIXME: here is a vault of hackish ways to gain access to subobjects by
-   granting ro access to the homepage depending on the subobject in question.
-   This is wrong and dangerous. */
-- (NSString *) roleOfUser: (NSString *) uid
-                inContext: (WOContext *) context
-{
-  NSArray *roles, *traversalPath;
-  NSString *objectName, *role;
-
-  role = nil;
-  traversalPath = [context objectForKey: @"SoRequestTraversalPath"];
-  if ([traversalPath count] > 1)
-    {
-      objectName = [traversalPath objectAtIndex: 1];
-      if ([objectName isEqualToString: @"Calendar"]
-          || [objectName isEqualToString: @"Contacts"])
-        {
-          roles = [[context activeUser]
-                    rolesForObject: [self lookupName: objectName
-                                          inContext: context
-                                          acquire: NO]
-                    inContext: context];
-          if ([roles containsObject: SOGoRole_Assistant]
-              || [roles containsObject: SOGoRole_Delegate])
-            role = SOGoRole_Assistant;
-        }
-      else if ([objectName isEqualToString: @"freebusy.ifb"])
-        role = SOGoRole_Assistant;
-    }
-
-  return role;
-}
+// /* FIXME: here is a vault of hackish ways to gain access to subobjects by
+//    granting ro access to the homepage depending on the subobject in question.
+//    This is wrong and dangerous. */
+// - (NSString *) roleOfUser: (NSString *) uid
+//                 inContext: (WOContext *) context
+// {
+//   NSArray *roles, *traversalPath;
+//   NSString *objectName, *role;
+
+//   role = nil;
+//   traversalPath = [context objectForKey: @"SoRequestTraversalPath"];
+//   if ([traversalPath count] > 1)
+//     {
+//       objectName = [traversalPath objectAtIndex: 1];
+//       if ([objectName isEqualToString: @"Calendar"]
+//           || [objectName isEqualToString: @"Contacts"])
+//         {
+//           roles = [[context activeUser]
+//                     rolesForObject: [self lookupName: objectName
+//                                           inContext: context
+//                                           acquire: NO]
+//                     inContext: context];
+//           if ([roles containsObject: SOGoRole_Assistant]
+//               || [roles containsObject: SOGoRole_Delegate])
+//             role = SOGoRole_Assistant;
+//         }
+//       else if ([objectName isEqualToString: @"freebusy.ifb"])
+//         role = SOGoRole_Assistant;
+//     }
+
+//   return role;
+// }
 
 /* WebDAV */
 
           collections itself. So for use its the home folder, the
          public folder and the groups folder.
   */
-  WOContext *context;
   NSArray *tag;
 
-  context = [[WOApplication application] context];
   tag = [NSArray arrayWithObjects: @"href", @"DAV:", @"D",
                  [self baseURLInContext: context], nil];
 
index f8a0e549a44ed84938e9fcb70b6d61b9b90190d8..5a3285e101c14244ea0024c70aa33cd817bb3cb1 100644 (file)
   return self->item;
 }
 
-- (NSCalendarDate *)startTime {
+- (NSCalendarDate *) startTime
+{
   NSCalendarDate *date;
+  NSTimeZone *timeZone;
   
   date = [[self authorativeEvent] startDate];
-  [date setTimeZone:[[self clientObject] userTimeZone]];
+  timeZone = [[context activeUser] timeZone];
+  [date setTimeZone: timeZone];
+
   return date;
 }
 
-- (NSCalendarDate *)endTime {
+- (NSCalendarDate *) endTime
+{
   NSCalendarDate *date;
+  NSTimeZone *timeZone;
   
   date = [[self authorativeEvent] endDate];
-  [date setTimeZone:[[self clientObject] userTimeZone]];
+  timeZone = [[context activeUser] timeZone];
+  [date setTimeZone: timeZone];
+
   return date;
 }
 
index 7731f9eaae9e2ca51d91b8d0873ef2af623dad53..cbab376126c73d5062957660799dea126bc9f943 100644 (file)
@@ -28,6 +28,7 @@
 #import <NGExtensions/NSCalendarDate+misc.h>
 
 #import <Appointments/SOGoFreeBusyObject.h>
+#import <SOGo/SOGoUser.h>
 #import <SOGo/NSCalendarDate+SOGo.h>
 #import <SOGoUI/UIxComponent.h>
 
   NSCalendarDate *startDate, *endDate;
   NSString *queryDay, *additionalDays;
   NSTimeZone *uTZ;
+  SOGoUser *user;
 
   co = [self clientObject];
-  uTZ = [co userTimeZone];
+  user = [context activeUser];
+  uTZ = [user timeZone];
 
   queryDay = [self queryParameterForKey: @"sday"];
   if ([queryDay length])
index 6895273fe5f959dbf19e0790a7a109a346264238..8cca37cd03c8d60969c7333b3fa858efaeb6f251 100644 (file)
     };
     SOGoUserFolder = {
       superclass  = "SOGoFolder";
+      protectedBy = "<public>";
+      defaultAccess = "allow";
       /* protectedBy = "HomePage Access"; */
-      defaultRoles = {
-        "Homepage Access" = ( "Owner", "Assistant", "Delegate", "FreeBusy" );
-        "WebDAV Access" = ( "Owner", "Assistant", "Delegate", "FreeBusy" );
-        "Access Contents Information" = ( "Owner", "Assistant", "Delegate",
-                                          "FreeBusy" );
-      };
     };
     SOGoFolder = {
       superclass    = "SOGoObject";
     SOGoRootPage = {
     };
     SOGoUserFolder = {
-      methods = {
-        view = { 
-          protectedBy = "View";
-          pageName    = "SOGoUserHomePage"; 
-        };
-      };
     };
     SOGoGroupsFolder = {
       methods = {
index 0758c504bf10b64624d32864d0e6233d20e7e5ee..d18e248a193c1e408eb4b84bd04bb5ae34952ff7 100644 (file)
   02111-1307, USA.
 */
 
-#import "SOGoJSStringFormatter.h"
-#import "common.h"
-
+#import <Foundation/NSDictionary.h>
+#import <Foundation/NSException.h>
+#import <Foundation/NSUserDefaults.h>
+#import <Foundation/NSKeyValueCoding.h>
+#import <Foundation/NSPathUtilities.h>
 #import <NGObjWeb/SoHTTPAuthenticator.h>
+#import <NGObjWeb/SoObjects.h>
 #import <NGObjWeb/WOResourceManager.h>
-
-#import <SOGo/NSString+Utilities.h>
-
-#import <SOGo/SOGoUser.h>
-#import <SOGo/SOGoObject.h>
-#import <SOGo/SOGoCustomGroupFolder.h>
-#import <SOGo/NSCalendarDate+SOGo.h>
-
-#import "UIxJSClose.h"
+#import <NGObjWeb/WORequest.h>
+#import <NGObjWeb/WOContext+SoObjects.h>
+#import <NGExtensions/NSObject+Logs.h>
+#import <NGExtensions/NSString+misc.h>
+#import <NGExtensions/NSURL+misc.h>
+#import <SoObjects/SOGo/SOGoUser.h>
+#import <SoObjects/SOGo/SOGoObject.h>
+#import <SoObjects/SOGo/SOGoCustomGroupFolder.h>
+#import <SoObjects/SOGo/NSCalendarDate+SOGo.h>
+#import <SoObjects/SOGo/NSString+Utilities.h>
 
 #import "UIxComponent.h"
+#import "UIxJSClose.h"
 
 @interface UIxComponent (PrivateAPI)
 - (void)_parseQueryString:(NSString *)_s;
@@ -362,7 +367,7 @@ static BOOL uixDebugEnabled = NO;
 {
   NSString *dst, *rel;
 
-  dst = [[self userFolderPath] stringByAppendingPathComponent:_sub];
+  dst = [[self userFolderPath] stringByAppendingPathComponent: _sub];
   rel = [dst urlPathRelativeToPath:[self ownPath]];
 
   return rel;
@@ -370,13 +375,16 @@ static BOOL uixDebugEnabled = NO;
 
 - (NSCalendarDate *) selectedDate
 {
+  NSTimeZone *userTimeZone;
+
   if (!_selectedDate)
     {
+      userTimeZone = [[context activeUser] timeZone];
       _selectedDate
         = [NSCalendarDate
             dateFromShortDateString: [self queryParameterForKey: @"day"]
             andShortTimeString: [self queryParameterForKey: @"hm"]
-            inTimeZone: [[self clientObject] userTimeZone]];
+            inTimeZone: userTimeZone];
       [_selectedDate retain];
     }
 
@@ -385,7 +393,10 @@ static BOOL uixDebugEnabled = NO;
 
 - (NSString *) dateStringForDate: (NSCalendarDate *) _date
 {
-  [_date setTimeZone: [[self clientObject] userTimeZone]];
+  NSTimeZone *userTimeZone;
+
+  userTimeZone = [[context activeUser] timeZone];
+  [_date setTimeZone: userTimeZone];
 
   return [_date descriptionWithCalendarFormat:@"%Y%m%d"];
 }
index d3594c4b5f28a8499a67386abb849fc452c119ac..092d61cd44ea180ba0bc0f7e5102214dc6a65a26 100644 (file)
@@ -38,7 +38,6 @@ SchedulerUI_OBJC_FILES =              \
        UIxTaskView.m           \
        UIxTaskEditor.m         \
        UIxTaskProposal.m       \
-       UIxCalSelectTab.m               \
        UIxCalDateLabel.m               \
        UIxDatePicker.m                 \
        UIxTimeDateControl.m            \
index 17c12eaaa0110c0b9b5464fd00a440e4a70fa12c..3f1fa9b0718ed522d7410808ea1b2d783f9dfb93 100644 (file)
 - (NSCalendarDate *) newStartDate
 {
   NSCalendarDate *newStartDate, *now;
+  NSTimeZone *timeZone;
   int hour;
 
   newStartDate = [self selectedDate];
   if ([[self queryParameterForKey: @"hm"] length] == 0)
     {
       now = [NSCalendarDate calendarDate];
-      [now setTimeZone: [[self clientObject] userTimeZone]];
+      timeZone = [[context activeUser] timeZone];
+      [now setTimeZone: timeZone];
       if ([now isDateOnSameDay: newStartDate])
         {
           hour = [now hourOfDay];
 
 // TODO: add tentatively
 
-- (id) acceptOrDeclineAction: (BOOL) _accept
+- (id) acceptOrDeclineAction: (BOOL) accept
 {
-  [[self clientObject] changeParticipationStatus:
-                         _accept ? @"ACCEPTED" : @"DECLINED"
-                       inContext: [self context]];
+  [[self clientObject] changeParticipationStatus: (accept
+                                                  ? @"ACCEPTED"
+                                                  : @"DECLINED")];
 
   return self;
 }
 
 - (id) acceptAction
 {
-  return [self acceptOrDeclineAction:YES];
+  return [self acceptOrDeclineAction: YES];
 }
 
 - (id) declineAction
 {
-  return [self acceptOrDeclineAction:NO];
+  return [self acceptOrDeclineAction: NO];
 }
 
 @end
index 978a031462a4a76ebd24660a2df94596fd8b637a..f81d87eba8e784222ef7fcfc9d786febacb053db 100644 (file)
   [self setStartDateMonth:[NSNumber numberWithInt:[_date monthOfYear]]];
   [self setStartDateYear:[NSNumber numberWithInt:[_date yearOfCommonEra]]];
 }
-- (NSCalendarDate *)startDate {
+
+- (NSCalendarDate *) startDate
+{
+  NSTimeZone *timeZone;
+
+  timeZone = [[context activeUser] timeZone];
+
   return [NSCalendarDate dateWithYear:[[self startDateYear] intValue]
                         month:[[self startDateMonth] intValue]
                         day:[[self startDateDay] intValue]
                         hour:[[self startDateHour] intValue]
                         minute:[[self startDateMinute] intValue]
                         second:0
-                        timeZone:[[self clientObject] userTimeZone]];
+                        timeZone: timeZone];
 }
-- (void)setEndDate:(NSCalendarDate *)_date {
+
+- (void) setEndDate: (NSCalendarDate *) _date
+{
   [self setEndDateHour:[NSNumber numberWithInt:[_date hourOfDay]]];
   [self setEndDateMinute:[NSNumber numberWithInt:[_date minuteOfHour]]];
   [self setEndDateDay:[NSNumber numberWithInt:[_date dayOfMonth]]];
   [self setEndDateMonth:[NSNumber numberWithInt:[_date monthOfYear]]];
   [self setEndDateYear:[NSNumber numberWithInt:[_date yearOfCommonEra]]];
 }
-- (NSCalendarDate *)endDate {
+
+- (NSCalendarDate *) endDate
+{
+  NSTimeZone *timeZone;
+
+  timeZone = [[context activeUser] timeZone];
+
   return [NSCalendarDate dateWithYear:[[self endDateYear] intValue]
                         month:[[self endDateMonth] intValue]
                         day:[[self endDateDay] intValue]
                         hour:[[self endDateHour] intValue]
                         minute:[[self endDateMinute] intValue]
                         second:59
-                        timeZone:[[self clientObject] userTimeZone]];
+                        timeZone: timeZone];
 }
 
 - (void)setDuration:(id)_duration {
   // TODO: from startdate to enddate
   NSMutableArray *ma;
   NSCalendarDate *base, *stop, *current;
-  
+  NSTimeZone *timeZone;
+
+  timeZone = [[context activeUser] timeZone];
   base = [NSCalendarDate dateWithYear:[[self startDateYear] intValue]
                         month:[[self startDateMonth] intValue]
                         day:[[self startDateDay] intValue]
                         hour:12 minute:0 second:0
-                        timeZone:[[self clientObject] userTimeZone]];
+                        timeZone: timeZone];
   stop = [NSCalendarDate dateWithYear:[[self endDateYear] intValue]
                         month:[[self endDateMonth] intValue]
                         day:[[self endDateDay] intValue]
                         hour:12 minute:0 second:0
-                        timeZone:[[self clientObject] userTimeZone]];
-  
-  ma = [NSMutableArray arrayWithCapacity:16];
+                        timeZone: timeZone];
+  ma = [NSMutableArray arrayWithCapacity: 16];
   
   current = base;
-  while ([current compare:stop] != NSOrderedDescending) {
-    [current setTimeZone:[[self clientObject] userTimeZone]];
-    [ma addObject:current];
+  while ([current compare:stop] != NSOrderedDescending)
+    {
+      [current setTimeZone: timeZone];
+      [ma addObject:current];
     
     /* Note: remember the timezone behaviour of the method below! */
-    current = [current dateByAddingYears:0 months:0 days:1];
-  }
+      current = [current dateByAddingYears:0 months:0 days:1];
+    }
+
   return ma;
 }
 
 - (BOOL)isSlotRangeGreen:(NGCalendarDateRange *)_slotRange {
   NGCalendarDateRange *aptRange;
   NSCalendarDate *aptStartDate, *aptEndDate;
+  NSTimeZone *timeZone;
 
   if (_slotRange == nil)
     return NO;
   aptEndDate   = [[NSCalendarDate alloc] initWithTimeIntervalSince1970:
                                           [aptStartDate timeIntervalSince1970]
                                         + [self durationAsTimeInterval]];
-  [aptStartDate setTimeZone:[[self clientObject] userTimeZone]];
-  [aptEndDate   setTimeZone:[[self clientObject] userTimeZone]];
+  timeZone = [[context activeUser] timeZone];
+  [aptStartDate setTimeZone: timeZone];
+  [aptEndDate   setTimeZone: timeZone];
   aptRange = [NGCalendarDateRange calendarDateRangeWithStartDate:aptStartDate
                                  endDate:aptEndDate];
   [aptEndDate release]; aptEndDate = nil;
index 306e0640653cca5a9c97b6f55f33a7b541cf685b..f1d23785258ac42cead15b35dd7922b5f5e577fd 100644 (file)
   id item;
 }
 
-- (iCalEvent *)appointment;
+- (iCalEvent *) appointment;
 
 /* permissions */
-- (BOOL)canAccessApt;
-- (BOOL)canEditApt;
+- (BOOL) canAccessApt;
+- (BOOL) canEditApt;
   
-- (SOGoDateFormatter *)dateFormatter;
-- (NSCalendarDate *)startTime;
-- (NSCalendarDate *)endTime;
+- (SOGoDateFormatter *) dateFormatter;
+- (NSCalendarDate *) startTime;
+- (NSCalendarDate *) endTime;
   
-- (NSString *)attributesTabLink;
-- (NSString *)participantsTabLink;
+- (NSString *) attributesTabLink;
+- (NSString *) participantsTabLink;
 
-- (NSString *)completeHrefForMethod:(NSString *)_method
-  withParameter:(NSString *)_param
-  forKey:(NSString *)_key;
+- (NSString *) completeHrefForMethod: (NSString *) _method
+                      withParameter: (NSString *) _param
+                             forKey: (NSString *) _key;
 
 @end
 
index d1aeb4267b263e5cdcfb9b22a7f16436dc76e029..8adb3a9b59ccb624c8cbd4bd22b996c630ff7974 100644 (file)
 
 - (NSCalendarDate *)startTime {
   NSCalendarDate *date;
-    
+  NSTimeZone *timeZone;
+
+  timeZone = [[context activeUser] timeZone];
   date = [[self appointment] startDate];
-  [date setTimeZone:[[self clientObject] userTimeZone]];
+  [date setTimeZone: timeZone];
+
   return date;
 }
 
 - (NSCalendarDate *)endTime {
   NSCalendarDate *date;
-  
+  NSTimeZone *timeZone;
+
+  timeZone = [[context activeUser] timeZone];
   date = [[self appointment] endDate];
-  [date setTimeZone:[[self clientObject] userTimeZone]];
+  [date setTimeZone: timeZone];
+
   return date;
 }
 
index 5da22d549adc09ba33a738eca7aebcb3697cbc62..92d227d8f678d3569b511fdae4304ccbc858c0b4 100644 (file)
   date = [NSCalendarDate dateWithTimeIntervalSince1970:
                            [[currentAppointment objectForKey: @"startdate"]
                              intValue]];
-  [date setTimeZone: [[self clientObject] userTimeZone]];
+  [date setTimeZone: timeZone];
 
   return [[self itemDateFormatter] stringForObjectValue: date];
 }
   date = [NSCalendarDate dateWithTimeIntervalSince1970:
                            [[currentAppointment objectForKey: @"enddate"]
                              intValue]];
-  [date setTimeZone: [[self clientObject] userTimeZone]];
+  [date setTimeZone: timeZone];
 
   return [[self itemDateFormatter] stringForObjectValue: date];
 }
 
   intDate = [[currentAppointment objectForKey: @"startdate"] intValue];
   date = [NSCalendarDate dateWithTimeIntervalSince1970: intDate];
-  [date setTimeZone: [[self clientObject] userTimeZone]];
+  [date setTimeZone: timeZone];
 
   return [NSString stringWithFormat: @"%d%.2d%.2d",
                    [date yearOfCommonEra],
 
   intDate = [[currentAppointment objectForKey: @"startdate"] intValue];
   date = [NSCalendarDate dateWithTimeIntervalSince1970: intDate];
-  [date setTimeZone: [[self clientObject] userTimeZone]];
+  [date setTimeZone: timeZone];
 
   return [NSString stringWithFormat: @"%.2d%.2d",
                    [date hourOfDay],
index 6ab548c85a97722ac59a39aefb8f5b056631ac7b..bfb2efc1fc266bfe92eb29d3a63160258887722d 100644 (file)
@@ -33,7 +33,7 @@
 - (void) setSelectedDate: (NSCalendarDate *) _date
 {
   ASSIGN (selectedDate, _date);
-  [selectedDate setTimeZone: [[self clientObject] userTimeZone]];
+  [selectedDate setTimeZone: timeZone];
 }
 
 - (NSCalendarDate *) selectedDate
index e5c82ecde949eaa084ce2d646f7c4044a18e8913..53bd5a757f923f6cc87a71b2eb5274bf2038d30c 100644 (file)
 
 - (id) init
 {
-  NSTimeZone *tz;
-
   if ((self = [super init]))
     {
-      tz = [[self clientObject] userTimeZone];
       monthAptFormatter
-        = [[SOGoAptFormatter alloc] initWithDisplayTimeZone: tz];
+        = [[SOGoAptFormatter alloc] initWithDisplayTimeZone: timeZone];
       [monthAptFormatter setShortMonthTitleOnly];
       dateFormatter = [[SOGoDateFormatter alloc]
                         initWithLocale: [self locale]];
diff --git a/UI/Scheduler/UIxCalSelectTab.m b/UI/Scheduler/UIxCalSelectTab.m
deleted file mode 100644 (file)
index f77e7b3..0000000
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
-  Copyright (C) 2004 SKYRIX Software AG
-
-  This file is part of OpenGroupware.org.
-
-  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 <SOGoUI/UIxComponent.h>
-#include <NGObjWeb/NGObjWeb.h>
-#include <NGExtensions/NGExtensions.h>
-
-
-@interface UIxCalSelectTab : UIxComponent
-{
-    NSString *selection;
-    NSCalendarDate *currentDate;
-}
-
-@end
-
-
-@implementation UIxCalSelectTab
-
-- (void)dealloc {
-    [self->selection release];
-    [self->currentDate release];
-    [super dealloc];
-}
-
-- (void)setSelection:(NSString *)_selection {
-    ASSIGN(self->selection, _selection);
-}
-
-- (NSString *)selection {
-    return self->selection;
-}
-
-- (void)setCurrentDate:(NSCalendarDate *)_date {
-    [_date setTimeZone:[[self clientObject] userTimeZone]];
-    ASSIGN(self->currentDate, _date);
-}
-
-- (NSCalendarDate *)currentDate {
-    return self->currentDate;
-}
-
-
-/* labels */
-
-
-- (NSString *)dayLabel {
-    return [NSString stringWithFormat:@"%d",
-        [self->currentDate dayOfMonth]];
-}
-
-- (NSString *)weekLabel {
-    NSString *wlbl;
-    
-    wlbl = [self labelForKey:@"Week"];
-    return [NSString stringWithFormat:@"%@ %d",
-        wlbl,
-        [self->currentDate weekOfYear]];
-}
-
-- (NSString *)monthLabel {
-    return [NSString stringWithFormat:@"%@",
-        [self localizedNameForMonthOfYear:[self->currentDate monthOfYear]]];
-}
-
-- (NSString *)yearLabel {
-    return [NSString stringWithFormat:@"%d",
-        [self->currentDate yearOfCommonEra]];
-}
-
-
-/* hrefs */
-
-- (NSString *)scheduletabLink {
-  return [self completeHrefForMethod:@"schedule"];
-}
-
-- (NSString *)daytabLink {
-    return [self completeHrefForMethod:@"dayoverview"];
-}
-
-- (NSString *)weektabLink {
-    return [self completeHrefForMethod:@"weekoverview"];
-}
-
-- (NSString *)monthtabLink {
-    return [self completeHrefForMethod:@"monthoverview"];
-}
-
-- (NSString *)yeartabLink {
-    return [self completeHrefForMethod:@"yearoverview"];
-}
-
-
-@end
index 9cf7c7bb776e2443634bdb0261d7520723b57d08..253e30f24770d811d5f486706611f75968959362 100644 (file)
@@ -17,6 +17,7 @@
 @class NSDictionary;
 @class NSMutableDictionary;
 @class NSString;
+@class NSTimeZone;
 
 @class SOGoAptFormatter;
 @class SOGoAppointmentFolder;
@@ -29,6 +30,7 @@
   NSArray *allDayApts;
   id appointment;
   NSCalendarDate *currentDay;
+  NSTimeZone *timeZone;
   SOGoAptFormatter *aptFormatter;
   SOGoAptFormatter *aptTooltipFormatter;
   SOGoAptFormatter *privateAptFormatter;
index 726fca518f2dc0222f04ee809754c75ac3eebdb0..0d1c9426a1465528519fcabd3291e3a3bbc6192e 100644 (file)
@@ -43,17 +43,16 @@ static BOOL shouldDisplayWeekend = NO;
   self = [super init];
   if (self)
     {
-      NSTimeZone *tz;
-
-      tz = [[self clientObject] userTimeZone];
+      timeZone = [[context activeUser] timeZone];
+      [timeZone retain];
       aptFormatter
-        = [[SOGoAptFormatter alloc] initWithDisplayTimeZone: tz];
+        = [[SOGoAptFormatter alloc] initWithDisplayTimeZone: timeZone];
       aptTooltipFormatter
-        = [[SOGoAptFormatter alloc] initWithDisplayTimeZone: tz];
+        = [[SOGoAptFormatter alloc] initWithDisplayTimeZone: timeZone];
       privateAptFormatter
-        = [[SOGoAptFormatter alloc] initWithDisplayTimeZone: tz];
+        = [[SOGoAptFormatter alloc] initWithDisplayTimeZone: timeZone];
       privateAptTooltipFormatter
-        = [[SOGoAptFormatter alloc] initWithDisplayTimeZone: tz];
+        = [[SOGoAptFormatter alloc] initWithDisplayTimeZone: timeZone];
       [self configureFormatters];
       componentsData = [NSMutableDictionary new];
     }
@@ -72,6 +71,7 @@ static BOOL shouldDisplayWeekend = NO;
   [aptTooltipFormatter release];
   [privateAptFormatter release];
   [privateAptTooltipFormatter release];
+  [timeZone release];
   [super dealloc];
 }
 
@@ -322,8 +322,8 @@ static BOOL shouldDisplayWeekend = NO;
 
 - (void) setCurrentDay:(NSCalendarDate *) _day
 {
-  [_day setTimeZone: [[self clientObject] userTimeZone]];
-  ASSIGN(currentDay, _day);
+  [_day setTimeZone: timeZone];
+  ASSIGN (currentDay, _day);
 }
 
 - (NSCalendarDate *) currentDay
@@ -478,8 +478,7 @@ static BOOL shouldDisplayWeekend = NO;
 
   clientObject = [self clientObject];
 
-  folders = [[clientObject calendarFoldersInContext: context]
-             objectEnumerator];
+  folders = [[clientObject calendarFolders] objectEnumerator];
   currentFolderDict = [folders nextObject];
   while (currentFolderDict)
     {
index d28e94847ccb1666c25686ab5a8d1dff45a7be89..5903aecbf05d661e202e1545f1a94292a7e6dd88 100644 (file)
@@ -112,8 +112,7 @@ colorForNumber (unsigned int number)
   NSDictionary *currentFolder;
   unsigned int count;
 
-  calendarFolders
-    = [[self clientObject] calendarFoldersInContext: context];
+  calendarFolders = [[self clientObject] calendarFolders];
   if (!colors)
     {
       colors = [NSMutableDictionary new];
index 11258889a97d75742f2fbdf8b312642b88ea1ed3..7ddb35d58a8b2939aad74f04fae3f6d069f84062 100644 (file)
@@ -24,6 +24,7 @@
 #import <Foundation/NSBundle.h>
 #import <Foundation/NSException.h>
 #import <Foundation/NSCalendarDate.h>
+#import <Foundation/NSKeyValueCoding.h>
 #import <Foundation/NSString.h>
 #import <Foundation/NSUserDefaults.h>
 #import <Foundation/NSURL.h>
@@ -45,6 +46,7 @@
 #import <SoObjects/Appointments/SOGoAppointmentFolder.h>
 #import <SoObjects/Appointments/SOGoAppointmentObject.h>
 #import <SoObjects/Appointments/SOGoTaskObject.h>
+#import <SoObjects/SOGo/NSString+Utilities.h>
 
 #import "UIxComponent+Agenor.h"
 
     {
       calendarList = [NSMutableArray new];
       folder = [[self clientObject] container];
-      allCalendars
-       = [[folder calendarFoldersInContext: context] objectEnumerator];
+      allCalendars = [[folder calendarFolders] objectEnumerator];
       currentCalendar = [allCalendars nextObject];
       while (currentCalendar)
        {
 
   co = [self clientObject];
   if (![co
-         respondsToSelector: @selector(changeParticipationStatus:inContext:)])
+         respondsToSelector: @selector(changeParticipationStatus:)])
     return [NSException exceptionWithHTTPStatus:400 /* Bad Request */
                         reason:
                           @"method cannot be invoked on the specified object"];
index 4a34ac6bd36a20d7263f54b6587ab33b5991e70d..360cdf0196e99679604ed0aec03338798c63af49 100644 (file)
 {
   NSCalendarDate *newStartDate, *now;
   int hour;
+  NSTimeZone *timeZone;
+
+  timeZone = [[context activeUser] timeZone];
 
   newStartDate = [self selectedDate];
   if ([[self queryParameterForKey: @"hm"] length] == 0)
     {
       now = [NSCalendarDate calendarDate];
-      [now setTimeZone: [[self clientObject] userTimeZone]];
+      [now setTimeZone: timeZone];
       if ([now isDateOnSameDay: newStartDate])
         {
           hour = [now hourOfDay];
 - (id) acceptOrDeclineAction: (BOOL) _accept
 {
   [[self clientObject] changeParticipationStatus:
-                         _accept ? @"ACCEPTED" : @"DECLINED"
-                       inContext: [self context]];
+                         _accept ? @"ACCEPTED" : @"DECLINED"];
 
   return self;
 }
 
 - (id) acceptAction
 {
-  return [self acceptOrDeclineAction:YES];
+  return [self acceptOrDeclineAction: YES];
 }
 
 - (id) declineAction
 {
-  return [self acceptOrDeclineAction:NO];
+  return [self acceptOrDeclineAction: NO];
 }
 
 - (id) changeStatusAction
index c558ccdd29008634ce91f0e2aff390f16cb607a1..bdd092d02c696ef50576a6ad5ae86f3cea494523 100644 (file)
   [self setStartDateMonth:[NSNumber numberWithInt:[_date monthOfYear]]];
   [self setStartDateYear:[NSNumber numberWithInt:[_date yearOfCommonEra]]];
 }
-- (NSCalendarDate *)startDate {
+
+- (NSCalendarDate *) startDate
+{
+  NSTimeZone *timeZone;
+
+  timeZone = [[context activeUser] timeZone];
+  
   return [NSCalendarDate dateWithYear:[[self startDateYear] intValue]
                         month:[[self startDateMonth] intValue]
                         day:[[self startDateDay] intValue]
                         hour:[[self startDateHour] intValue]
                         minute:[[self startDateMinute] intValue]
                         second:0
-                        timeZone:[[self clientObject] userTimeZone]];
+                        timeZone: timeZone];
 }
-- (void)setEndDate:(NSCalendarDate *)_date {
+
+- (void) setEndDate: (NSCalendarDate *) _date
+{
   [self setEndDateHour:[NSNumber numberWithInt:[_date hourOfDay]]];
   [self setEndDateMinute:[NSNumber numberWithInt:[_date minuteOfHour]]];
   [self setEndDateDay:[NSNumber numberWithInt:[_date dayOfMonth]]];
   [self setEndDateMonth:[NSNumber numberWithInt:[_date monthOfYear]]];
   [self setEndDateYear:[NSNumber numberWithInt:[_date yearOfCommonEra]]];
 }
-- (NSCalendarDate *)endDate {
+
+- (NSCalendarDate *) endDate
+{
+  NSTimeZone *timeZone;
+
+  timeZone = [[context activeUser] timeZone];
+
   return [NSCalendarDate dateWithYear:[[self endDateYear] intValue]
                         month:[[self endDateMonth] intValue]
                         day:[[self endDateDay] intValue]
                         hour:[[self endDateHour] intValue]
                         minute:[[self endDateMinute] intValue]
                         second:59
-                        timeZone:[[self clientObject] userTimeZone]];
+                        timeZone: timeZone];
 }
 
 - (void)setDuration:(id)_duration {
   return ma;
 }
 
-- (NSArray *)days {
+- (NSArray *) days
+{
   // TODO: from startdate to enddate
   NSMutableArray *ma;
-  NSCalendarDate *base, *stop, *current;
-  
-  base = [NSCalendarDate dateWithYear:[[self startDateYear] intValue]
-                        month:[[self startDateMonth] intValue]
-                        day:[[self startDateDay] intValue]
-                        hour:12 minute:0 second:0
-                        timeZone:[[self clientObject] userTimeZone]];
-  stop = [NSCalendarDate dateWithYear:[[self endDateYear] intValue]
-                        month:[[self endDateMonth] intValue]
-                        day:[[self endDateDay] intValue]
-                        hour:12 minute:0 second:0
-                        timeZone:[[self clientObject] userTimeZone]];
+  NSCalendarDate *base, *stop, *current;  
+  NSTimeZone *timeZone;
+
+  timeZone = [[context activeUser] timeZone];
+  base = [NSCalendarDate dateWithYear: [[self startDateYear] intValue]
+                        month: [[self startDateMonth] intValue]
+                        day: [[self startDateDay] intValue]
+                        hour: 12 minute: 0 second: 0
+                        timeZone: timeZone];
+  stop = [NSCalendarDate dateWithYear: [[self endDateYear] intValue]
+                        month: [[self endDateMonth] intValue]
+                        day: [[self endDateDay] intValue]
+                        hour: 12 minute: 0 second: 0
+                        timeZone: timeZone];
   
   ma = [NSMutableArray arrayWithCapacity:16];
   
   current = base;
   while ([current compare:stop] != NSOrderedDescending) {
-    [current setTimeZone:[[self clientObject] userTimeZone]];
+    [current setTimeZone: timeZone];
     [ma addObject:current];
     
     /* Note: remember the timezone behaviour of the method below! */
     current = [current dateByAddingYears:0 months:0 days:1];
   }
+
   return ma;
 }
 
   return idx == NSNotFound ? YES : NO;
 }
 
-- (BOOL)isSlotRangeGreen:(NGCalendarDateRange *)_slotRange {
+- (BOOL)isSlotRangeGreen: (NGCalendarDateRange *) _slotRange
+{
   NGCalendarDateRange *aptRange;
   NSCalendarDate *aptStartDate, *aptEndDate;
+  NSTimeZone *timeZone;
 
   if (_slotRange == nil)
     return NO;
-  
+
+  timeZone = [[context activeUser] timeZone];  
   /* calculate the interval requested by the user (can be larger) */
 
   aptStartDate = [_slotRange startDate];
   // TODO: gives warning on MacOSX
-  aptEndDate   = [[NSCalendarDate alloc] initWithTimeIntervalSince1970:
-                                          [aptStartDate timeIntervalSince1970]
-                                        + [self durationAsTimeInterval]];
-  [aptStartDate setTimeZone:[[self clientObject] userTimeZone]];
-  [aptEndDate   setTimeZone:[[self clientObject] userTimeZone]];
-  aptRange = [NGCalendarDateRange calendarDateRangeWithStartDate:aptStartDate
-                                 endDate:aptEndDate];
-  [aptEndDate release]; aptEndDate = nil;
+  aptEndDate
+    = [[NSCalendarDate alloc]
+       initWithTimeIntervalSince1970: ([aptStartDate timeIntervalSince1970]
+                                       + [self durationAsTimeInterval])];
+  [aptStartDate setTimeZone: timeZone];
+  [aptEndDate setTimeZone: timeZone];
+  aptRange = [NGCalendarDateRange calendarDateRangeWithStartDate: aptStartDate
+                                 endDate: aptEndDate];
+  [aptEndDate release];
+  aptEndDate = nil;
   
-  return [self isRangeGreen:aptRange];
+  return [self isRangeGreen: aptRange];
 }
 
 - (BOOL)isFirstHalfGreen {
index c2004dd858910b63b11c9969d1c18692bbf0b856..323034134b2841b476f773b5e36d6344ff9646ff 100644 (file)
   return dateFormatter;
 }
 
-- (NSCalendarDate *)startTime {
+- (NSCalendarDate *) startTime
+{
   NSCalendarDate *date;
-    
+  NSTimeZone *timeZone;
+
+  timeZone = [[context activeUser] timeZone];
   date = [[self task] startDate];
-  [date setTimeZone:[[self clientObject] userTimeZone]];
+  [date setTimeZone: timeZone];
+
   return date;
 }
 
-- (NSCalendarDate *)endTime {
+- (NSCalendarDate *) endTime
+{
   NSCalendarDate *date;
-  
+  NSTimeZone *timeZone;
+
+  timeZone = [[context activeUser] timeZone];
   date = [[self task] due];
-  [date setTimeZone:[[self clientObject] userTimeZone]];
+  [date setTimeZone: timeZone];
+
   return date;
 }
 
index f4606cf032385e6a11ea09ab7f74c46e631bb114..5b3646656aa6d028179f3deba7471860832fbe93 100644 (file)
   return label;
 }
 
-- (void)setDate:(NSCalendarDate *)_date {
-  NSLog (@"^^^^^^ %@: setDate: %@", self, _date);
+- (void) setDate: (NSCalendarDate *) _date
+{
+  NSTimeZone *timeZone;
   int minuteValue;
+
+  timeZone = [[context activeUser] timeZone];
   if (!_date)
     _date = [NSCalendarDate date];
-  [_date setTimeZone: [[self clientObject] userTimeZone]];
+  [_date setTimeZone: timeZone];
   [self _setDate: _date];
 
   minuteValue = [_date minuteOfHour];
 {
   NSCalendarDate *d;
   unsigned _year, _month, _day, _hour, _minute, _second;
+  NSTimeZone *timeZone;
 
-  NSLog (@"******************** %@: take values...", self);
+  timeZone = [[context activeUser] timeZone];
   /* call super, so that the form values are applied on the popups */
   [super takeValuesFromRequest:_rq inContext:_ctx];
 
       
       d = [NSCalendarDate dateWithYear: _year month:_month day:_day
                           hour:_hour minute:_minute second:_second
-                          timeZone: [[self clientObject] userTimeZone]];
+                          timeZone: timeZone];
       [self _setDate: d];
     }
 }
diff --git a/UI/Templates/SchedulerUI/UIxCalMonthOverview.wox b/UI/Templates/SchedulerUI/UIxCalMonthOverview.wox
deleted file mode 100644 (file)
index 795e5f7..0000000
+++ /dev/null
@@ -1,216 +0,0 @@
-<?xml version="1.0" standalone="yes"?>
-<var:component xmlns="http://www.w3.org/1999/xhtml"
-               xmlns:var="http://www.skyrix.com/od/binding"
-               xmlns:const="http://www.skyrix.com/od/constant"
-               xmlns:rsrc="OGo:url"
-               xmlns:label="OGo:label"
-               className="UIxPageFrame"
-               title="name"
->
-
-    <table id="skywintable"
-      class="wintable"
-      cellspacing="0"
-      cellpadding="5"
-      width="100%"
-      >
-      <tr>
-        <td class="window_label">
-          <var:component className="UIxCalDateLabel"
-            startDate="startDate"
-            endDate="endDate"
-            const:selection="month"
-            />
-        </td>
-    </tr>
-    <tr>
-      <td id="skywinbodycell" class="wincontent">
-        <table border="0" cellpadding="0" cellspacing="0" width="100%">
-          <tr bgcolor="#e8e8e0">
-            <td align="left">
-              <var:component className="UIxCalBackForthNavView"
-                             methodName="ownMethodName"
-                             prevQueryParameters="prevMonthQueryParameters"
-                             currentQueryParameters="todayQueryParameters"
-                             nextQueryParameters="nextMonthQueryParameters"
-                             label:label="this month"
-              />
-            </td>
-            <td align="right" valign="middle" width="80%">
-                <var:component className="UIxContactSelector"
-                  const:selectorId="uids" />
-<!--              <var:component className="AnaisUidSelector"
-                             calendarUIDs="clientObject.calendarUIDs"
-              /> -->
-            </td>
-          </tr>
-        </table>
-      </td>
-    </tr>
-    <tr>
-      <td id="skywinbodycell" class="wincontent">
-        <table border="0" width="100%" cellpadding="0" cellspacing="0">
-          <tr>
-            <td colspan="2">
-              <var:component className="UIxCalSelectTab"
-                             const:selection="month"
-                             currentDate="selectedDate"
-              >
-                <table border="0" cellpadding="4" width="100%" cellspacing="2">
-                  <tr>
-                    <td align="left" bgcolor="#e8e8e0" class="button_auto_env">
-                      <a var:href="ownMethodName"
-                         class="button_auto"
-                         var:queryDictionary="toggleShowRejectedAptsQueryParameters"
-                         label:string="$toggleShowRejectedAptsLabel"
-                      />
-                    </td>
-                    <td align="right" bgcolor="#e8e8e0">
-                      <table border="0" cellpadding="0" cellspacing="1">
-                        <tr>
-                          <td class="button_auto_env"
-                              nowrap="true"
-                              valign="middle"
-                              align="center"
-                          >
-                            <!--<a class="button_auto"
-                               href="monthprintview"
-                               var:queryDictionary="queryParameters"
-                               target="SOGoPrintView"
-                            ><var:string label:value="printview"/></a>-->
-                          </td>
-                          <td class="button_auto_env"
-                              nowrap="true"
-                              valign="middle"
-                              align="center"
-                          >
-                            <a class="button_auto"
-                               href="proposal"
-                               var:queryDictionary="queryParameters"
-                            ><var:string label:value="proposal"/></a>
-                          </td>
-                        </tr>
-                      </table>
-                    </td>
-                  </tr>
-                </table>
-                <var:month-overview list="appointments"
-                                    item="appointment"
-                                    currentDay="currentDay"
-                                    index="dayIndex"
-                                    year="year"
-                                    month="month"
-                                    const:startDateKey="startDate"
-                                    const:endDateKey="endDate"
-                                    const:class="monthoverview"
-                                    contentStyle="contentStyle"
-                                    const:width="100%"
-                >
-                  <var:month-info>
-                    <var:if condition="hasHolidayInfo">
-                      <var:string value="holidayInfo"
-                                  const:class="monthoverview_holidayinfo"
-                      />
-                    </var:if>
-                    <var:foreach list="allDayApts" item="appointment">
-                      <var:component className="UIxCalInlineAptView"
-                                     appointment="appointment"
-                                     formatter="aptFormatter"
-                                     tooltipFormatter="aptTooltipFormatter"
-                                     url="appointmentViewURL"
-                                     const:style="monthoverview"
-                                     referenceDate="currentDay"
-                                     canAccess="canAccessApt"
-                      />
-                      <br />
-                    </var:foreach>
-                  </var:month-info>
-                  <var:month-label const:orientation="top"
-                                   dayOfWeek="dayOfWeek"
-                                   const:class="monthoverview_title"
-                  >
-                    <var:string value="localizedDayOfWeekName"/>
-                  </var:month-label>
-                  <var:month-label const:orientation="left"
-                                   weekOfYear="weekOfYear"
-                                   class="weekStyle"
-                  >
-                    <a href="weekoverview"
-                       var:queryDictionary="currentWeekQueryParameters"
-                    ><var:string value="weekOfYear"/></a>
-                  </var:month-label>
-                  <var:month-title class="contentStyle">
-                    <span class="monthoverview_day">
-                      <a href="dayoverview"
-                         var:queryDictionary="currentDayQueryParameters"
-                      ><var:string value="currentDay.dayOfMonth"/></a>
-                    </span>
-                    <!-- removed for 0.8
-                     <br/>
-                    <span class="monthoverview_day_new">
-                      <a href="new"
-                         var:queryDictionary="currentDayQueryParameters"
-                      >[<var:string label:value="new"/>]</a>
-                    </span>-->
-                  </var:month-title>
-                  <var:month class="contentStyle">
-                    <var:component className="UIxCalInlineAptView"
-                                   appointment="appointment"
-                                   formatter="aptFormatter"
-                                   tooltipFormatter="aptTooltipFormatter"
-                                   url="appointmentViewURL"
-                                   const:style="monthoverview"
-                                   referenceDate="currentDay"
-                                   canAccess="canAccessApt"
-                    />
-                    <br />
-                  </var:month>
-                </var:month-overview>
-              </var:component>
-            </td>
-          </tr>
-          <tr bgcolor="#F5F5E9">
-            <td align="left" width="10">
-              <var:entity const:name="nbsp"/>
-            </td>
-            <td align="right">
-              <img border="0"
-                   alt=""
-                   rsrc:src="corner_right.gif"
-              />
-            </td>
-          </tr>
-          <tr>
-            <td colspan="2" bgcolor="#F5F5E9">
-              <table border="0" width="100%" cellpadding="10" cellspacing="0">
-                <tr/>
-              </table>
-            </td>
-          </tr>
-        </table>
-      </td>
-    </tr>
-  </table>
-  <!--
-  <hr />
-  start: <var:string value="startDate" /><br />
-  end: <var:string value="endDate" /><br />
-  -->
-  <!--
-  SOGo Server - <var:string value="name"/>
-  <br />
-  Client: <var:string value="clientObject"/>
-  <br />
-  Appointments: #<var:string value="appointments.count"/>
-  from <var:string value="startDate" />
-  to   <var:string value="endDate" />
-  <br />
-
-
-  <hr />
-
-  Appointments: 
-  <var:component className="UIxAptTableView" appointments="appointments"/>
-  -->
-<!-- pre><var:string value="appointments" const:insertBR="YES"/></pre -->
-</var:component>
diff --git a/UI/Templates/SchedulerUI/UIxCalSelectTab.wox b/UI/Templates/SchedulerUI/UIxCalSelectTab.wox
deleted file mode 100644 (file)
index fcc6018..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version='1.0' standalone='yes'?>
-
-<uix:tabview xmlns="http://www.w3.org/1999/xhtml"
-             xmlns:var="http://www.skyrix.com/od/binding"
-             xmlns:const="http://www.skyrix.com/od/constant"
-             xmlns:rsrc="OGo:url"
-             xmlns:label="OGo:label"
-             xmlns:uix="OGo:uix"
-             var:selection="selection"
-             const:tabStyle="tab"
-             const:selectedTabStyle="tab_selected"
-             const:bodyStyle="tabview_body"
->
-  <uix:tab const:key="day" var:label="dayLabel" var:href="daytabLink">
-     <var:component-content />
-  </uix:tab>
-  <uix:tab const:key="week" var:label="weekLabel" var:href="weektabLink">
-     <var:component-content />
-  </uix:tab>
-  <uix:tab const:key="month" var:label="monthLabel" var:href="monthtabLink">
-     <var:component-content />
-  </uix:tab>
-  <uix:tab const:key="year" var:label="yearLabel" var:href="yeartabLink">
-     <var:component-content />
-  </uix:tab>
-</uix:tabview>