]> err.no Git - scalable-opengroupware.org/commitdiff
git-svn-id: http://svn.opengroupware.org/SOGo/inverse/trunk@1087 d1b88da0-ebda-0310...
authorwolfgang <wolfgang@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Wed, 20 Jun 2007 14:06:45 +0000 (14:06 +0000)
committerwolfgang <wolfgang@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Wed, 20 Jun 2007 14:06:45 +0000 (14:06 +0000)
71 files changed:
ChangeLog
SoObjects/Mailer/SOGoDraftObject.m
SoObjects/Mailer/SOGoMailAccounts.m
SoObjects/Mailer/common.h
SoObjects/SOGo/AgenorUserDefaults.h
SoObjects/SOGo/AgenorUserDefaults.m
SoObjects/SOGo/GNUmakefile
SoObjects/SOGo/SOGoAuthenticator.h
SoObjects/SOGo/SOGoAuthenticator.m
SoObjects/SOGo/SOGoContentObject.m
SoObjects/SOGo/SOGoCustomGroupFolder.m
SoObjects/SOGo/SOGoDateFormatter.h [new file with mode: 0644]
SoObjects/SOGo/SOGoDateFormatter.m [new file with mode: 0644]
SoObjects/SOGo/SOGoFolder.m
SoObjects/SOGo/SOGoGroupFolder.m
SoObjects/SOGo/SOGoGroupsFolder.m
SoObjects/SOGo/SOGoLRUCache.h [deleted file]
SoObjects/SOGo/SOGoLRUCache.m [deleted file]
SoObjects/SOGo/SOGoUser.h
SoObjects/SOGo/SOGoUser.m
SoObjects/SOGo/SOGoUserFolder.m
SoObjects/SOGo/WOContext+Agenor.h [deleted file]
SoObjects/SOGo/WOContext+Agenor.m [deleted file]
SoObjects/SOGo/common.h [deleted file]
UI/Common/UIxPageFrame.m
UI/GNUmakefile
UI/MailPartViewers/UIxMailPartICalViewer.m
UI/MailerUI/UIxMailEditor.m
UI/MailerUI/UIxMailListView.h
UI/MailerUI/UIxMailListView.m
UI/MainUI/English.lproj/Locale
UI/MainUI/French.lproj/Locale
UI/PreferencesUI/English.lproj/Localizable.strings [new file with mode: 0644]
UI/PreferencesUI/French.lproj/Localizable.strings [new file with mode: 0644]
UI/PreferencesUI/GNUmakefile [new file with mode: 0644]
UI/PreferencesUI/PreferencesUIProduct.m [new file with mode: 0644]
UI/PreferencesUI/Toolbars/UIxPreferences.toolbar [new file with mode: 0644]
UI/PreferencesUI/UIxJSONPreferences.h [new file with mode: 0644]
UI/PreferencesUI/UIxJSONPreferences.m [new file with mode: 0644]
UI/PreferencesUI/UIxPreferences.h [new file with mode: 0644]
UI/PreferencesUI/UIxPreferences.m [new file with mode: 0644]
UI/PreferencesUI/Version [new file with mode: 0644]
UI/PreferencesUI/product.plist [new file with mode: 0644]
UI/SOGoUI/GNUmakefile
UI/SOGoUI/SOGoDateFormatter.h [deleted file]
UI/SOGoUI/SOGoDateFormatter.m [deleted file]
UI/Scheduler/GNUmakefile
UI/Scheduler/UIxAppointmentView.h [deleted file]
UI/Scheduler/UIxAppointmentView.m [deleted file]
UI/Scheduler/UIxCalDayTable.h
UI/Scheduler/UIxCalDayTable.m
UI/Scheduler/UIxCalListingActions.h
UI/Scheduler/UIxCalListingActions.m
UI/Scheduler/UIxCalMonthView.h
UI/Scheduler/UIxCalMonthView.m
UI/Scheduler/UIxComponentEditor.h
UI/Scheduler/UIxComponentEditor.m
UI/Scheduler/UIxTaskView.h [deleted file]
UI/Scheduler/UIxTaskView.m [deleted file]
UI/Scheduler/product.plist
UI/Templates/MailerUI/UIxMailListView.wox
UI/Templates/PreferencesUI/UIxPreferences.wox [new file with mode: 0644]
UI/Templates/SchedulerUI/UIxAppointmentView.wox [deleted file]
UI/Templates/SchedulerUI/UIxCalMainView.wox
UI/Templates/SchedulerUI/UIxTaskView.wox [deleted file]
UI/Templates/UIxPageFrame.wox
UI/WebServerResources/MailerUI.css
UI/WebServerResources/UIxPreferences.css [new file with mode: 0644]
UI/WebServerResources/UIxPreferences.js [new file with mode: 0644]
UI/WebServerResources/generic.css
UI/WebServerResources/generic.js

index 4ba4110213b0e06ee26c251490796a9404ca1abd..f08a575f60d9ac312fd8539c6ec6cae27e1b75f8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,41 @@
+2007-06-19  Wolfgang Sourdeau  <wsourdeau@inverse.ca>
+
+       * SoObjects/SOGo/SOGoUser.m ([SOGoUser
+       -setCurrentPassword:newPassword]): new stub method.
+       ([SOGoUser -dateFormatterInContext:context]): new method that
+       returns an instance of SOGoDateFormatter configured based on the
+       user defaults.
+
+       * UI/Common/UIxPageFrame.m ([UIxPageFrame
+       -relativePreferencesPath]): new method.
+
+       * UI/Scheduler/UIxComponentEditor.m ([-titleDateFormatter]):
+       removed useless method.
+
+       * SoObjects/SOGo/SOGoDateFormatter.m: rewrote class to accept
+       different configurable formats (long and short date + time).
+
+       * SoObjects/SOGo/SOGoDateFormatter.[hm]: moved from UI/SOGoUI/.
+
+       * SoObjects/Mailer/SOGoMailAccounts.m ([SOGoMailAccounts
+       -isInternetRequest]): removed method.
+
+       * SoObjects/SOGo/AgenorUserDefaults.m ([AgenorUserDefaults
+       -jsonRepresentation]): new method with an explicit name.
+
+       * UI/PreferencesUI/product.plist: new bundle that provides a web
+       ui for handling user defaults.
+
+       * UI/Scheduler/UIxTaskView.[hm]: removed unused module.
+
+       * UI/Scheduler/UIxAppointmentView.[hm]: removed unused module.
+
+       * SoObjects/SOGo/WOContext+Agenor.[hm]: removed unused module.
+
+2007-06-14  Wolfgang Sourdeau  <wsourdeau@inverse.ca>
+
+       * SoObjects/SOGo/SOGoLRUCache.m: removed unused module.
+
 2007-06-13  Wolfgang Sourdeau  <wsourdeau@inverse.ca>
 
        * UI/Scheduler/NSArray+Scheduler.m ([NSArray
index fb871988cc9b2f70c164471114f56a97e34731c2..92e99648fe2796f9dd3ffe95db6f61493f45f77c 100644 (file)
   02111-1307, USA.
 */
 
-#include "SOGoDraftObject.h"
-#include <SoObjects/SOGo/WOContext+Agenor.h>
-#include <SoObjects/SOGo/NSCalendarDate+SOGo.h>
-#include <NGMail/NGMimeMessage.h>
-#include <NGMail/NGMimeMessageGenerator.h>
-#include <NGMail/NGSendMail.h>
-#include <NGMime/NGMimeBodyPart.h>
-#include <NGMime/NGMimeFileData.h>
-#include <NGMime/NGMimeMultipartBody.h>
-#include <NGMime/NGMimeType.h>
-#include <NGMime/NGMimeHeaderFieldGenerator.h>
-#include <NGImap4/NGImap4Envelope.h>
-#include <NGImap4/NGImap4EnvelopeAddress.h>
-#include <NGExtensions/NSFileManager+Extensions.h>
-#include "common.h"
+#import <Foundation/NSArray.h>
+#import <Foundation/NSAutoreleasePool.h>
+#import <Foundation/NSDictionary.h>
+#import <Foundation/NSKeyValueCoding.h>
+#import <Foundation/NSUserDefaults.h>
+#import <Foundation/NSValue.h>
+
+#import <NGObjWeb/NSException+HTTP.h>
+#import <NGObjWeb/SoObject+SoDAV.h>
+#import <NGObjWeb/WOContext.h>
+#import <NGObjWeb/WORequest+So.h>
+#import <NGObjWeb/WOResponse.h>
+#import <NGExtensions/NGBase64Coding.h>
+#import <NGExtensions/NSFileManager+Extensions.h>
+#import <NGExtensions/NGHashMap.h>
+#import <NGExtensions/NSNull+misc.h>
+#import <NGExtensions/NSObject+Logs.h>
+#import <NGExtensions/NGQuotedPrintableCoding.h>
+#import <NGImap4/NGImap4Envelope.h>
+#import <NGImap4/NGImap4EnvelopeAddress.h>
+#import <NGMail/NGMimeMessage.h>
+#import <NGMail/NGMimeMessageGenerator.h>
+#import <NGMail/NGSendMail.h>
+#import <NGMime/NGMimeBodyPart.h>
+#import <NGMime/NGMimeFileData.h>
+#import <NGMime/NGMimeMultipartBody.h>
+#import <NGMime/NGMimeType.h>
+#import <NGMime/NGMimeHeaderFieldGenerator.h>
+
+#import <SoObjects/SOGo/NSCalendarDate+SOGo.h>
+
+#import "SOGoDraftObject.h"
 
 static NSString *contentTypeValue = @"text/plain; charset=utf-8";
 
@@ -70,7 +87,6 @@ static NSString    *userAgent      = @"SOGoMail 1.0";
 static BOOL        draftDeleteDisabled = NO; // for debugging
 static BOOL        debugOn = NO;
 static BOOL        showTextAttachmentsInline  = NO;
-static NSString    *fromInternetSuffixPattern = nil;
 
 + (int)version {
   return [super version] + 0 /* v1 */;
@@ -89,14 +105,6 @@ static NSString    *fromInternetSuffixPattern = nil;
   if ((draftDeleteDisabled = [ud boolForKey:@"SOGoNoDraftDeleteAfterSend"]))
     NSLog(@"WARNING: draft delete is disabled! (SOGoNoDraftDeleteAfterSend)");
   
-  fromInternetSuffixPattern = [ud stringForKey:@"SOGoInternetMailSuffix"];
-  if ([fromInternetSuffixPattern length] == 0)
-    NSLog(@"Note: no 'SOGoInternetMailSuffix' is configured.");
-  else {
-    fromInternetSuffixPattern =
-      [@"\n" stringByAppendingString:fromInternetSuffixPattern];
-  }
-  
   TextPlainType  = [[NGMimeType mimeType:@"text"      subType:@"plain"]  copy];
   MultiMixedType = [[NGMimeType mimeType:@"multipart" subType:@"mixed"]  copy];
 }
@@ -341,49 +349,31 @@ static NSString    *fromInternetSuffixPattern = nil;
 {
   NSDictionary  *lInfo;
   NGMimeMessage *message;  
-  NSString *fromInternetSuffix;
   BOOL     addSuffix;
   id       body;
 
   if ((lInfo = [self fetchInfo]) == nil)
     return nil;
   
-  addSuffix = [context isAccessFromIntranet] ? NO : YES;
-  if (addSuffix) {
-    fromInternetSuffix = 
-      [fromInternetSuffixPattern stringByReplacingVariablesWithBindings:
-                                  [context request]
-                                stringForUnknownBindings:@""];
-    
-    addSuffix = [fromInternetSuffix length] > 0 ? YES : NO;
-  }
-  
-  [map setObject:@"text/plain" forKey:@"content-type"];
+  [map setObject: @"text/plain" forKey: @"content-type"];
   if ((body = [lInfo objectForKey:@"text"]) != nil) {
-    if ([body isKindOfClass:[NSString class]]) {
-      if (addSuffix)
-       body = [body stringByAppendingString:fromInternetSuffix];
-      
+    if ([body isKindOfClass:[NSString class]])
       /* Note: just 'utf8' is displayed wrong in Mail.app */
       [map setObject: contentTypeValue
           forKey: @"content-type"];
 //       body = [body dataUsingEncoding:NSUTF8StringEncoding];
-    }
     else if ([body isKindOfClass:[NSData class]] && addSuffix) {
       body = [[body mutableCopy] autorelease];
-      [(NSMutableData *)body
-                        appendData: [fromInternetSuffix dataUsingEncoding:NSUTF8StringEncoding]];
     }
     else if (addSuffix) {
       [self warnWithFormat:@"Note: cannot add Internet marker to body: %@",
              NSStringFromClass([body class])];
     }
   }
-  else if (addSuffix)
-    body = fromInternetSuffix;
   
   message = [[[NGMimeMessage alloc] initWithHeader:map] autorelease];
   [message setBody:body];
+
   return message;
 }
 
@@ -934,7 +924,8 @@ static NSString    *fromInternetSuffixPattern = nil;
   return [NSNumber numberWithBool:YES]; /* delete worked out ... */
 }
 
-- (id)GETAction:(id)_ctx {
+- (id) GETAction: (id) _ctx
+{
   /* 
      Override, because SOGoObject's GETAction uses the less efficient
      -contentAsString method.
index 8e7c8a582e516516fd5c185222d0cedf13976d7a..bb3ac3ba4687fc2a987b89eef1cc4f9e0fc738c2 100644 (file)
 #include "SOGoUser+Mail.h"
 #include "common.h"
 #include <NGObjWeb/SoObject+SoDAV.h>
-#include <SOGo/WOContext+Agenor.h>
 
 @implementation SOGoMailAccounts
 
 static NSString *AgenorShareLoginMarker  = @".-.";
 
-/* detect webmail being accessed from the outside */
-
-- (BOOL)isInternetRequest {
-  return ([context isAccessFromIntranet] ? NO : YES);
-}
-
 /* listing the available mailboxes */
 
 - (BOOL) isInHomeFolderBranchOfLoggedInAccount: (NSString *) userLogin
@@ -71,9 +64,6 @@ static NSString *AgenorShareLoginMarker  = @".-.";
   account = [user primaryIMAP4AccountString];
   if ([account isNotNull]) account = [NSArray arrayWithObject:account];
   
-  if ([self isInternetRequest]) /* only show primary mailbox in Internet */
-    return account;
-  
   shares  = [user valueForKey:@"additionalIMAP4AccountStrings"];
   return ([shares count] == 0)
     ? account
@@ -156,19 +146,10 @@ static NSString *AgenorShareLoginMarker  = @".-.";
   }
   
   if ([self isValidMailAccountName:_key]) {
-    /* forbid shares for requests coming from the Internet */
     BOOL isSharedKey;
     
     isSharedKey = [_key rangeOfString:AgenorShareLoginMarker].length > 0;
     
-    if ([self isInternetRequest]) {
-      if (isSharedKey) {
-       return [NSException exceptionWithHTTPStatus:403 /* Forbidden */
-                           reason:
-                             @"Access to shares forbidden from the Internet"];
-      }
-    }
-    
     return isSharedKey
       ? [self sharedMailAccountWithName:_key inContext:_ctx]
       : [self mailAccountWithName:_key inContext:_ctx];
index a11785e5914ee024b25f1bf78a15f432735a03ac..c694a6dc59674ab06fefa61c6c5fb3abd61deac5 100644 (file)
@@ -19,6 +19,8 @@
   02111-1307, USA.
 */
 
+#warning importing common is baaad
+
 #import <Foundation/Foundation.h>
 #import <Foundation/NSObjCRuntime.h>
 
index 7bdbca786d2c7d1785d8f4321d9ec12064d77789..e2f1085aebff168b6325147ab4efd52f11be86e6 100644 (file)
@@ -78,6 +78,8 @@
 - (void) setFloat: (float) value forKey: (NSString *) key;
 - (void) setInteger: (int) value forKey: (NSString *) key;
 
+- (NSString *) jsonRepresentation;
+
 /* saving changes */
 
 - (BOOL) synchronize;
index d904acbc0d69af6b090cf35ad66b5f475acdd288..c1104ceb0dd8db1f7ade9d476027ae2f9a7a19f4 100644 (file)
   02111-1307, USA.
 */
 
+#import <Foundation/NSPropertyList.h>
+#import <Foundation/NSUserDefaults.h>
 #import <Foundation/NSValue.h>
+
+#import <NGExtensions/NSNull+misc.h>
+#import <NGExtensions/NSObject+Logs.h>
+
 #import <GDLContentStore/GCSChannelManager.h>
 #import <GDLContentStore/NSURL+GCS.h>
 #import <GDLAccess/EOAdaptorChannel.h>
 #import <GDLAccess/EOAdaptorContext.h>
 #import <GDLAccess/EOAttribute.h>
 
-#import "common.h"
+#import "NSObject+Utilities.h"
+
 #import "AgenorUserDefaults.h"
 
 @implementation AgenorUserDefaults
@@ -320,6 +327,13 @@ static NSString *uidColumnName = @"uid";
   return (values || [self primaryFetchProfile]);
 }
 
+- (NSString *) jsonRepresentation
+{
+  [self fetchProfile];
+
+  return [values jsonRepresentation];
+}
+
 /* value access */
 
 - (void) setObject: (id) value
index 03916b358e24f4a7b1233a6e46eddef8e016a1ae..39f6dca18d97ba876cb602b511c3055960b84de4 100644 (file)
@@ -30,9 +30,8 @@ libSOGo_HEADER_FILES = \
        \
        LDAPUserManager.h               \
        LDAPSource.h                    \
+       SOGoDateFormatter.h             \
        SOGoPermissions.h               \
-       SOGoLRUCache.h                  \
-       WOContext+Agenor.h              \
        SOGoDAVRendererTypes.h          \
        NSArray+Utilities.h             \
        NSDictionary+URL.h              \
@@ -56,11 +55,10 @@ libSOGo_OBJC_FILES = \
        SOGoGroupFolder.m               \
        SOGoCustomGroupFolder.m         \
        \
+       SOGoDateFormatter.m             \
        SOGoPermissions.m               \
-       SOGoLRUCache.m                  \
        LDAPUserManager.m               \
        LDAPSource.m                    \
-       WOContext+Agenor.m              \
        SOGoDAVRendererTypes.m          \
        AgenorUserDefaults.m            \
        NSArray+Utilities.m             \
index a56ac4267f011ed5333a52fac71f2df3ac797c42..3ada07357a2cb2d26320dec740a598579fcc6e64 100644 (file)
 
 @interface SOGoAuthenticator : SoHTTPAuthenticator
 {
-  NSUserDefaults *ud;
   NSString *authMethod;
-  NSString *LDAPBaseDN;
-  NSString *LDAPHost;
-  int LDAPPort;
 }
 
 + (id) sharedSOGoAuthenticator;
 
-- (BOOL) LDAPCheckLogin: (NSString *) _login password: (NSString *) _pwd;
-
 - (SOGoUser *) userInContext: (WOContext *) _ctx;
 
 @end
index 134dba0235f104ae0eef91ddfd45e4583481b28e..0c8d5c0a8b950bbe169a13d09714e71d50e3e10a 100644 (file)
   02111-1307, USA.
 */
 
+#import <Foundation/NSArray.h>
+#import <Foundation/NSString.h>
+#import <Foundation/NSUserDefaults.h>
+
+#import <NGObjWeb/WOContext.h>
+#import <NGObjWeb/WOResponse.h>
 #import <NGLdap/NGLdapConnection.h>
-#import "SOGoPermissions.h"
 
 #import "LDAPUserManager.h"
+#import "SOGoPermissions.h"
+#import "SOGoUser.h"
 
 #import "SOGoAuthenticator.h"
-#import "SOGoUser.h"
-#import "common.h"
 
 @implementation SOGoAuthenticator
 
-static SOGoAuthenticator *auth = nil;
-
 + (id) sharedSOGoAuthenticator
 {
-  if (auth == nil)
-    auth = [[self alloc] init];
+  static SOGoAuthenticator *auth = nil;
+  if (!auth)
+    auth = [self new];
+  
   return auth;
 }
 
 - (id) init
 {
+  NSUserDefaults *ud;
+
   if ((self = [super init]))
     {
       ud = [NSUserDefaults standardUserDefaults];
 
-      LDAPBaseDN = nil;
-      LDAPHost = nil;
-      LDAPPort = -1;
-
       authMethod = [[ud stringForKey:@"AuthentificationMethod"] retain];
-      if ([authMethod isEqualToString: @"LDAP"])
-       {
-//       LDAPBaseDN = [[ud stringForKey:@"LDAPRootDN"] retain];
-//       LDAPHost = [[ud stringForKey:@"LDAPHost"] retain];
-//       LDAPPort = [ud integerForKey:@"LDAPPort"];
-       }
     }
 
   return self;
@@ -63,10 +61,6 @@ static SOGoAuthenticator *auth = nil;
 
 - (void) dealloc
 {
-  if (LDAPBaseDN)
-    [LDAPBaseDN release];
-  if (LDAPHost)
-    [LDAPHost release];
   [authMethod release];
   [super dealloc];
 }
@@ -75,25 +69,36 @@ static SOGoAuthenticator *auth = nil;
           password: (NSString *) _pwd
 {
   BOOL accept;
+  LDAPUserManager *um;
 
   if ([authMethod isEqualToString: @"LDAP"])
-    accept = [self LDAPCheckLogin: _login password: _pwd];
+    {
+      um = [LDAPUserManager sharedUserManager];
+      accept = [um checkLogin: _login andPassword: _pwd];
+    }
   else
     accept = ([_login length] > 0);
 
-  return (([_login isEqualToString: @"freebusy"]
-           && [_pwd isEqualToString: @"freebusy"])
-          || accept);
+  return (accept
+         || ([_login isEqualToString: @"freebusy"]
+             && [_pwd isEqualToString: @"freebusy"]));
 }
 
-- (BOOL) LDAPCheckLogin: (NSString *) _login
-              password: (NSString *) _pwd
+- (NSString *) _passwordInContext: (WOContext *) context
 {
-  LDAPUserManager *um;
-
-  um = [LDAPUserManager sharedUserManager];
+  NSString  *auth, *password;
+  NSArray   *creds;
 
-  return [um checkLogin: _login andPassword: _pwd];
+  password = nil;
+  auth = [[context request] headerForKey:@"authorization"];
+  if (auth)
+    {
+      creds = [self parseCredentials: auth];
+      if ([creds count] > 1)
+       password = [creds objectAtIndex: 1];
+    }
+  
+  return password;
 }
 
 /* create SOGoUser */
@@ -126,8 +131,11 @@ static SOGoAuthenticator *auth = nil;
             user = anonymous;
         }
       else
-        user = [SOGoUser userWithLogin: login
-                        roles: [self rolesForLogin: login]];
+       {
+         user = [SOGoUser userWithLogin: login
+                          roles: [self rolesForLogin: login]];
+         [user setCurrentPassword: [self _passwordInContext: _ctx]];
+       }
     }
   else
     user = nil;
index 344e9c2860e0e909209632c323fd031c8d3ad533..945382da5b1d2d27cb399318e43d7e4e307fbdc4 100644 (file)
   02111-1307, USA.
 */
 
+#import <Foundation/NSArray.h>
+#import <Foundation/NSString.h>
+#import <Foundation/NSValue.h>
+
+#import <NGObjWeb/NSException+HTTP.h>
+#import <NGObjWeb/WOContext.h>
+#import <NGObjWeb/WOResponse.h>
+#import <NGExtensions/NSObject+Logs.h>
 #import <GDLContentStore/GCSFolder.h>
 
-#import "common.h"
 #import "SOGoFolder.h"
 #import "SOGoUser.h"
 #import "SOGoPermissions.h"
index 3e39df8d69316e8c5a4eb0dd1351eb58d333f249..3ad33b950ee04db2cfcd911dd408bda198ae15e0 100644 (file)
   Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
   02111-1307, USA.
 */
-// $Id: SOGoCustomGroupFolder.m 115 2004-06-30 11:57:37Z helge $
 
-#include "SOGoCustomGroupFolder.h"
-#include "common.h"
+#import <Foundation/NSArray.h>
+#import <Foundation/NSString.h>
+
+#import <NGExtensions/NSObject+Logs.h>
+
+#import "SOGoCustomGroupFolder.h"
 
 @implementation SOGoCustomGroupFolder
 
diff --git a/SoObjects/SOGo/SOGoDateFormatter.h b/SoObjects/SOGo/SOGoDateFormatter.h
new file mode 100644 (file)
index 0000000..3889bff
--- /dev/null
@@ -0,0 +1,68 @@
+/*
+  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.
+*/
+
+#ifndef        __SOGoDateFormatter_H_
+#define        __SOGoDateFormatter_H_
+
+#import <Foundation/NSFormatter.h>
+
+@class NSCalendarDate;
+@class NSDictionary;
+@class NSString;
+
+@interface SOGoDateFormatter : NSFormatter
+{
+  NSDictionary *locale;
+  NSString *shortDateFormat;
+  NSString *longDateFormat;
+  NSString *timeFormat;
+}
+
+- (void) setLocale: (NSDictionary *) newLocale;
+- (void) setShortDateFormat: (NSString *) newDateFormat;
+- (void) setLongDateFormat: (NSString *) newDateFormat;
+- (void) setTimeFormat: (NSString *) newDateFormat;
+
+- (NSString *) shortFormattedDate: (NSCalendarDate *) date;
+- (NSString *) formattedDate: (NSCalendarDate *) date;
+- (NSString *) formattedTime: (NSCalendarDate *) date;
+- (NSString *) formattedDateAndTime: (NSCalendarDate *) date;
+
+- (NSString *) stringForObjectValue: (id) date;
+
+// - (void) setFullWeekdayNameAndDetails;
+
+// - (NSString *) date: (NSCalendarDate *) date
+//      withFormat: (unsigned int) format;
+// - (NSString *) date: (NSCalendarDate *) date
+//        withNSFormat: (NSNumber *) format;
+
+
+// - (NSString *) shortDayOfWeek: (int)_day;
+// - (NSString *) fullDayOfWeek: (int)_day;
+// - (NSString *) shortMonthOfYear: (int)_month;
+// - (NSString *) fullMonthOfYear: (int)_month;
+
+// - (NSString *) fullWeekdayNameAndDetailsForDate: (NSCalendarDate *)_date;
+
+@end
+
+#endif /* __SOGoDateFormatter_H_ */
diff --git a/SoObjects/SOGo/SOGoDateFormatter.m b/SoObjects/SOGo/SOGoDateFormatter.m
new file mode 100644 (file)
index 0000000..9bddd76
--- /dev/null
@@ -0,0 +1,251 @@
+/*
+  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.
+*/
+
+#import <Foundation/NSCalendarDate.h>
+#import <Foundation/NSUserDefaults.h>
+
+#import "SOGoDateFormatter.h"
+
+@implementation SOGoDateFormatter
+
+- (id) init
+{
+  if ((self = [super init]))
+    {
+      locale = nil;
+//       locale = [_locale retain];
+      
+//       if ([[locale objectForKey:@"NSLocaleCode"] isEqualToString: @"fr"])
+//     shortDateFormat = SOGoDateDMYFormat;
+//       else
+//     shortDateFormat = SOGoDateISOFormat;
+      shortDateFormat = nil;
+      longDateFormat = nil;
+      timeFormat = nil;
+    }
+
+  return self;
+}
+
+- (void) dealloc
+{
+  [longDateFormat release];
+  [shortDateFormat release];
+  [timeFormat release];
+  [locale release];
+  [super dealloc];
+}
+
+/* accessors */
+
+- (void) setLocale: (NSDictionary *) newLocale
+{
+  ASSIGN (locale, newLocale);
+  ASSIGN (shortDateFormat, [locale objectForKey: NSShortDateFormatString]);
+  ASSIGN (longDateFormat, [locale objectForKey: NSDateFormatString]);
+  ASSIGN (timeFormat, [locale objectForKey: NSTimeFormatString]);
+}
+
+- (void) setShortDateFormat: (NSString *) newFormat
+{
+  ASSIGN (shortDateFormat, newFormat);
+}
+
+- (void) setLongDateFormat: (NSString *) newFormat
+{
+  ASSIGN (longDateFormat, newFormat);
+}
+
+- (void) setTimeFormat: (NSString *) newFormat
+{
+  ASSIGN (timeFormat, newFormat);
+}
+
+// - (void) setFullWeekdayNameAndDetails
+// {
+//   auxFormatAction = formatAction;
+//   formatAction = @selector(fullWeekdayNameAndDetailsForDate:);
+// }
+
+/* operation */
+
+- (NSString *) _date: (NSCalendarDate *) date
+         withFormat: (NSString *) format
+{
+  NSString *formattedDate;
+
+  if (format && locale)
+    formattedDate
+      = [date descriptionWithCalendarFormat: format locale: locale];
+  else
+    formattedDate = nil;
+
+  return formattedDate;
+}
+
+- (NSString *) shortFormattedDate: (NSCalendarDate *) date
+{
+  return [self _date: date withFormat: shortDateFormat];
+}
+
+- (NSString *) formattedDate: (NSCalendarDate *) date
+{
+  return [self _date: date withFormat: longDateFormat];
+}
+
+- (NSString *) formattedTime: (NSCalendarDate *) date
+{
+  return [self _date: date withFormat: timeFormat];
+}
+
+- (NSString *) formattedDateAndTime: (NSCalendarDate *) date
+{
+  NSString *format;
+
+  format = [NSString stringWithFormat: @"%@ %@ %%Z",
+                    longDateFormat, timeFormat];
+
+  return [self _date: date withFormat: format];
+}
+
+- (NSString *) stringForObjectValue: (id) object
+{
+  NSString *formattedString;
+
+  if ([object isKindOfClass: [NSCalendarDate class]])
+    formattedString = [self formattedDateAndTime: object];
+  else
+    formattedString = nil;
+
+  return formattedString;
+}
+
+// /* Helpers */
+
+// - (NSString *)shortDayOfWeek:(int)_day {
+//   return [[locale objectForKey:@"NSShortWeekDayNameArray"]
+//        objectAtIndex:_day];
+// }
+
+// - (NSString *)fullDayOfWeek:(int)_day {
+//   return [[locale objectForKey:@"NSWeekDayNameArray"]
+//        objectAtIndex:_day];
+// }
+
+// - (NSString *)shortMonthOfYear:(int)_month {
+//   return [[locale objectForKey:@"NSShortMonthNameArray"]
+//        objectAtIndex:_month - 1];
+// }
+
+// - (NSString *)fullMonthOfYear:(int)_month {
+//   return [[locale objectForKey:@"NSMonthNameArray"]
+//        objectAtIndex:_month - 1];
+// }
+
+
+/* Private API */
+
+// - (NSString *) fullWeekdayNameAndDetailsForDate: (NSCalendarDate *) _date
+// {
+//   NSMutableString *desc;
+
+//   if (_date)
+//     {  
+//       desc = [NSMutableString stringWithCapacity:24];
+//       [desc appendString:[self fullDayOfWeek:[_date dayOfWeek]]];
+//       [desc appendString:@", "];
+//       [desc appendString:[self performSelector:auxFormatAction
+//                            withObject:_date]];
+//       [desc appendString:@" "];
+//       [desc appendFormat:@"%02d:%02d ", [_date hourOfDay], [_date minuteOfHour]];
+//       [desc appendString:[[_date timeZone] abbreviation]];
+//     }
+//   else
+//     desc = nil;
+
+//   return desc;
+// }
+
+// - (NSString *) _separatorForFormat: (unsigned int) format
+// {
+//   NSString *separator;
+
+//   switch (format & (3))
+//     {
+//     case SOGoDateDotFormat:
+//       separator = @".";
+//       break;
+//     case SOGoDateDashFormat:
+//       separator = @".";
+//       break;
+//     default:
+//       separator = @"/";
+//     }
+
+//   return separator;
+// }
+
+// - (NSString *) _dateFormatForDate: (NSCalendarDate *) date
+//                    withFormat: (unsigned int) format
+//                  andSeparator: (NSString *) separator
+// {
+//   NSString *day, *month, *year;
+//   NSString *formattedDate;
+
+//   day = [NSString stringWithFormat: @"%.2d", [date dayOfMonth]];
+//   month = [NSString stringWithFormat: @"%.2d", [date monthOfYear]];
+//   if (format & SOGoDateTwoDigitsYearFormat)
+//     year = [NSString stringWithFormat: @"%.2d", [date yearOfCommonEra] % 100];
+//   else
+//     year = [NSString stringWithFormat: @"%.4d", [date yearOfCommonEra]];
+
+//   if (format & SOGoDateDMYFormat)
+//     formattedDate = [NSString stringWithFormat: @"%@%@%@%@%@",
+//                           day, separator, month, separator, year];
+//   else if (format & SOGoDateMDYFormat)
+//     formattedDate = [NSString stringWithFormat: @"%@%@%@%@%@",
+//                           month, separator, day, separator, year];
+//   else
+//     formattedDate = [NSString stringWithFormat: @"%@%@%@%@%@",
+//                           year, separator, month, separator, day];
+
+//   return formattedDate;
+// }
+
+// - (NSString *) date: (NSCalendarDate *) date
+//      withFormat: (unsigned int) format
+// {
+//   NSString *separator;
+
+//   separator = [self _separatorForFormat: format];
+  
+//   return [self _dateFormatForDate: date
+//            withFormat: format
+//            andSeparator: separator];
+// }
+
+// - (NSString *) date: (NSCalendarDate *) date
+//        withNSFormat: (NSNumber *) format
+// {
+//   return [self date: date withFormat: [format unsignedIntValue]];
+// }
+
+@end /* SOGoDateFormatter */
index db2a8946c45ad352603f953b16c74ff9d0e89c62..7d914d396780f425236abec414f435bfeb7318db 100644 (file)
   02111-1307, USA.
 */
 
+#import <unistd.h>
+#import <stdlib.h>
+
+#import <Foundation/NSArray.h>
+#import <Foundation/NSDictionary.h>
+#import <Foundation/NSException.h>
+#import <Foundation/NSURL.h>
+
 #import <NGObjWeb/SoObject.h>
+#import <NGExtensions/NSNull+misc.h>
+#import <NGExtensions/NSObject+Logs.h>
+#import <EOControl/EOQualifier.h>
 #import <GDLAccess/EOAdaptorChannel.h>
 #import <GDLContentStore/GCSFolderManager.h>
 #import <GDLContentStore/GCSFolder.h>
 #import <SaxObjC/XMLNamespaces.h>
 
 #import "SOGoPermissions.h"
+
 #import "SOGoFolder.h"
-#import "common.h"
-#import <unistd.h>
-#import <stdlib.h>
 
 static NSString *defaultUserID = @"<default>";
 
index 054e4681d420f58acee511a1de12a6f414c463fe..cda067f1d6a985fc14eb74f5c22b0246c7388451 100644 (file)
   Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
   02111-1307, USA.
 */
-// $Id: SOGoGroupFolder.m 115 2004-06-30 11:57:37Z helge $
 
-#include "SOGoGroupFolder.h"
-#include "common.h"
+#import <Foundation/NSArray.h>
+#import <Foundation/NSString.h>
+
+#import <NGObjWeb/WOContext.h>
+#import <NGObjWeb/WOContext+SoObjects.h>
+
+#import <NGObjWeb/NSException+HTTP.h>
+#import <NGExtensions/NGLogger.h>
+#import <NGExtensions/NGLoggerManager.h>
+#import <NGExtensions/NSObject+Logs.h>
+#import <NGExtensions/NSNull+misc.h>
+
+#import "SOGoGroupFolder.h"
 
 @implementation SOGoGroupFolder
 
 static NGLogger *logger = nil;
 
-+ (void)initialize {
++ (void) initialize
+{
   NGLoggerManager *lm;
-  static BOOL     didInit = NO;
-  
-  if (didInit) return;
-  didInit = YES;
-  
-  lm     = [NGLoggerManager defaultLoggerManager];
-  logger = [lm loggerForDefaultKey:@"SOGoGroupFolderDebugEnabled"];
+
+  if (!logger)
+    {
+      lm = [NGLoggerManager defaultLoggerManager];
+      logger = [lm loggerForDefaultKey:@"SOGoGroupFolderDebugEnabled"];
+    }
 }
 
-- (void)dealloc {
-  [self->uidToFolder release];
-  [self->folders     release];
+- (void) dealloc
+{
+  [uidToFolder release];
+  [folders     release];
   [super dealloc];
 }
 
@@ -97,7 +108,7 @@ static NGLogger *logger = nil;
   NSArray  *luids;
   unsigned i, count;
   
-  if (self->uidToFolder != nil)
+  if (uidToFolder != nil)
     return;
   if ((luids = [self uids]) == nil)
     return;
@@ -122,13 +133,13 @@ static NGLogger *logger = nil;
   }
   
   /* fix results */
-  self->uidToFolder = [md copy];
-  self->folders     = [[NSArray alloc] initWithArray:ma];
+  uidToFolder = [md copy];
+  folders     = [[NSArray alloc] initWithArray:ma];
 }
 
 - (NSArray *)memberFolders {
   [self _setupFolders];
-  return self->folders;
+  return folders;
 }
 
 - (id)folderForUID:(NSString *)_uid {
@@ -137,27 +148,34 @@ static NGLogger *logger = nil;
   if ([_uid length] == 0)
     return nil;
   
-  return [self->uidToFolder objectForKey:_uid];
+  return [uidToFolder objectForKey:_uid];
 }
 
-- (void)resetFolderCaches {
-  [self->uidToFolder release]; self->uidToFolder = nil;
-  [self->folders     release]; self->folders     = nil;
+- (void) resetFolderCaches
+{
+  [uidToFolder release];
+  uidToFolder = nil;
+  [folders release];
+  folders     = nil;
 }
-- (void)sleep {
+
+- (void) sleep
+{
   [self resetFolderCaches];
   [super sleep];
 }
 
 /* SOPE */
 
-- (BOOL)isFolderish {
+- (BOOL) isFolderish
+{
   return YES;
 }
 
 /* looking up shared objects */
 
-- (SOGoGroupsFolder *)lookupGroupsFolder {
+- (SOGoGroupsFolder *) lookupGroupsFolder
+{
   return [[self container] lookupGroupsFolder];
 }
 
@@ -165,7 +183,9 @@ static NGLogger *logger = nil;
 
 /* name lookup */
 
-- (id)groupCalendar:(NSString *)_key inContext:(id)_ctx {
+- (id) groupCalendar: (NSString *) _key
+          inContext: (id) _ctx
+{
   static Class calClass = Nil;
   id calendar;
   
@@ -184,7 +204,10 @@ static NGLogger *logger = nil;
   return [calendar autorelease];
 }
 
-- (id)lookupName:(NSString *)_key inContext:(id)_ctx acquire:(BOOL)_flag {
+- (id) lookupName: (NSString *) _key
+       inContext: (id) _ctx
+         acquire: (BOOL) _flag
+{
   id obj;
   
   /* first check attributes directly bound to the application */
index ee71c7f70d3a1821233f1e9515b197bfacf5f300..b29aeb6676a80f832cf4cb1850481e45a9b311e1 100644 (file)
   Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
   02111-1307, USA.
 */
-// $Id: SOGoGroupsFolder.m 115 2004-06-30 11:57:37Z helge $
 
-#include "SOGoGroupsFolder.h"
-#include "common.h"
+#import <NGObjWeb/NSException+HTTP.h>
+#import <NGExtensions/NSObject+Logs.h>
+
+#import "SOGoGroupsFolder.h"
 
 @implementation SOGoGroupsFolder
 
-- (void)dealloc {
-  [super dealloc];
-}
+// - (void)dealloc {
+//   [super dealloc];
+// }
 
 /* accessors */
 
 /* SOPE */
 
-- (BOOL)isFolderish {
+- (BOOL) isFolderish
+{
   return YES;
 }
 
 /* looking up shared objects */
 
-- (SOGoGroupsFolder *)lookupGroupsFolder {
+- (SOGoGroupsFolder *) lookupGroupsFolder
+{
   return self;
 }
 
 
 /* name lookup */
 
-- (id)customGroup:(NSString *)_key inContext:(id)_ctx {
+- (id) customGroup: (NSString *) _key
+        inContext: (id) _ctx
+{
   static Class groupClass = Nil;
   id group;
-  
-  if (groupClass == Nil)
+
+  if (!groupClass)
     groupClass = NSClassFromString(@"SOGoCustomGroupFolder");
-  if (groupClass == Nil) {
-    [self logWithFormat:@"ERROR: missing SOGoCustomGroupFolder class!"];
-    return nil;
-  }
-  
-  group = [[groupClass alloc] initWithName:_key inContainer:self];
-  return [group autorelease];
+  if (!groupClass)
+    {
+      [self logWithFormat:@"ERROR: missing SOGoCustomGroupFolder class!"];
+      group = nil;
+    }
+  else
+    group = [groupClass objectWithName: _key inContainer: self];
+
+  return group;
 }
 
-- (id)lookupName:(NSString *)_key inContext:(id)_ctx acquire:(BOOL)_flag {
+- (id) lookupName: (NSString *) _key
+       inContext: (id) _ctx
+         acquire: (BOOL) _flag
+{
   id obj;
   
   /* first check attributes directly bound to the application */
-  if ((obj = [super lookupName:_key inContext:_ctx acquire:NO]))
-    return obj;
-  
-  if ([_key hasPrefix:@"_custom_"])
-    return [self customGroup:_key inContext:_ctx];
-  
-  /* return 404 to stop acquisition */
-  return [NSException exceptionWithHTTPStatus:404 /* Not Found */];
+  obj = [super lookupName: _key inContext: _ctx acquire: NO];
+  if (!obj)
+    {
+      if ([_key hasPrefix: @"_custom_"])
+       obj = [self customGroup: _key inContext: _ctx];
+      else
+       obj = [NSException exceptionWithHTTPStatus:404 /* Not Found */];
+    }
+
+  return obj;
 }
 
 @end /* SOGoGroupsFolder */
diff --git a/SoObjects/SOGo/SOGoLRUCache.h b/SoObjects/SOGo/SOGoLRUCache.h
deleted file mode 100644 (file)
index a7cee3c..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- Copyright (C) 2000-2004 SKYRIX Software AG
- This file is part of OGo
- OGo is free software; you can redistribute it and/or modify it under
- the terms of the GNU Lesser General Public License as published by the
- Free Software Foundation; either version 2, or (at your option) any
- later version.
- OGo is distributed in the hope that it will be useful, but WITHOUT ANY
- WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
- License for more details.
- You should have received a copy of the GNU Lesser General Public
- License along with OGo; see the file COPYING.  If not, write to the
- Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
- 02111-1307, USA.
- */
-
-#ifndef        __SOGoLRUCache_H_
-#define        __SOGoLRUCache_H_
-
-#import <Foundation/Foundation.h>
-
-@interface SOGoLRUCache : NSObject
-{
-  unsigned size;
-  NSMutableDictionary *entries;
-}
-
-- (id)initWithCacheSize:(unsigned)_size;
-
-- (void)addObject:(id)_obj forKey:(id)_key;
-- (id)objectForKey:(id)_key;
-
-@end
-
-#endif /* __SOGoLRUCache_H_ */
diff --git a/SoObjects/SOGo/SOGoLRUCache.m b/SoObjects/SOGo/SOGoLRUCache.m
deleted file mode 100644 (file)
index 9fdacf5..0000000
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- Copyright (C) 2000-2004 SKYRIX Software AG
- This file is part of OGo
- OGo is free software; you can redistribute it and/or modify it under
- the terms of the GNU Lesser General Public License as published by the
- Free Software Foundation; either version 2, or (at your option) any
- later version.
- OGo is distributed in the hope that it will be useful, but WITHOUT ANY
- WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
- License for more details.
- You should have received a copy of the GNU Lesser General Public
- License along with OGo; see the file COPYING.  If not, write to the
- Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
- 02111-1307, USA.
- */
-
-#include "SOGoLRUCache.h"
-#include "common.h"
-
-@interface SOGoLRUCacheItem : NSObject
-{
-  id object;
-  unsigned useCount;
-}
-
-- (id)initWithObject:(id)_obj;
-- (id)object;
-
-- (unsigned)useCount;
-
-@end
-
-@implementation SOGoLRUCacheItem
-
-- (id)initWithObject:(id)_obj {
-  self = [super init];
-  if(self) {
-    ASSIGN(self->object, _obj);
-    self->useCount = 1;
-  }
-  return self;
-}
-
-- (id)object {
-  self->useCount++;
-  return self->object;
-}
-
-- (unsigned)useCount {
-  return self->useCount;
-}
-
-@end
-
-@implementation SOGoLRUCache
-
-- (id)initWithCacheSize:(unsigned)_size {
-  self = [super init];
-  if(self) {
-    self->size = _size;
-    self->entries = [[NSMutableDictionary alloc] initWithCapacity:_size];
-  }
-  return self;
-}
-
-- (void)dealloc {
-  [self->entries release];
-  [super dealloc];
-}
-
-- (void)addObject:(id)_obj forKey:(id)_key {
-  SOGoLRUCacheItem *item;
-  
-  NSAssert(_obj, @"Attempt to insert nil object!");
-  
-  if([self->entries count] >= self->size) {
-    /* need to find minimum and get rid of it */
-    NSEnumerator     *keyEnum;
-    SOGoLRUCacheItem *item;
-    id               key, leastUsedItemKey;
-    unsigned         minimumUseCount = INT_MAX;
-    
-    keyEnum = [self->entries keyEnumerator];
-    while((key = [keyEnum nextObject])) {
-      item = [self->entries objectForKey:key];
-      if([item useCount] < minimumUseCount) {
-        minimumUseCount = [item useCount];
-        leastUsedItemKey = key;
-      }
-    }
-    [self->entries removeObjectForKey:leastUsedItemKey];
-  }
-  item = [[SOGoLRUCacheItem alloc] initWithObject:_obj];
-  [self->entries setObject:item forKey:_key];
-  [item release];
-}
-
-- (id)objectForKey:(id)_key {
-  SOGoLRUCacheItem *item;
-  
-  item = [self->entries objectForKey:_key];
-  if(!item)
-    return nil;
-  return [item object];
-}
-
-@end
index c41acfc91fb06cec1578005bf83ef43c6318b611..7d68164245e1dcddc0d15684b68c8123ed942521 100644 (file)
@@ -22,7 +22,7 @@
 #ifndef __SOGoUser_H__
 #define __SOGoUser_H__
 
-#include <NGObjWeb/SoUser.h>
+#import <NGObjWeb/SoUser.h>
 
 /*
   SOGoUser
 @class NSUserDefaults;
 @class NSTimeZone;
 @class WOContext;
+@class SOGoDateFormatter;
+
+extern NSString *SOGoWeekStartHideWeekNumbers;
+extern NSString *SOGoWeekStartJanuary1;
+extern NSString *SOGoWeekStartFirst4DayWeek;
+extern NSString *SOGoWeekStartFirstFullWeek;
 
 @interface SOGoUser : SoUser
 {
+  NSString *currentPassword;
   NSString *cn;
   NSString *language;
   NSArray *allEmails;
   NSUserDefaults *userDefaults;
   NSUserDefaults *userSettings;
   NSTimeZone *userTimeZone;
+  SOGoDateFormatter *dateFormatter;
 }
 
 + (SOGoUser *) userWithLogin: (NSString *) login
                       roles: (NSArray *) roles;
+- (void) setCurrentPassword: (NSString *) newPassword;
+- (NSString *) currentPassword;
 
 /* properties */
 
@@ -68,6 +78,8 @@
 - (NSString *) cn;
 - (NSURL *) freeBusyURL;
 
+- (SOGoDateFormatter *) dateFormatterInContext: (WOContext *) context;
+
 /* shares and identities */
 
 - (NSString *) primaryIMAP4AccountString;
index d60b5dc2c2ab0a77f1e7fac101795e5929938c41..a79694b9e539e9d6ff54aed9ba6ff3db6a240c83 100644 (file)
@@ -29,7 +29,8 @@
 
 #import "AgenorUserDefaults.h"
 #import "LDAPUserManager.h"
-#import "SOGoContentObject.h"
+#import "SOGoDateFormatter.h"
+#import "SOGoObject.h"
 #import "SOGoPermissions.h"
 #import "NSArray+Utilities.h"
 
@@ -40,6 +41,11 @@ static NSString *fallbackIMAP4Server = nil;
 static NSString *defaultLanguage = nil;
 static NSURL *AgenorProfileURL = nil;
 
+NSString *SOGoWeekStartHideWeekNumbers = @"HideWeekNumbers";
+NSString *SOGoWeekStartJanuary1 = @"January1";
+NSString *SOGoWeekStartFirst4DayWeek = @"First4DayWeek";
+NSString *SOGoWeekStartFirstFullWeek = @"FirstFullWeek";
+
 @interface NSObject (SOGoRoles)
 
 - (NSArray *) rolesOfUser: (NSString *) uid;
@@ -98,6 +104,8 @@ static NSURL *AgenorProfileURL = nil;
       userSettings = nil;
       allEmails = nil;
       language = nil;
+      currentPassword = nil;
+      dateFormatter = nil;
     }
 
   return self;
@@ -125,13 +133,25 @@ static NSURL *AgenorProfileURL = nil;
 
 - (void) dealloc
 {
+  [currentPassword release];
   [userDefaults release];
   [userSettings release];
   [allEmails release];
   [language release];
+  [dateFormatter release];
   [super dealloc];
 }
 
+- (void) setCurrentPassword: (NSString *) newPassword
+{
+  ASSIGN (currentPassword, newPassword);
+}
+
+- (NSString *) currentPassword
+{
+  return currentPassword;
+}
+
 - (id) _fetchFieldForUser: (NSString *) field
 {
   NSDictionary *contactInfos;
@@ -232,6 +252,30 @@ static NSURL *AgenorProfileURL = nil;
   return nil;
 }
 
+- (SOGoDateFormatter *) dateFormatterInContext: (WOContext *) context
+{
+  NSString *format;
+  NSUserDefaults *ud;
+
+  if (!dateFormatter)
+    {
+      dateFormatter = [SOGoDateFormatter new];
+      [dateFormatter setLocale: [context valueForKey: @"locale"]];
+      ud = [self userDefaults];
+      format = [ud stringForKey: @"ShortDateFormat"];
+      if (format)
+       [dateFormatter setShortDateFormat: format];
+      format = [ud stringForKey: @"LongDateFormat"];
+      if (format)
+       [dateFormatter setLongDateFormat: format];
+      format = [ud stringForKey: @"TimeFormat"];
+      if (format)
+       [dateFormatter setTimeFormat: format];
+    }
+
+  return dateFormatter;
+}
+
 /* defaults */
 
 - (NSUserDefaults *) userDefaults
@@ -309,8 +353,10 @@ static NSURL *AgenorProfileURL = nil;
   if ([folder isKindOfClass:[NSException class]])
     return folder;
   
-  [(WOContext *)_ctx setObject:folder ? folder : [NSNull null] 
-                forKey: @"ActiveUserHomeFolder"];
+  [(WOContext *)_ctx setObject: ((folder)
+                                ? folder
+                                : [NSNull null])
+               forKey: @"ActiveUserHomeFolder"];
   return folder;
 }
 
index 8664beeda9b79b776abf8dc8073336c5944dd953..3fc0684e99f34f20894cc3dfd10c0416980fff8a 100644 (file)
   02111-1307, USA.
 */
 
-#import "WOContext+Agenor.h"
-#import "common.h"
-#import "SOGoUser.h"
+#import <Foundation/NSArray.h>
+#import <Foundation/NSString.h>
+
+#import <NGObjWeb/NSException+HTTP.h>
+#import <NGExtensions/NSObject+Logs.h>
+
+#import <Appointments/SOGoAppointmentFolder.h>
+#import <Appointments/SOGoFreeBusyObject.h>
+#import <Contacts/SOGoContactFolders.h>
+#import <Mailer/SOGoMailAccounts.h>
 
-#import "Appointments/SOGoAppointmentFolder.h"
-#import "Appointments/SOGoFreeBusyObject.h"
-#import "Contacts/SOGoContactFolders.h"
-#import "Mailer/SOGoMailAccounts.h"
 #import "SOGoPermissions.h"
+#import "SOGoUser.h"
 
 #import "SOGoUserFolder.h"
 
diff --git a/SoObjects/SOGo/WOContext+Agenor.h b/SoObjects/SOGo/WOContext+Agenor.h
deleted file mode 100644 (file)
index 759e3fc..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
-  Copyright (C) 2000-2005 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.
-*/
-
-#ifndef        __SOGo_WOContext_Agenor_H_
-#define        __SOGo_WOContext_Agenor_H_
-
-#include <NGObjWeb/WOContext.h>
-
-@interface WOContext (Agenor)
-
-- (BOOL)isAccessFromIntranet;
-
-@end
-
-#endif /* __SOGo_WOContext_Agenor_H_ */
diff --git a/SoObjects/SOGo/WOContext+Agenor.m b/SoObjects/SOGo/WOContext+Agenor.m
deleted file mode 100644 (file)
index f8d246f..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
-  Copyright (C) 2000-2005 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.
-*/
-
-#include "WOContext+Agenor.h"
-#include "common.h"
-
-@implementation WOContext(Agenor)
-
-static EOQualifier *internetDetectQualifier = nil;
-
-static EOQualifier *getInternetDetectQualifier(void) {
-  static BOOL didCheck = NO;
-  NSUserDefaults *ud;
-  NSString *s;
-  
-  if (didCheck) return internetDetectQualifier;
-  
-  ud = [NSUserDefaults standardUserDefaults];
-  
-  if ((s = [ud stringForKey:@"SOGoInternetDetectQualifier"]) != nil) {
-    internetDetectQualifier = 
-      [[EOQualifier qualifierWithQualifierFormat:s] retain];
-    if (internetDetectQualifier == nil)
-      NSLog(@"ERROR: could not parse qualifier: '%@'", s);
-  }
-  if (internetDetectQualifier == nil)
-    NSLog(@"Note: no 'SOGoInternetDetectQualifier' configured.");
-  else {
-    NSLog(@"Note: detect Internet access using: %@", 
-         internetDetectQualifier);
-  }
-
-  didCheck = YES;
-  return internetDetectQualifier;
-}
-
-- (BOOL)isAccessFromIntranet {
-  id<EOQualifierEvaluation> q;
-  NSNumber  *bv;
-  WORequest *rq;
-  BOOL ok;
-  
-  if ((bv = [self objectForKey:@"_agenorUnrestricedAccess"]) != nil)
-    return [bv boolValue];
-
-  if ((rq = [self request]) == nil) {
-    [self logWithFormat:@"ERROR: got no request for context!"];
-    return NO;
-  }
-  
-
-  if ((q = (id)getInternetDetectQualifier()) == nil)
-    /* if no qualifier is set, allow access */
-    ok = YES;
-  else
-    /* is Internet request? */
-    ok = [q evaluateWithObject:[rq headers]] ? NO : YES;
-  
-  bv = [NSNumber numberWithBool:ok];
-  [self setObject:bv forKey:@"_agenorUnrestricedAccess"];
-  return ok;
-}
-
-@end /*  WOContext(Agenor) */
diff --git a/SoObjects/SOGo/common.h b/SoObjects/SOGo/common.h
deleted file mode 100644 (file)
index f6659b7..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
-  Copyright (C) 2002-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$
-
-#import <Foundation/Foundation.h>
-
-#if NeXT_Foundation_LIBRARY || COCOA_Foundation_LIBRARY
-#  include <NGExtensions/NGObjectMacros.h>
-#  include <NGExtensions/NSString+Ext.h>
-#endif
-
-#include <NGExtensions/NGExtensions.h>
-#include <NGObjWeb/NGObjWeb.h>
-#include <NGObjWeb/SoObjects.h>
index e01a23f3e353a66f82d73b63b8747c7efa9d8a45..77209b0583a3d55a6d145508e0e5ec6555169580 100644 (file)
   return [self relativePathToUserFolderSubPath: @"Mail/"];
 }
 
+- (NSString *) relativePreferencesPath
+{
+  return [self relativePathToUserFolderSubPath: @"preferences"];
+}
+
 - (NSString *) logoffPath
 {
   return [self relativePathToUserFolderSubPath: @"logoff"];
index 89d5e12bee652fef33ece900fc7d9150bc82fee0..9521d4889f09759a63825aaa82de7cceafce55ad 100644 (file)
@@ -4,13 +4,14 @@
 include $(GNUSTEP_MAKEFILES)/common.make
 
 SUBPROJECTS += \
-       SOGoUI          \
-       MainUI          \
        Common          \
-       Scheduler       \
        Contacts        \
        MailerUI        \
        MailPartViewers \
+       MainUI          \
+       PreferencesUI   \
+       Scheduler       \
+       SOGoUI          \
        Templates
 
 include $(GNUSTEP_MAKEFILES)/aggregate.make
index 494d21d427df57f044abbaa4cbefa011f566e633..bd698739d61c95cd7f3ee453d08a566bbde03a3b 100644 (file)
 
 - (SOGoDateFormatter *)dateFormatter {
   if (self->dateFormatter == nil) {
-    self->dateFormatter =
-      [[SOGoDateFormatter alloc] initWithLocale:[self locale]];
-    [self->dateFormatter setFullWeekdayNameAndDetails];
+    dateFormatter = [[context activeUser] dateFormatterInContext: context];
+    [dateFormatter retain];
   }
+
   return self->dateFormatter;
 }
 
index cb4954e47b8a01378906a005d32c4187f0bf2b7d..6b530be2106c8c88d67ca8352131164e28f6eae5 100644 (file)
@@ -40,7 +40,6 @@
 #import <SoObjects/Mailer/SOGoMailAccounts.h>
 #import <SoObjects/Mailer/SOGoMailIdentity.h>
 #import <SoObjects/SOGo/SOGoUser.h>
-#import <SoObjects/SOGo/WOContext+Agenor.h>
 #import <SOGoUI/UIxComponent.h>
 
 /*
@@ -226,19 +225,6 @@ static NSArray      *infoKeys            = nil;
   return [self labelForKey:@"Compose Mail"];
 }
 
-/* detect webmail being accessed from the outside */
-
-- (BOOL)isInternetRequest {
-  // DEPRECATED
-  return [[self context] isAccessFromIntranet] ? NO : YES;
-}
-
-- (BOOL)showInternetMarker {
-  if (!showInternetMarker)
-    return NO;
-  return [[self context] isAccessFromIntranet] ? NO : YES;
-}
-
 /* info loading */
 
 - (void)loadInfo:(NSDictionary *)_info {
@@ -507,7 +493,6 @@ static NSArray      *infoKeys            = nil;
 {
   NSException  *error;
   NSString     *mailPath;
-  NSDictionary *h;
   id <WOActionResults> result;
 
   // TODO: need to validate whether we have a To etc
@@ -529,12 +514,10 @@ static NSArray      *infoKeys            = nil;
   
   /* setup some extra headers if required */
   
-  h = [[self context] isAccessFromIntranet] ? nil : internetMailHeaders;
-  
   /* save mail to file (so that we can upload the mail to Cyrus) */
   // TODO: all this could be handled by the SOGoDraftObject?
   
-  mailPath = [[self clientObject] saveMimeMessageToTemporaryFileWithHeaders:h];
+  mailPath = [[self clientObject] saveMimeMessageToTemporaryFileWithHeaders: internetMailHeaders];
 
   /* then, send mail */
   
index c98cb4ba59f2898124e74f68a1c9b9ae5cbcba42..7d7fd458a1721df7e908a101db9c496b9094c7b7 100644 (file)
 #ifndef UIXMAILLISTVIEW_H
 #define UIXMAILLISTVIEW_H
 
-#include <SOGoUI/UIxComponent.h>
+#import <SOGoUI/UIxComponent.h>
 
 @class EOQualifier;
+@class SOGoDateFormatter;
 
 @interface UIxMailListView : UIxComponent
 {
@@ -33,6 +34,8 @@
   unsigned    firstMessageNumber;
   id          message;
   EOQualifier *qualifier;
+  SOGoDateFormatter *dateFormatter;
+  NSTimeZone *userTimeZone;
 }
 
 - (NSString *)defaultSortKey;
index 86844b86152180dc9b3a1e9b170f6b12dcb3ff3a..f0a2ff930345594c7fc47dbd1751d16886a8cbd2 100644 (file)
   object.
 */
 
-#define messagesPerPage 50
-
-#include "common.h"
-#include <SoObjects/Mailer/SOGoMailFolder.h>
-#include <SoObjects/Mailer/SOGoMailObject.h>
-#include <NGObjWeb/SoObject+SoDAV.h>
+#import <Foundation/NSCalendarDate.h>
+#import <Foundation/NSDictionary.h>
+#import <Foundation/NSValue.h>
+#import <NGObjWeb/WOResponse.h>
+#import <NGObjWeb/WORequest.h>
+#import <NGObjWeb/SoObject+SoDAV.h>
+#import <NGObjWeb/NSException+HTTP.h>
+#import <NGExtensions/NSNull+misc.h>
+#import <NGExtensions/NSString+misc.h>
+
+#import <SoObjects/Mailer/SOGoMailFolder.h>
+#import <SoObjects/Mailer/SOGoMailObject.h>
+#import <SoObjects/SOGo/SOGoDateFormatter.h>
+#import <SoObjects/SOGo/SOGoUser.h>
 
 #import "UIxMailListView.h"
 
+#define messagesPerPage 50
 static int attachmentFlagSize = 8096;
 
 @implementation UIxMailListView
@@ -45,6 +54,8 @@ static int attachmentFlagSize = 8096;
   [self->sortedUIDs release];
   [self->messages   release];
   [self->message    release];
+  [dateFormatter release];
+  [userTimeZone release];
   [super dealloc];
 }
 
@@ -71,6 +82,16 @@ static int attachmentFlagSize = 8096;
   return self->message;
 }
 
+- (NSString *) messageDate
+{
+  NSCalendarDate *messageDate;
+
+  messageDate = [[message objectForKey: @"envelope"] date];
+  [messageDate setTimeZone: userTimeZone];
+
+  return [dateFormatter formattedDateAndTime: messageDate];
+}
+
 - (void) setQualifier: (EOQualifier *) _msg 
 {
   ASSIGN(self->qualifier, _msg);
@@ -309,10 +330,17 @@ static int attachmentFlagSize = 8096;
   NSArray  *msgs;
   NSRange  r;
   unsigned len;
+  SOGoUser *user;
   
   if (self->messages != nil)
     return self->messages;
-  
+
+  user = [context activeUser];
+  if (!dateFormatter)
+    dateFormatter = [user dateFormatterInContext: context];
+  if (!userTimeZone)
+    ASSIGN (userTimeZone, [user timeZone]);
+
   r    = [self fetchBlock];
   uids = [self sortedUIDs];
   if ((len = [uids count]) > r.length)
index ac087fc26af4549431b482e94ea136868578040f..35be0ce46d082c85e2ef4b002dbe00f03234af02 100644 (file)
@@ -1,35 +1,35 @@
 /* English */
 {
-       NSLanguageName = "English";
-       NSFormalName = "English";
-       NSLocaleCode = "en"; /* ISO 639-1 */
-       NSLanguageCode = "eng"; /* ISO 639-2 */
-       NSParentContext = "";
+  NSLanguageName = "English";
+  NSFormalName = "English";
+  NSLocaleCode = "en"; /* ISO 639-1 */
+  NSLanguageCode = "eng"; /* ISO 639-2 */
+  NSParentContext = "";
 
-       NSAMPMDesignation = (AM, PM);
-       NSCurrencySymbol = "$";
-       NSDateFormatString = "%A, %B %e, %Y";
-       NSDateTimeOrdering = MDYH;
-       NSDecimalDigits = ("0", "1", "2", "3", "4", "5", "6", "7", "8", "9");
-       NSDecimalSeparator = ".";
-       NSEarlierTimeDesignations = (prior, last, past, ago);
-       NSHourNameDesignations = ((0, midnight), (10, morning), (12, noon, lunch), (14, afternoon), (19, dinner));
-       NSInternationalCurrencyString = USD; /* ISO 4217 */
-       NSLaterTimeDesignations = (next);
-       NSMonthNameArray = (January, February, March, April, May, June, July, August, September, October, November, December);
-       NSNextDayDesignations = (tomorrow);
-       NSNextNextDayDesignations = (nextday);
-       NSPriorDayDesignations = (yesterday);
-       NSShortDateFormatString = "%1m/%e/%y";
-       NSShortMonthNameArray = (Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec);
-       NSShortTimeDateFormatString = "%1m/%e/%y %1I:%M %p";
-       NSShortWeekDayNameArray = (Sun, Mon, Tue, Wed, Thu, Fri, Sat);
-       NSThisDayDesignations = (today, now);
-       NSThousandsSeparator = ",";
-       NSTimeDateFormatString = "%A, %B %e, %Y %1I:%M:%S %p %Z";
-       NSTimeFormatString = "%1I:%M:%S %p";
-       NSWeekDayNameArray = (Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday);
-       NSYearMonthWeekDesignations = (year, month, week);
-       NSPositiveCurrencyFormatString = "$9,999.00";
-       NSNegativeCurrencyFormatString = "-$9,999.00";
+  NSAMPMDesignation = (AM, PM);
+  NSCurrencySymbol = "$";
+  NSDateFormatString = "%A, %B %e, %Y";
+  NSDateTimeOrdering = MDYH;
+  NSDecimalDigits = ("0", "1", "2", "3", "4", "5", "6", "7", "8", "9");
+  NSDecimalSeparator = ".";
+  NSEarlierTimeDesignations = (prior, last, past, ago);
+  NSHourNameDesignations = ((0, midnight), (10, morning), (12, noon, lunch), (14, afternoon), (19, dinner));
+  NSInternationalCurrencyString = USD; /* ISO 4217 */
+  NSLaterTimeDesignations = (next);
+  NSMonthNameArray = (January, February, March, April, May, June, July, August, September, October, November, December);
+  NSNextDayDesignations = (tomorrow);
+  NSNextNextDayDesignations = (nextday);
+  NSPriorDayDesignations = (yesterday);
+  NSShortDateFormatString = "%m/%e/%y";
+  NSShortMonthNameArray = (Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec);
+  NSShortTimeDateFormatString = "%m/%e/%y %I:%M %p";
+  NSShortWeekDayNameArray = (Sun, Mon, Tue, Wed, Thu, Fri, Sat);
+  NSThisDayDesignations = (today, now);
+  NSThousandsSeparator = ",";
+  NSTimeDateFormatString = "%A, %B %e, %Y %I:%M:%S %p %Z";
+  NSTimeFormatString = "%I:%M:%S %p";
+  NSWeekDayNameArray = (Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday);
+  NSYearMonthWeekDesignations = (year, month, week);
+  NSPositiveCurrencyFormatString = "$9,999.00";
+  NSNegativeCurrencyFormatString = "-$9,999.00";
 }
index 70b8a2f64afb3013d1162b933626a13c1da7104f..38525b195d6a4c1e72eec44c799e09572acb1c38 100644 (file)
@@ -1,35 +1,35 @@
 /* French */
 {
-       NSLanguageName = "French";
-       NSFormalName = "Français";
-       NSLocaleCode = "fr"; /* ISO 639-1 */
-       NSLanguageCode = "fra"; /* ISO 639-2 */
-       NSParentContext = "";
+  NSLanguageName = "French";
+  NSFormalName = "Français";
+  NSLocaleCode = "fr"; /* ISO 639-1 */
+  NSLanguageCode = "fra"; /* ISO 639-2 */
+  NSParentContext = "";
 
-       NSCurrencySymbol = " â‚¬";
-       NSDateFormatString = "%A %e %B %Y";
-       NSDateTimeOrdering = DMYH;
-       NSDecimalDigits = ("0", "1", "2", "3", "4", "5", "6", "7", "8", "9");
-       NSDecimalSeparator = ",";
-       NSEarlierTimeDesignations = (dernier, "dernière", derniers, "dernières");
-       NSHourNameDesignations = ((0, minuit), (12, midi), (10, matin), (14, "après-midi"), (19, soir));
-       NSInternationalCurrencyString = EUR; /* ISO 4217 */
-       NSLaterTimeDesignations = (prochain, prochaine, prochains, prochaines);
-       NSMonthNameArray = (Janvier, "Février", Mars, Avril, Mai, Juin, Juillet, "Août", Septembre, Octobre, Novembre, "Décembre");
-       NSNextDayDesignations = (demain);
-       NSNextNextDayDesignations = ("après-demain");
-       NSPriorDayDesignations = (hier);
-       NSShortDateFormatString = "%e/%m/%y";
-       NSShortMonthNameArray = (Jan, "Fév", Mar, Avr, Mai, Jun, Jul, "Aoû", Sep, Oct, Nov, "Déc");
-       NSShortTimeDateFormatString = "%e/%m/%y %1H:%M";
-       NSShortWeekDayNameArray = (Dim, Lun, Mar, Mer, Jeu, Ven, Sam);
-       NSThisDayDesignations = ("aujourd'hui");
-       NSThousandsSeparator = " "; /* space */
-       NSTimeDateFormatString = "%A %e %B %Y %1H:%M:%S %Z";
-       NSTimeFormatString = "%1H:%M:%S"; /* no space before and after colons*/
-       NSWeekDayNameArray = (Dimanche, Lundi, Mardi, Mercredi, Jeudi, Vendredi, Samedi);
-       NSYearMonthWeekDesignations = ("année", mois, semaine);
-       NSAMPMDesignation = (AM, PM);
-       NSPositiveCurrencyFormatString = "9,999.00$";
-       NSNegativeCurrencyFormatString = "-9,999.00$";
+  NSCurrencySymbol = " â‚¬";
+  NSDateFormatString = "%A %e %B %Y";
+  NSDateTimeOrdering = DMYH;
+  NSDecimalDigits = ("0", "1", "2", "3", "4", "5", "6", "7", "8", "9");
+  NSDecimalSeparator = ",";
+  NSEarlierTimeDesignations = (dernier, "dernière", derniers, "dernières");
+  NSHourNameDesignations = ((0, minuit), (12, midi), (10, matin), (14, "après-midi"), (19, soir));
+  NSInternationalCurrencyString = EUR; /* ISO 4217 */
+  NSLaterTimeDesignations = (prochain, prochaine, prochains, prochaines);
+  NSMonthNameArray = (Janvier, "Février", Mars, Avril, Mai, Juin, Juillet, "Août", Septembre, Octobre, Novembre, "Décembre");
+  NSNextDayDesignations = (demain);
+  NSNextNextDayDesignations = ("après-demain");
+  NSPriorDayDesignations = (hier);
+  NSShortDateFormatString = "%e/%m/%y";
+  NSShortMonthNameArray = (Jan, "Fév", Mar, Avr, Mai, Jun, Jul, "Aoû", Sep, Oct, Nov, "Déc");
+  NSShortTimeDateFormatString = "%e/%m/%y %H:%M";
+  NSShortWeekDayNameArray = (Dim, Lun, Mar, Mer, Jeu, Ven, Sam);
+  NSThisDayDesignations = ("aujourd'hui");
+  NSThousandsSeparator = " "; /* space */
+  NSTimeDateFormatString = "%A %e %B %Y %H:%M:%S %Z";
+  NSTimeFormatString = "%H:%M:%S"; /* no space before and after colons*/
+  NSWeekDayNameArray = (Dimanche, Lundi, Mardi, Mercredi, Jeudi, Vendredi, Samedi);
+  NSYearMonthWeekDesignations = ("année", mois, semaine);
+  NSAMPMDesignation = (AM, PM);
+  NSPositiveCurrencyFormatString = "9,999.00$";
+  NSNegativeCurrencyFormatString = "-9,999.00$";
 }
diff --git a/UI/PreferencesUI/English.lproj/Localizable.strings b/UI/PreferencesUI/English.lproj/Localizable.strings
new file mode 100644 (file)
index 0000000..28a5e75
--- /dev/null
@@ -0,0 +1,73 @@
+/* toolbar */
+"Save and Close" = "Save and Close";
+"Close" = "Close";
+
+/* tabs */
+"Out of Office" = "Out of Office";
+"Date and Time" = "Date and Time";
+"Calendar Options" = "Calendar Options";
+"Password" = "Password";
+
+/* ooo */
+"I'm currently in the office" = "I'm currently in the office";
+"I'm currently out of the office" = "I'm currently out of the office";
+"AutoReply only once to each sender with the following text :"
+= "AutoReply only once to each sender with the following text :";
+
+/* d & t */
+"Current Time Zone :" = "Current Time Zone :";
+"Short Date Format :" = "Short Date Format :";
+"Long Date Format :" = "Long Date Format :";
+"Time Format :" = "Time Format :";
+
+"shortDateFmt_0" = "%m/%e/%Y";
+"shortDateFmt_1" = "%m/%e/%y";
+"shortDateFmt_2" = "%m/%d/%Y";
+"shortDateFmt_3" = "%m/%d/%y";
+"shortDateFmt_4" = "%y/%m/%d";
+"shortDateFmt_5" = "%Y-%m-%d";
+"shortDateFmt_6" = "%d-%b-%y";
+"shortDateFmt_7" = "";
+
+"longDateFmt_0" = "%A, %B %d, %Y";
+"longDateFmt_1" = "%B %d, %Y";
+"longDateFmt_2" = "%A, %d %B, %Y";
+"longDateFmt_3" = "%d %B, %Y";
+"longDateFmt_4" = "";
+
+"timeFmt_0" = "%I:%M %p";
+"timeFmt_1" = "%H:%M";
+"timeFmt_2" = "";
+
+/* calendar */
+"Week begins on :" = "Week begins on :";
+"Day start time :" = "Day start time :";
+"Day end time :" = "Day end time :";
+"First week of year :" = "First week of year :";
+"Enable reminders for Calendar items" = "Enable reminders for Calendar items";
+"Play a sound when a reminder comes due"
+= "Play a sound when a reminder comes due";
+"Default reminder :" = "Default reminder :";
+
+"firstWeekOfYear_HideWeekNumbers" = "Do not display week numbers";
+"firstWeekOfYear_January1" = "Starts on january 1";
+"firstWeekOfYear_First4DayWeek" = "First 4-day week";
+"firstWeekOfYear_FirstFullWeek" = "First full week";
+
+"reminderTime_0000" = "0 minutes";
+"reminderTime_0005" = "5 minutes";
+"reminderTime_0010" = "10 minutes";
+"reminderTime_0015" = "15 minutes";
+"reminderTime_0030" = "30 minutes";
+"reminderTime_0100" = "1 hour";
+"reminderTime_0200" = "2 hours";
+"reminderTime_0400" = "2 hours";
+"reminderTime_0800" = "2 hours";
+"reminderTime_1200" = "1/2 day";
+"reminderTime_2400" = "1 day";
+"reminderTime_4800" = "2 days";
+
+/* password */
+"New password:" = "New password:";
+"Confirmation:" = "Confirmation:";
+"Change" = "Change";
diff --git a/UI/PreferencesUI/French.lproj/Localizable.strings b/UI/PreferencesUI/French.lproj/Localizable.strings
new file mode 100644 (file)
index 0000000..74b46dd
--- /dev/null
@@ -0,0 +1,70 @@
+/* toolbar */
+"Save and Close" = "Enregistrer et fermer";
+"Close" = "Fermer";
+
+/* tabs */
+"Out of Office" = "Absence du bureau";
+"Date and Time" = "Date et heure";
+"Calendar Options" = "Calendrier";
+"Password" = "Mot de passe";
+
+/* ooo */
+"I'm currently in the office" = "Je suis présent";
+"I'm currently out of the office" = "Je suis absent";
+"AutoReply only once to each sender with the following text :"
+= "Répondre automatiquement avec le texte suivant, une seule fois par expéditeur :";
+
+/* d & t */
+"Current Time Zone :" = "Fuseau horaire en cours :";
+"Short Date Format :" = "Style de date courte :";
+"Long Date Format :" = "Style de date longue :";
+"Time Format :" = "Style de l'heure :";
+
+"shortDateFmt_0" = "%d/%m/%Y";
+"shortDateFmt_1" = "%d/%m/%y";
+"shortDateFmt_2" = "%d.%m.%y";
+"shortDateFmt_3" = "%d-%m-%y";
+"shortDateFmt_4" = "%Y-%m-%d";
+"shortDateFmt_5" = "";
+
+"longDateFmt_0" = "%A %e %B %Y";
+"longDateFmt_1" = "%e %b. %Y";
+"longDateFmt_2" = "%e %B %Y";
+"longDateFmt_3" = "";
+
+"timeFmt_0" = "%H:%M";
+"timeFmt_1" = "%H.%M";
+"timeFmt_2" = "%H h. %M";
+"timeFmt_3" = "";
+
+/* calendar */
+"Week begins on :" = "Premier jour de la semaine :";
+"Day start time :" = "Début de la journée :";
+"Day end time :" = "Fin de la journée :";
+"First week of year :" = "Première semaine de l'année :";
+"Enable reminders for Calendar items" = "Activer les rappels pour les Ã©léments du calendrier";
+"Play a sound when a reminder comes due" = "Émettre un signal sonore Ã  l'échéance du rappel";
+"Default reminder :" = "Rappel par défaut :";
+
+"firstWeekOfYear_HideWeekNumbers" = "Ne pas afficher le numéro des semaines";
+"firstWeekOfYear_January1" = "Commence le 1er janvier";
+"firstWeekOfYear_First4DayWeek" = "Première semaine de 4 jours";
+"firstWeekOfYear_FirstFullWeek" = "Première semaine entière";
+
+"reminderTime_0000" = "0 minutes";
+"reminderTime_0005" = "5 minutes";
+"reminderTime_0010" = "10 minutes";
+"reminderTime_0015" = "15 minutes";
+"reminderTime_0030" = "30 minutes";
+"reminderTime_0100" = "1 heure";
+"reminderTime_0200" = "2 heures";
+"reminderTime_0400" = "2 heures";
+"reminderTime_0800" = "2 heures";
+"reminderTime_1200" = "1/2 journée";
+"reminderTime_2400" = "1 journée";
+"reminderTime_4800" = "2 journées";
+
+/* password */
+"New password:" = "Nouveau mot de passe :";
+"Confirmation:" = "Confirmation :";
+"Change" = "Changer";
diff --git a/UI/PreferencesUI/GNUmakefile b/UI/PreferencesUI/GNUmakefile
new file mode 100644 (file)
index 0000000..86fe282
--- /dev/null
@@ -0,0 +1,32 @@
+# GNUstep makefile
+
+include ../common.make
+
+BUNDLE_NAME = PreferencesUI
+
+PreferencesUI_PRINCIPAL_CLASS = PreferencesUIProduct
+
+PreferencesUI_LANGUAGES = English French
+
+PreferencesUI_OBJC_FILES =             \
+       PreferencesUIProduct.m          \
+       \
+       UIxJSONPreferences.m            \
+       UIxPreferences.m
+
+PreferencesUI_RESOURCE_FILES += \
+       Version         \
+       product.plist   
+
+PreferencesUI_RESOURCE_FILES += \
+       Toolbars/UIxPreferences.toolbar
+
+PreferencesUI_LOCALIZED_RESOURCE_FILES += \
+       Localizable.strings             \
+
+-include GNUmakefile.preamble
+include $(GNUSTEP_MAKEFILES)/bundle.make
+-include GNUmakefile.postamble
+include ../../fhsbundle.make
+
+
diff --git a/UI/PreferencesUI/PreferencesUIProduct.m b/UI/PreferencesUI/PreferencesUIProduct.m
new file mode 100644 (file)
index 0000000..9f569d1
--- /dev/null
@@ -0,0 +1,33 @@
+/* PreferencesUIProduct.m - this file is part of SOGo
+ *
+ * Copyright (C) 2007 Inverse groupe conseil
+ *
+ * Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
+ *
+ * This file is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This file 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; see the file COPYING.  If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#import <Foundation/NSObject.h>
+
+@interface PreferencesUIProduct : NSObject
+{
+}
+
+@end
+
+@implementation PreferencesUIProduct
+
+@end
diff --git a/UI/PreferencesUI/Toolbars/UIxPreferences.toolbar b/UI/PreferencesUI/Toolbars/UIxPreferences.toolbar
new file mode 100644 (file)
index 0000000..b30200e
--- /dev/null
@@ -0,0 +1,12 @@
+( /* the toolbar groups -*-cperl-*- */
+  ( { link = "#";
+      label = "Save and Close";
+      onclick = "return savePreferences();";
+      image = "tb-compose-save-flat-24x24.png"; },
+    { link = "#";
+      isSafe = NO;
+      label = "Close";
+      onclick = "window.close(); return false;";
+      image = "tb-mail-stop-flat-24x24.png"; }
+  )
+)
diff --git a/UI/PreferencesUI/UIxJSONPreferences.h b/UI/PreferencesUI/UIxJSONPreferences.h
new file mode 100644 (file)
index 0000000..df39820
--- /dev/null
@@ -0,0 +1,32 @@
+/* UIxJSONPreferences.h - this file is part of SOGo
+ *
+ * Copyright (C) 2007 Inverse groupe conseil
+ *
+ * Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
+ *
+ * This file is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This file 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; see the file COPYING.  If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifndef UIXJSONPREFERENCES_H
+#define UIXJSONPREFERENCES_H
+
+#import <NGObjWeb/WODirectAction.h>
+
+@interface UIxJSONPreferences : WODirectAction
+
+@end
+
+#endif /* UIXJSONSETTINGS_H */
diff --git a/UI/PreferencesUI/UIxJSONPreferences.m b/UI/PreferencesUI/UIxJSONPreferences.m
new file mode 100644 (file)
index 0000000..96f1d35
--- /dev/null
@@ -0,0 +1,52 @@
+/* UIxJSONPreferences.m - this file is part of SOGo
+ *
+ * Copyright (C) 2007 Inverse groupe conseil
+ *
+ * Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
+ *
+ * This file is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This file 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; see the file COPYING.  If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#import <Foundation/NSUserDefaults.h>
+
+#import <NGObjWeb/WOContext+SoObjects.h>
+#import <NGObjWeb/WODirectAction.h>
+
+#import <SoObjects/SOGo/SOGoUser.h>
+
+#import "UIxJSONPreferences.h"
+
+@implementation UIxJSONPreferences
+
+- (WOResponse *) jsonDefaultsAction
+{
+  NSUserDefaults *defaults;
+
+  defaults = [[context activeUser] userDefaults];
+
+  return [defaults jsonRepresentation];
+}
+
+- (WOResponse *) jsonSettingsAction
+{
+  NSUserDefaults *settings;
+
+  settings = [[context activeUser] userSettings];
+
+  return [settings jsonRepresentation];
+}
+
+@end
diff --git a/UI/PreferencesUI/UIxPreferences.h b/UI/PreferencesUI/UIxPreferences.h
new file mode 100644 (file)
index 0000000..5570fbc
--- /dev/null
@@ -0,0 +1,45 @@
+/* UIxPreferences.h - this file is part of SOGo
+ *
+ * Copyright (C) 2007 Inverse groupe conseil
+ *
+ * Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
+ *
+ * This file is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This file 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; see the file COPYING.  If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifndef UIXPREFERENCES_H
+#define UIXPREFERENCES_H
+
+#import <SOGoUI/UIxComponent.h>
+
+@class NSString;
+@class NSUserDefaults;
+
+@class SOGoUser;
+
+@interface UIxPreferences : UIxComponent
+{
+  NSString *item;
+  SOGoUser *user;
+  NSUserDefaults *userDefaults;
+  NSCalendarDate *today;
+  NSMutableArray *hours;
+  NSArray *daysOfWeek;
+}
+
+@end
+
+#endif /* UIXPREFERENCES_H */
diff --git a/UI/PreferencesUI/UIxPreferences.m b/UI/PreferencesUI/UIxPreferences.m
new file mode 100644 (file)
index 0000000..2c8c486
--- /dev/null
@@ -0,0 +1,429 @@
+/* UIxPreferences.m - this file is part of SOGo
+ *
+ * Copyright (C) 2007 Inverse groupe conseil
+ *
+ * Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
+ *
+ * This file is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This file 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; see the file COPYING.  If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#import <Foundation/NSCalendarDate.h>
+#import <Foundation/NSString.h>
+#import <Foundation/NSTimeZone.h>
+#import <Foundation/NSUserDefaults.h>
+
+#import <NGObjWeb/WOContext.h>
+#import <NGObjWeb/WORequest.h>
+
+#import <SoObjects/SOGo/SOGoUser.h>
+
+#import "UIxPreferences.h"
+
+#warning this class is not finished
+/* remaining:
+   default event length
+   default snooze length
+   refresh calendar every X minutes
+   workweek = from -> to
+   identities */
+
+@implementation UIxPreferences
+
+- (id) init
+{
+  NSDictionary *locale;
+  
+  if ((self = [super init]))
+    {
+      item = nil;
+      hours = nil;
+      ASSIGN (user, [context activeUser]);
+      ASSIGN (userDefaults, [user userDefaults]);
+      ASSIGN (today, [NSCalendarDate date]);
+      locale = [context valueForKey: @"locale"];
+      ASSIGN (daysOfWeek,
+             [locale objectForKey: NSWeekDayNameArray]);
+    }
+
+  return self;
+}
+
+- (void) dealloc
+{
+  [today release];
+  [item release];
+  [user release];
+  [userDefaults release];
+  [hours release];
+  [daysOfWeek release];
+  [super dealloc];
+}
+
+- (void) setItem: (NSString *) newItem
+{
+  ASSIGN (item, newItem);
+}
+
+- (NSString *) item
+{
+  return item;
+}
+
+- (NSString *) inTheOffice
+{
+  NSString *inTheOffice;
+
+  inTheOffice = [userDefaults objectForKey: @"InTheOffice"];
+
+  return ((!inTheOffice || [inTheOffice boolValue])
+         ? @"YES" : @"NO");
+}
+
+- (void) setInTheOffice: (NSString *) newValue
+{
+  [userDefaults setObject: newValue forKey: @"InTheOffice"];
+}
+
+- (void) setAutoReplyText: (NSString *) newAutoReplyText
+{
+  [userDefaults setObject: newAutoReplyText forKey: @"AutoReplyText"];
+}
+
+- (NSString *) autoReplyText
+{
+  return [userDefaults objectForKey: @"AutoReplyText"];
+}
+
+- (NSArray *) timeZonesList
+{
+  return [NSTimeZone knownTimeZoneNames];
+}
+
+- (NSString *) userTimeZone
+{
+  return [[user timeZone] timeZoneName];
+}
+
+- (void) setUserTimeZone: (NSString *) newUserTimeZone
+{
+  [userDefaults setObject: newUserTimeZone forKey: @"TimeZone"];
+}
+
+- (NSArray *) shortDateFormatsList
+{
+  NSMutableArray *shortDateFormatsList = nil;
+  NSString *key, *currentFormat;
+  unsigned int nbr;
+  BOOL done;
+
+  shortDateFormatsList = [NSMutableArray array];
+
+  nbr = 0;
+  done = NO;
+  while (!done)
+    {
+      key = [NSString stringWithFormat: @"shortDateFmt_%d", nbr];
+      currentFormat = [self labelForKey: key];
+      if ([currentFormat length] > 0)
+       {
+         [shortDateFormatsList addObject: currentFormat];
+         nbr++;
+       }
+      else
+       done = YES;
+    }
+
+  return shortDateFormatsList;
+}
+
+- (NSString *) itemShortDateFormatText
+{
+  return [today descriptionWithCalendarFormat: item
+               locale: [context valueForKey: @"locale"]];
+}
+
+- (NSString *) userShortDateFormat
+{
+  return [userDefaults objectForKey: @"ShortDateFormat"];
+}
+
+- (void) setUserShortDateFormat: (NSString *) newFormat
+{
+  [userDefaults setObject: newFormat forKey: @"ShortDateFormat"];
+}
+
+- (NSArray *) longDateFormatsList
+{
+  NSMutableArray *longDateFormatsList = nil;
+  NSString *key, *currentFormat;
+  unsigned int nbr;
+  BOOL done;
+
+  longDateFormatsList = [NSMutableArray array];
+
+  nbr = 0;
+  done = NO;
+  while (!done)
+    {
+      key = [NSString stringWithFormat: @"longDateFmt_%d", nbr];
+      currentFormat = [self labelForKey: key];
+      if ([currentFormat length] > 0)
+       {
+         [longDateFormatsList addObject: currentFormat];
+         nbr++;
+       }
+      else
+       done = YES;
+    }
+
+  return longDateFormatsList;
+}
+
+- (NSString *) itemLongDateFormatText
+{
+  return [today descriptionWithCalendarFormat: item
+               locale: [context valueForKey: @"locale"]];
+}
+
+- (NSString *) userLongDateFormat
+{
+  return [userDefaults objectForKey: @"LongDateFormat"];
+}
+
+- (void) setUserLongDateFormat: (NSString *) newFormat
+{
+  [userDefaults setObject: newFormat forKey: @"LongDateFormat"];
+}
+
+- (NSArray *) timeFormatsList
+{
+  NSMutableArray *timeFormatsList = nil;
+  NSString *key, *currentFormat;
+  unsigned int nbr;
+  BOOL done;
+
+  timeFormatsList = [NSMutableArray array];
+
+  nbr = 0;
+  done = NO;
+  while (!done)
+    {
+      key = [NSString stringWithFormat: @"timeFmt_%d", nbr];
+      currentFormat = [self labelForKey: key];
+      if ([currentFormat length] > 0)
+       {
+         [timeFormatsList addObject: currentFormat];
+         nbr++;
+       }
+      else
+       done = YES;
+    }
+
+  return timeFormatsList;
+}
+
+- (NSString *) itemTimeFormatText
+{
+  return [today descriptionWithCalendarFormat: item
+               locale: [context valueForKey: @"locale"]];
+}
+
+- (NSString *) userTimeFormat
+{
+  return [userDefaults objectForKey: @"TimeFormat"];
+}
+
+- (void) setUserTimeFormat: (NSString *) newFormat
+{
+  [userDefaults setObject: newFormat forKey: @"TimeFormat"];
+}
+
+- (NSArray *) daysList
+{
+  NSMutableArray *daysList;
+  unsigned int currentDay;
+
+  daysList = [NSMutableArray new];
+  [daysList autorelease];
+  for (currentDay = 0; currentDay < 7; currentDay++)
+    [daysList addObject: [NSString stringWithFormat: @"%d", currentDay]];
+
+  return daysList;
+}
+
+- (NSString *) itemWeekStartDay
+{
+  return [daysOfWeek objectAtIndex: [item intValue]];
+}
+
+- (NSString *) userWeekStartDay
+{
+  return [userDefaults objectForKey: @"WeekStartDay"];
+}
+
+- (void) setUserWeekStartDay: (NSString *) newDay
+{
+  [userDefaults setObject: newDay forKey: @"WeekStartDay"];
+}
+
+- (NSArray *) hoursList
+{
+  unsigned int currentHour;
+
+  if (!hours)
+    {
+      hours = [[NSMutableArray alloc] initWithCapacity: 24];
+      for (currentHour = 0; currentHour < 24; currentHour++)
+       [hours addObject: [NSString stringWithFormat: @"%.2d:00",
+                                   currentHour]];
+    }
+
+  return hours;
+}
+
+- (NSString *) userDayStartTime
+{
+  NSString *time;
+
+  time = [userDefaults objectForKey: @"DayStartTime"];
+  if (!time)
+    time = @"08:00";
+
+  return time;
+}
+
+- (void) setUserDayStartTime: (NSString *) newTime
+{
+  [userDefaults setObject: newTime forKey: @"DayStartTime"];
+}
+
+- (NSString *) userDayEndTime
+{
+  NSString *time;
+
+  time = [userDefaults objectForKey: @"DayEndTime"];
+  if (!time)
+    time = @"18:00";
+
+  return time;
+}
+
+- (void) setUserDayEndTime: (NSString *) newTime
+{
+  [userDefaults setObject: newTime forKey: @"DayEndTime"];
+}
+
+- (NSArray *) firstWeekList
+{
+  return [NSArray arrayWithObjects: SOGoWeekStartHideWeekNumbers,
+                 SOGoWeekStartJanuary1,
+                 SOGoWeekStartFirst4DayWeek,
+                 SOGoWeekStartFirstFullWeek, nil];
+}
+
+- (NSString *) itemFirstWeekText
+{
+  return [self labelForKey: [NSString stringWithFormat: @"firstWeekOfYear_%@",
+                                     item]];
+}
+
+- (NSString *) userFirstWeek
+{
+  return [userDefaults objectForKey: @"FirstWeek"];
+}
+
+- (void) setUserFirstWeek: (NSString *) newFirstWeek
+{
+  [userDefaults setObject: newFirstWeek forKey: @"FirstWeek"];
+}
+
+- (NSString *) reminderEnabled
+{
+  NSString *reminderEnabled;
+
+  reminderEnabled = [userDefaults objectForKey: @"ReminderEnabled"];
+
+  return ((!reminderEnabled || [reminderEnabled boolValue])
+         ? @"YES" : @"NO");
+}
+
+- (void) setReminderEnabled: (NSString *) newValue
+{
+  [userDefaults setObject: newValue forKey: @"ReminderEnabled"];
+}
+
+- (NSString *) remindWithASound
+{
+  NSString *remindWithASound;
+
+  remindWithASound = [userDefaults objectForKey: @"RemindWithASound"];
+
+  return ((!remindWithASound || [remindWithASound boolValue])
+         ? @"YES" : @"NO");
+}
+
+- (void) setRemindWithASound: (NSString *) newValue
+{
+  [userDefaults setObject: newValue forKey: @"RemindWithASound"];
+}
+
+- (NSArray *) reminderTimesList
+{
+  return [NSArray arrayWithObjects: @"0000", @"0005", @"0010", @"0015",
+                 @"0030", @"0100", @"0200", @"0400", @"0800", @"1200",
+                 @"2400", @"4800", nil];
+}
+
+- (NSString *) itemReminderTimeText
+{
+  return [self labelForKey:
+                [NSString stringWithFormat: @"reminderTime_%@", item]];
+}
+
+- (NSString *) userReminderTime
+{
+  return [userDefaults objectForKey: @"ReminderTime"];
+}
+
+- (void) setReminderTime: (NSString *) newTime
+{
+  [userDefaults setObject: newTime forKey: @"ReminderTime"];
+}
+
+- (id <WOActionResults>) defaultAction
+{
+  id <WOActionResults> results;
+  WORequest *request;
+
+  request = [context request];
+  if ([[request method] isEqualToString: @"POST"])
+    {
+      [userDefaults synchronize];
+      results = [self jsCloseWithRefreshMethod: nil];
+    }
+  else
+    results = self;
+
+  return results;
+}
+
+- (BOOL) shouldTakeValuesFromRequest: (WORequest *) request
+                           inContext: (WOContext*) context
+{
+  return [[request method] isEqualToString: @"POST"];
+}
+
+@end
diff --git a/UI/PreferencesUI/Version b/UI/PreferencesUI/Version
new file mode 100644 (file)
index 0000000..b2a4ba5
--- /dev/null
@@ -0,0 +1 @@
+# nothing here
diff --git a/UI/PreferencesUI/product.plist b/UI/PreferencesUI/product.plist
new file mode 100644 (file)
index 0000000..de4a1d9
--- /dev/null
@@ -0,0 +1,36 @@
+{ /* -*-javascript-*- */
+  requires = ( MAIN, MainUI, CommonUI );
+
+  publicResources = (
+  );
+
+  factories = {
+  };
+
+  categories = {
+     SOGoUserFolder = {
+       slots = {
+          toolbar = {
+             protectedBy = "View";
+             value = "UIxPreferences.toolbar";
+          };
+       };
+       methods = {
+          preferences = {
+             protectedBy = "View";
+             pageName = "UIxPreferences";
+          };
+          jsonDefaults = {
+             protectedBy = "View";
+             actionClass = "UIxJSONPreferences";
+             actionName = "jsonDefaults";
+          };
+          jsonSettings = {
+             protectedBy = "View";
+             actionClass = "UIxJSONPreferences";
+             actionName = "jsonSettings";
+          };
+       };
+     };
+  };
+}
index 172d94a320dcaed866467945072db9d372c9589e..554741b55b6eed9173ccd8bad5aa631dd52160e6 100644 (file)
@@ -16,7 +16,6 @@ libSOGoUI_HEADER_FILES +=     \
        \
        UIxJSClose.h            \
        UIxComponent.h          \
-       SOGoDateFormatter.h     \
        SOGoAptFormatter.h      \
        SOGoJSStringFormatter.h \
        WOContext+UIx.h         \
@@ -25,7 +24,6 @@ libSOGoUI_OBJC_FILES +=               \
        \
        UIxJSClose.m            \
        UIxComponent.m          \
-       SOGoDateFormatter.m     \
        SOGoAptFormatter.m      \
        SOGoJSStringFormatter.m \
        WOContext+UIx.m         \
diff --git a/UI/SOGoUI/SOGoDateFormatter.h b/UI/SOGoUI/SOGoDateFormatter.h
deleted file mode 100644 (file)
index 2e08484..0000000
+++ /dev/null
@@ -1,56 +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.
-*/
-
-#ifndef        __SOGoDateFormatter_H_
-#define        __SOGoDateFormatter_H_
-
-#import <Foundation/NSFormatter.h>
-
-@class NSString, NSCalendarDate, NSDictionary;
-
-@interface SOGoDateFormatter : NSFormatter
-{
-    NSDictionary *locale;
-    SEL formatAction;
-    SEL auxFormatAction;
-}
-
-- (id)initWithLocale:(NSDictionary *)_locale;
-
-- (void)setISODateFormat;
-- (void)setFrenchDateFormat;
-
-- (void)setFullWeekdayNameAndDetails;
-
-- (NSString *)stringForObjectValue:(id)_obj;
-- (NSString *) stringForSecondsSinceThe70s: (unsigned int) seconds;
-
-- (NSString *)shortDayOfWeek:(int)_day;
-- (NSString *)fullDayOfWeek:(int)_day;
-- (NSString *)shortMonthOfYear:(int)_month;
-- (NSString *)fullMonthOfYear:(int)_month;
-
-- (NSString *)isoDateFormatForDate:(NSCalendarDate *)_date;
-- (NSString *)fullWeekdayNameAndDetailsForDate:(NSCalendarDate *)_date;
-
-@end
-
-#endif /* __SOGoDateFormatter_H_ */
diff --git a/UI/SOGoUI/SOGoDateFormatter.m b/UI/SOGoUI/SOGoDateFormatter.m
deleted file mode 100644 (file)
index c618be4..0000000
+++ /dev/null
@@ -1,134 +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.
-*/
-
-#include "SOGoDateFormatter.h"
-#include "common.h"
-
-@implementation SOGoDateFormatter
-
-- (id)initWithLocale:(NSDictionary *)_locale {
-  if ((self = [super init])) {
-    self->locale = [_locale retain];
-    
-    if ([[self->locale objectForKey:@"NSLocaleCode"] isEqualToString:@"fr"])
-      [self setFrenchDateFormat];
-    else
-      [self setISODateFormat];
-  }
-  return self;
-}
-
-- (void)dealloc {
-  [self->locale release];
-  [super dealloc];
-}
-
-/* accessors */
-
-- (void)setISODateFormat {
-  self->formatAction = @selector(isoDateFormatForDate:);
-}
-
-- (void)setFrenchDateFormat {
-  self->formatAction = @selector(frenchDateFormatForDate:);
-}
-
-- (void)setFullWeekdayNameAndDetails {
-  self->auxFormatAction = self->formatAction;
-  self->formatAction    = @selector(fullWeekdayNameAndDetailsForDate:);
-}
-
-/* operation */
-
-- (NSString *) stringForObjectValue: (id) _obj
-{
-  return [self performSelector:self->formatAction
-              withObject:_obj];
-}
-
-- (NSString *) stringForSecondsSinceThe70s: (unsigned int) seconds
-{
-  return [self stringForObjectValue:
-                [NSCalendarDate dateWithTimeIntervalSince1970: seconds]];
-}
-
-/* Helpers */
-
-- (NSString *)shortDayOfWeek:(int)_day {
-  return [[self->locale objectForKey:@"NSShortWeekDayNameArray"]
-          objectAtIndex:_day];
-}
-
-- (NSString *)fullDayOfWeek:(int)_day {
-  return [[self->locale objectForKey:@"NSWeekDayNameArray"]
-          objectAtIndex:_day];
-}
-
-- (NSString *)shortMonthOfYear:(int)_month {
-  return [[self->locale objectForKey:@"NSShortMonthNameArray"]
-          objectAtIndex:_month - 1];
-}
-
-- (NSString *)fullMonthOfYear:(int)_month {
-  return [[self->locale objectForKey:@"NSMonthNameArray"]
-          objectAtIndex:_month - 1];
-}
-
-
-/* Private API */
-
-- (NSString *)isoDateFormatForDate:(NSCalendarDate *)_date {
-  char buf[16];
-  
-  if (_date == nil) return nil;
-  snprintf(buf, sizeof(buf), 
-          "%04d-%02d-%02d",
-          [_date yearOfCommonEra], [_date monthOfYear], [_date dayOfMonth]);
-  return [NSString stringWithCString:buf];
-}
-
-- (NSString *)frenchDateFormatForDate:(NSCalendarDate *)_date {
-  char buf[16];
-  
-  if (_date == nil) return nil;
-  snprintf(buf, sizeof(buf), 
-          "%02d/%02d/%04d",
-          [_date dayOfMonth], [_date monthOfYear], [_date yearOfCommonEra]);
-  return [NSString stringWithCString:buf];
-}
-
-- (NSString *)fullWeekdayNameAndDetailsForDate:(NSCalendarDate *)_date {
-  NSMutableString *desc;
-  
-  if (_date == nil) return nil;
-  
-  desc = [NSMutableString stringWithCapacity:24];
-  [desc appendString:[self fullDayOfWeek:[_date dayOfWeek]]];
-  [desc appendString:@", "];
-  [desc appendString:[self performSelector:self->auxFormatAction
-                           withObject:_date]];
-  [desc appendString:@" "];
-  [desc appendFormat:@"%02d:%02d ", [_date hourOfDay], [_date minuteOfHour]];
-  [desc appendString:[[_date timeZone] abbreviation]];
-  return desc;
-}
-
-@end /* SOGoDateFormatter */
index b8f79463a7ff574dd79d2d40065d87217397aa20..c03fc476bdb0e21dfb0cfc23b8157d8175d9f291 100644 (file)
@@ -33,10 +33,8 @@ SchedulerUI_OBJC_FILES =             \
        UIxAttendeesEditor.m            \
        UIxComponentEditor.m            \
        UIxCalendarSelector.m           \
-       UIxAppointmentView.m            \
        UIxAppointmentEditor.m          \
        UIxAppointmentProposal.m        \
-       UIxTaskView.m           \
        UIxTaskEditor.m         \
        UIxTaskProposal.m       \
        UIxCalDateLabel.m               \
diff --git a/UI/Scheduler/UIxAppointmentView.h b/UI/Scheduler/UIxAppointmentView.h
deleted file mode 100644 (file)
index f1d2378..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-// $Id$
-
-#ifndef __SOGo_UIxAppointmentView_H__
-#define __SOGo_UIxAppointmentView_H__
-
-#include <SOGoUI/UIxComponent.h>
-
-@class NSCalendarDate;
-@class iCalEvent;
-@class iCalPerson;
-@class SOGoDateFormatter;
-
-@interface UIxAppointmentView : UIxComponent
-{
-  iCalEvent* appointment;
-  iCalPerson* attendee;
-  SOGoDateFormatter *dateFormatter;
-  id item;
-}
-
-- (iCalEvent *) appointment;
-
-/* permissions */
-- (BOOL) canAccessApt;
-- (BOOL) canEditApt;
-  
-- (SOGoDateFormatter *) dateFormatter;
-- (NSCalendarDate *) startTime;
-- (NSCalendarDate *) endTime;
-  
-- (NSString *) attributesTabLink;
-- (NSString *) participantsTabLink;
-
-- (NSString *) completeHrefForMethod: (NSString *) _method
-                      withParameter: (NSString *) _param
-                             forKey: (NSString *) _key;
-
-@end
-
-#endif /* __SOGo_UIxAppointmentView_H__ */
diff --git a/UI/Scheduler/UIxAppointmentView.m b/UI/Scheduler/UIxAppointmentView.m
deleted file mode 100644 (file)
index 4814f71..0000000
+++ /dev/null
@@ -1,292 +0,0 @@
-/*
-  Copyright (C) 2004-2005 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.
-*/
-
-#import "UIxAppointmentView.h"
-#import <NGCards/NGCards.h>
-#import <SOGo/WOContext+Agenor.h>
-#import <SOGo/SOGoUser.h>
-#import <Appointments/SOGoAppointmentObject.h>
-#import <SOGoUI/SOGoDateFormatter.h>
-#import "UIxComponent+Scheduler.h"
-#import "common.h"
-
-@interface UIxAppointmentView (PrivateAPI)
-- (BOOL)isAttendeeActiveUser;
-@end
-
-@implementation UIxAppointmentView
-
-- (void)dealloc {
-  [appointment   release];
-  [attendee      release];
-  [dateFormatter release];
-  [item          release];
-  [super dealloc];
-}
-
-/* accessors */
-
-- (NSString *)tabSelection {
-  NSString *selection;
-    
-  selection = [self queryParameterForKey:@"tab"];
-  if (selection == nil)
-    selection = @"attributes";
-  return selection;
-}
-
-- (void)setAttendee:(id)_attendee {
-  ASSIGN(attendee, _attendee);
-}
-- (id)attendee {
-  return attendee;
-}
-
-- (BOOL)isAttendeeActiveUser {
-  NSString *email, *attEmail;
-
-  email    = [[[self context] activeUser] primaryEmail];
-  attendee = [self attendee];
-  attEmail = [attendee rfc822Email];
-
-  return [email isEqualToString: attEmail];
-}
-
-- (BOOL)showAcceptButton {
-  return [[self attendee] participationStatus] != iCalPersonPartStatAccepted;
-}
-- (BOOL)showRejectButton {
-  return [[self attendee] participationStatus] != iCalPersonPartStatDeclined;
-}
-- (NSString *)attendeeStatusColspan {
-  return [self isAttendeeActiveUser] ? @"1" : @"2";
-}
-
-- (void)setItem:(id)_item {
-  ASSIGN(item, _item);
-}
-- (id)item {
-  return item;
-}
-
-- (SOGoDateFormatter *)dateFormatter {
-  if (dateFormatter == nil) {
-    dateFormatter =
-      [[SOGoDateFormatter alloc] initWithLocale:[self locale]];
-    [dateFormatter setFullWeekdayNameAndDetails];
-  }
-  return dateFormatter;
-}
-
-- (NSCalendarDate *)startTime {
-  NSCalendarDate *date;
-  NSTimeZone *timeZone;
-
-  timeZone = [[context activeUser] timeZone];
-  date = [[self appointment] startDate];
-  [date setTimeZone: timeZone];
-
-  return date;
-}
-
-- (NSCalendarDate *)endTime {
-  NSCalendarDate *date;
-  NSTimeZone *timeZone;
-
-  timeZone = [[context activeUser] timeZone];
-  date = [[self appointment] endDate];
-  [date setTimeZone: timeZone];
-
-  return date;
-}
-
-- (NSString *)resourcesAsString {
-  NSArray *resources, *cns;
-
-  resources = [[self appointment] resources];
-  cns = [resources valueForKey:@"cnForDisplay"];
-  return [cns componentsJoinedByString:@"<br />"];
-}
-
-- (NSString *) categoriesAsString
-{
-  NSEnumerator *categories;
-  NSArray *rawCategories;
-  NSMutableArray *l10nCategories;
-  NSString *currentCategory, *l10nCategory;
-
-  rawCategories
-    = [[appointment categories] componentsSeparatedByString: @","];
-  l10nCategories = [NSMutableArray arrayWithCapacity: [rawCategories count]];
-  categories = [rawCategories objectEnumerator];
-  currentCategory = [categories nextObject];
-  while (currentCategory)
-    {
-      l10nCategory
-        = [self labelForKey: [currentCategory stringByTrimmingSpaces]];
-      if (l10nCategory)
-        [l10nCategories addObject: l10nCategory];
-      currentCategory = [categories nextObject];
-    }
-
-  return [l10nCategories componentsJoinedByString: @", "];
-}
-
-// appointment.organizer.cnForDisplay
-- (NSString *) eventOrganizer
-{
-  CardElement *organizer;
-
-  organizer = [[self appointment] uniqueChildWithTag: @"organizer"];
-
-  return [organizer value: 0 ofAttribute: @"cn"];
-}
-
-- (NSString *) priorityLabelKey
-{
-  return [NSString stringWithFormat: @"prio_%@", [appointment priority]];
-}
-
-/* backend */
-
-- (iCalEvent *) appointment
-{
-  SOGoAppointmentObject *clientObject;
-
-  if (!appointment)
-    {
-      clientObject = [self clientObject];
-      appointment = (iCalEvent *) [clientObject component: NO];
-      [appointment retain];
-    }
-
-  return appointment;
-}
-
-/* hrefs */
-
-- (NSString *)attributesTabLink {
-  return [self completeHrefForMethod:[self ownMethodName]
-              withParameter:@"attributes"
-              forKey:@"tab"];
-}
-
-- (NSString *)participantsTabLink {
-    return [self completeHrefForMethod:[self ownMethodName]
-                 withParameter:@"participants"
-                 forKey:@"tab"];
-}
-
-- (NSString *)debugTabLink {
-  return [self completeHrefForMethod:[self ownMethodName]
-              withParameter:@"debug"
-              forKey:@"tab"];
-}
-
-- (NSString *)completeHrefForMethod:(NSString *)_method
-  withParameter:(NSString *)_param
-  forKey:(NSString *)_key
-{
-  NSString *href;
-
-  [self setQueryParameter:_param forKey:_key];
-  href = [self completeHrefForMethod:[self ownMethodName]];
-  [self setQueryParameter:nil forKey:_key];
-  return href;
-}
-
-
-/* access */
-
-- (BOOL)isMyApt {
-  NSString   *email;
-  iCalPerson *organizer;
-
-  email     = [[[self context] activeUser] primaryEmail];
-  organizer = [[self appointment] organizer];
-  if (!organizer) return YES; // assume this is correct to do, right?
-  return [[organizer rfc822Email] isEqualToString:email];
-}
-
-- (BOOL)canAccessApt {
-  NSString *email;
-  NSArray  *partMails;
-
-  if ([self isMyApt])
-    return YES;
-  
-  /* not my apt - can access if it's public */
-  if ([[[self appointment] accessClass] isEqualToString: @"PUBLIC"])
-    return YES;
-
-  /* can access it if I'm invited :-) */
-  email     = [[[self context] activeUser] primaryEmail];
-  partMails = [[[self appointment] participants] valueForKey:@"rfc822Email"];
-  return [partMails containsObject:email];
-}
-
-- (BOOL)canEditApt {
-  return [self isMyApt];
-}
-
-
-/* action */
-
-- (id<WOActionResults>)defaultAction {
-  if ([self appointment] == nil) {
-    return [NSException exceptionWithHTTPStatus:404 /* Not Found */
-                       reason:@"could not locate appointment"];
-  }
-  
-  return self;
-}
-
-- (BOOL)isDeletableClientObject {
-  return [[self clientObject] respondsToSelector:@selector(delete)];
-}
-
-- (id)deleteAction {
-  NSException *ex;
-  id url;
-
-  if ([self appointment] == nil) {
-    return [NSException exceptionWithHTTPStatus:404 /* Not Found */
-                       reason:@"could not locate appointment"];
-  }
-
-  if (![self isDeletableClientObject]) {
-    /* return 400 == Bad Request */
-    return [NSException exceptionWithHTTPStatus:400
-                        reason:@"method cannot be invoked on "
-                               @"the specified object"];
-  }
-  
-  if ((ex = [[self clientObject] delete]) != nil) {
-    // TODO: improve error handling
-    [self debugWithFormat:@"failed to delete: %@", ex];
-    return ex;
-  }
-  
-  url = [[[self clientObject] container] baseURLInContext:[self context]];
-  return [self redirectToLocation:url];
-}
-
-@end /* UIxAppointmentView */
index 37f6364d6165f6455c38819280d3393df5a65f4e..cc5598e4550bd314eb4fc1008753f43eedcfc8c5 100644 (file)
 
 @interface UIxCalDayTable : UIxCalView
 {
-  SOGoDateFormatter *dateFormatter;
   int numberOfDays;
   NSCalendarDate *startDate;
   NSCalendarDate *currentTableDay;
   NSString *currentTableHour;
   NSMutableArray *daysToDisplay;
   NSMutableArray *hoursToDisplay;
-
-  NSString *cssClass;
-  NSString *cssId;
+  NSArray *weekDays;
+  SOGoDateFormatter *dateFormatter;
 }
 
-- (void) setCSSClass: (NSString *) aCssClass;
-- (NSString *) cssClass;
-
-- (void) setCSSId: (NSString *) aCssId;
-- (NSString *) cssId;
-
 - (void) setNumberOfDays: (NSString *) aNumber;
 - (NSString *) numberOfDays;
 
index aac4cf73f16c442932e8845f7bd256310357ba2a..3c5a35e6f660fc15671ed6c0806baf42928e3243 100644 (file)
 #import <Foundation/NSDictionary.h>
 #import <Foundation/NSKeyValueCoding.h>
 #import <Foundation/NSString.h>
+#import <Foundation/NSUserDefaults.h>
 
+#import <NGExtensions/NSCalendarDate+misc.h>
 #import <EOControl/EOQualifier.h>
 
-#import <NGExtensions/NSCalendarDate+misc.h>
-#import <SOGoUI/SOGoDateFormatter.h>
+#import <SoObjects/SOGo/SOGoDateFormatter.h>
+#import <SoObjects/SOGo/SOGoUser.h>
 
 #import "UIxCalDayTable.h"
 
 {
   if ((self = [super init]))
     {
-//       allAppointments = nil;
       daysToDisplay = nil;
       hoursToDisplay = nil;
       numberOfDays = 1;
       startDate = nil;
       currentTableDay = nil;
       currentTableHour = nil;
-      dateFormatter = [[SOGoDateFormatter alloc]
-                        initWithLocale: [self locale]];
+      weekDays = [[context valueForKey: @"locale"] objectForKey: NSShortWeekDayNameArray];
+      [weekDays retain];
+      dateFormatter = [[context activeUser] dateFormatterInContext: context];
     }
 
   return self;
 {
 //   if (allAppointments)
 //     [allAppointments release];
+  [weekDays release];
   [daysToDisplay release];
   [hoursToDisplay release];
-  [dateFormatter release];
   [super dealloc];
 }
 
-- (void) setCSSClass: (NSString *) aCssClass
-{
-  cssClass = aCssClass;
-}
-
-- (NSString *) cssClass
-{
-  return cssClass;
-}
-
-- (void) setCSSId: (NSString *) aCssId
-{
-  cssId = aCssId;
-}
-
-- (NSString *) cssId
-{
-  return cssId;
-}
-
 - (void) setNumberOfDays: (NSString *) aNumber
 {
   numberOfDays = [aNumber intValue];
 
 - (NSString *) labelForDay
 {
-  return [dateFormatter shortDayOfWeek: [currentTableDay dayOfWeek]];
+  return [weekDays objectAtIndex: [currentTableDay dayOfWeek]];
 }
 
 - (NSString *) labelForDate
 {
-  return [dateFormatter stringForObjectValue: currentTableDay];
+  return [dateFormatter shortFormattedDate: currentTableDay];
 }
 
 // - (NSDictionary *) _adjustedAppointment: (NSDictionary *) anAppointment
index ed455673f7eee992cdb474f7e7369beaa6df3286..7ef811d3d04d602d6e525ac4b175620d2f341aca 100644 (file)
@@ -44,6 +44,7 @@
   NSString *userLogin;
   WORequest *request;
   SOGoDateFormatter *dateFormatter;
+  NSTimeZone *userTimeZone;
 }
 
 - (WOResponse *) eventsListAction;
index d946a13daf18ee8d37489d29bffb22baa4b1fb86..bcbb66bcd78c9b33931361bd4d20ea11581f53e5 100644 (file)
 #import <NGExtensions/NSCalendarDate+misc.h>
 
 #import <SoObjects/SOGo/SOGoUser.h>
+#import <SoObjects/SOGo/SOGoDateFormatter.h>
 #import <SoObjects/SOGo/NSCalendarDate+SOGo.h>
 #import <SoObjects/SOGo/NSArray+Utilities.h>
 #import <SoObjects/SOGo/NSObject+Utilities.h>
 #import <SoObjects/Appointments/SOGoAppointmentFolder.h>
 
-#import "../SOGoUI/SOGoDateFormatter.h"
 #import "NSArray+Scheduler.h"
 
 #import "UIxCalListingActions.h"
@@ -47,7 +47,7 @@
 
 - (id) initWithRequest: (WORequest *) newRequest
 {
-  NSDictionary *locale;
+  SOGoUser *user;
 
   if ((self = [super initWithRequest: newRequest]))
     {
@@ -55,9 +55,9 @@
       startDate = nil;
       endDate = nil;
       ASSIGN (request, newRequest);
-      locale = [[self context] valueForKey: @"locale"];
-      dateFormatter = [[SOGoDateFormatter alloc] initWithLocale: locale];
-      [dateFormatter setFullWeekdayNameAndDetails];
+      user = [[self context] activeUser];
+      dateFormatter = [user dateFormatterInContext: context];
+      ASSIGN (userTimeZone, [user timeZone]);
     }
 
   return self;
@@ -70,6 +70,7 @@
   [componentsData release];
   [startDate release];
   [endDate release];
+  [userTimeZone release];
   [super dealloc];
 }
 
   return response;
 }
 
+- (NSString *) _formattedDateForSeconds: (unsigned int) seconds
+                             forAllDay: (BOOL) forAllDay
+{
+  NSCalendarDate *date;
+  NSString *formattedDate;
+
+  date = [NSCalendarDate dateWithTimeIntervalSince1970: seconds];
+  [date setTimeZone: userTimeZone];
+  if (forAllDay)
+    formattedDate = [dateFormatter formattedDate: date];
+  else
+    formattedDate = [dateFormatter formattedDateAndTime: date];
+
+  return formattedDate;    
+}
+
 - (WOResponse *) eventsListAction
 {
   NSArray *fields, *oldEvent;
   NSEnumerator *events;
-  NSString *date;
   NSMutableArray *newEvents, *newEvent;
   unsigned int interval;
+  BOOL isAllDay;
 
   [self _setupContext];
 
   while (oldEvent)
     {
       newEvent = [NSMutableArray arrayWithArray: oldEvent];
+      isAllDay = [[oldEvent objectAtIndex: 7] boolValue];
       interval = [[oldEvent objectAtIndex: 4] intValue];
-      date = [dateFormatter stringForSecondsSinceThe70s: interval];
-      [newEvent addObject: date];
+      [newEvent addObject: [self _formattedDateForSeconds: interval
+                                forAllDay: isAllDay]];
       interval = [[oldEvent objectAtIndex: 5] intValue];
-      date = [dateFormatter stringForSecondsSinceThe70s: interval];
-      [newEvent addObject: date];
+      [newEvent addObject: [self _formattedDateForSeconds: interval
+                                forAllDay: isAllDay]];
       [newEvents addObject: newEvent];
 
       oldEvent = [events nextObject];
index 48190556cbdcedd1bf5784b812a0c54284d00bf0..830c17cac0e794a92798341f23508cb90c7b97bd 100644 (file)
@@ -44,6 +44,9 @@
   NSArray *daysToDisplay;
   NSCalendarDate *currentTableDay;
   NSArray *currentTableColumn;
+
+  NSArray *dayNames;
+  NSArray *monthNames;
 }
 
 - (NSDictionary *) monthBeforePrevMonthQueryParameters;
index 9f30766506cd94cca9975bf483af78a07dab0301..0bd425d98e59afa1d4b527e36f74b68c7ccb860d 100644 (file)
 
 - (id) init
 {
+  NSDictionary *locale;
+
   if ((self = [super init]))
     {
-      monthAptFormatter
-        = [[SOGoAptFormatter alloc] initWithDisplayTimeZone: timeZone];
-      [monthAptFormatter setShortMonthTitleOnly];
-      dateFormatter = [[SOGoDateFormatter alloc]
-                        initWithLocale: [self locale]];
+//       monthAptFormatter
+//         = [[SOGoAptFormatter alloc] initWithDisplayTimeZone: timeZone];
+//       [monthAptFormatter setShortMonthTitleOnly];
+//       dateFormatter = [[SOGoDateFormatter alloc]
+//                         initWithLocale: [self locale]];
+      locale = [context valueForKey: @"locale"];
+      dayNames = [locale objectForKey: NSWeekDayNameArray];
+      [dayNames retain];
+      monthNames = [locale objectForKey: NSMonthNameArray];
+      [monthNames retain];
       sortedAppointments = [NSMutableDictionary new];
       daysToDisplay = nil;
     }
   return self;
 }
 
-- (SOGoAptFormatter *) monthAptFormatter
-{
-  return monthAptFormatter;
-}
+// - (SOGoAptFormatter *) monthAptFormatter
+// {
+//   return monthAptFormatter;
+// }
 
 - (void) dealloc
 {
+  [monthNames release];
+  [dayNames release];
   [daysToDisplay release];
-  [monthAptFormatter release];
-  [dateFormatter release];
+//   [monthAptFormatter release];
+//   [dateFormatter release];
   [sortedAppointments release];
   [super dealloc];
 }
 
 - (NSString *) labelForCurrentDayToDisplay
 {
-  return [dateFormatter fullDayOfWeek: [currentTableDay dayOfWeek]];
+  return [dayNames objectAtIndex: [currentTableDay dayOfWeek]];
 }
 
 - (NSDictionary *) _dateQueryParametersWithOffset: (int) monthsOffset
       || [currentTableDay isDateOnSameDay: lastDayOfMonth])
     {
       monthOfYear
-        = [dateFormatter shortMonthOfYear: [currentTableDay monthOfYear]];
+        = [monthNames objectAtIndex: [currentTableDay monthOfYear]];
       label = [NSString stringWithFormat: @"%d %@", dayOfMonth, monthOfYear];
     }
   else
index 087fc1f0f0b6119e637c7f3da9b2173b296d1823..71c511a6ed43cbd2f483bc82440b164cc27dc9dd 100644 (file)
@@ -28,7 +28,6 @@
 @class NSArray;
 @class NSCalendarDate;
 @class NSDictionary;
-@class NSFormatter;
 @class NSString;
 
 @class iCalPerson;
 - (BOOL) canEditComponent;
 
 /* helpers */
-- (NSFormatter *) titleDateFormatter;
 - (NSString *) completeURIForMethod: (NSString *) _method;
 - (BOOL) isWriteableClientObject;
 - (NSException *) validateObjectForStatusChange;
index d81be97153a3106e39ee79ee9b5d0c11e91c23ff..08ef20929f68b0aa5af8a5d43c9af3f5c42b553b 100644 (file)
@@ -41,7 +41,6 @@
 #import <NGExtensions/NSObject+Logs.h>
 #import <NGExtensions/NSString+misc.h>
 
-#import <UI/SOGoUI/SOGoDateFormatter.h>
 #import <SoObjects/Appointments/SOGoAppointmentFolder.h>
 #import <SoObjects/Appointments/SOGoAppointmentObject.h>
 #import <SoObjects/Appointments/SOGoTaskObject.h>
 }
 
 /* helpers */
-- (NSFormatter *) titleDateFormatter
-{
-  SOGoDateFormatter *fmt;
-  
-  fmt = [[SOGoDateFormatter alloc] initWithLocale: [self locale]];
-  [fmt autorelease];
-  [fmt setFullWeekdayNameAndDetails];
-
-  return fmt;
-}
-
 - (NSString *) completeURIForMethod: (NSString *) _method
 {
   NSString *uri;
diff --git a/UI/Scheduler/UIxTaskView.h b/UI/Scheduler/UIxTaskView.h
deleted file mode 100644 (file)
index 51678d7..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-// $Id: UIxTaskView.h 768 2005-07-15 00:13:01Z helge $
-
-#ifndef __SOGo_UIxTaskView_H__
-#define __SOGo_UIxTaskView_H__
-
-#include <SOGoUI/UIxComponent.h>
-
-@class NSCalendarDate;
-@class iCalToDo;
-@class iCalPerson;
-@class SOGoDateFormatter;
-
-@interface UIxTaskView : UIxComponent
-{
-  iCalToDo* task;
-  iCalPerson* attendee;
-  SOGoDateFormatter *dateFormatter;
-  id item;
-}
-
-- (iCalToDo *) task;
-
-/* permissions */
-- (BOOL)canAccessApt;
-- (BOOL)canEditApt;
-  
-- (SOGoDateFormatter *)dateFormatter;
-- (NSCalendarDate *)startTime;
-- (NSCalendarDate *)endTime;
-  
-- (NSString *)attributesTabLink;
-- (NSString *)participantsTabLink;
-
-- (NSString *)completeHrefForMethod:(NSString *)_method
-  withParameter:(NSString *)_param
-  forKey:(NSString *)_key;
-
-@end
-
-#endif /* __SOGo_UIxTaskView_H__ */
diff --git a/UI/Scheduler/UIxTaskView.m b/UI/Scheduler/UIxTaskView.m
deleted file mode 100644 (file)
index 0af8140..0000000
+++ /dev/null
@@ -1,294 +0,0 @@
-/*
-  Copyright (C) 2004-2005 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.
-*/
-
-#import "UIxTaskView.h"
-#import <NGCards/NGCards.h>
-#import <SOGo/WOContext+Agenor.h>
-#import <SOGo/SOGoUser.h>
-#import <Appointments/SOGoTaskObject.h>
-#import <SOGoUI/SOGoDateFormatter.h>
-#import "UIxComponent+Scheduler.h"
-#import "common.h"
-
-@interface UIxTaskView (PrivateAPI)
-- (BOOL)isAttendeeActiveUser;
-@end
-
-@implementation UIxTaskView
-
-- (void)dealloc {
-  [task   release];
-  [attendee      release];
-  [dateFormatter release];
-  [item          release];
-  [super dealloc];
-}
-
-/* accessors */
-
-- (NSString *)tabSelection {
-  NSString *selection;
-    
-  selection = [self queryParameterForKey:@"tab"];
-  if (selection == nil)
-    selection = @"attributes";
-  return selection;
-}
-
-- (void)setAttendee:(id)_attendee {
-  ASSIGN(attendee, _attendee);
-}
-- (id)attendee {
-  return attendee;
-}
-
-- (BOOL)isAttendeeActiveUser {
-  NSString *email, *attEmail;
-
-  email    = [[[self context] activeUser] primaryEmail];
-  attendee = [self attendee];
-  attEmail = [attendee rfc822Email];
-
-  return [email isEqualToString: attEmail];
-}
-
-- (BOOL)showAcceptButton {
-  return [[self attendee] participationStatus] != iCalPersonPartStatAccepted;
-}
-- (BOOL)showRejectButton {
-  return [[self attendee] participationStatus] != iCalPersonPartStatDeclined;
-}
-- (NSString *)attendeeStatusColspan {
-  return [self isAttendeeActiveUser] ? @"1" : @"2";
-}
-
-- (void)setItem:(id)_item {
-  ASSIGN(item, _item);
-}
-- (id)item {
-  return item;
-}
-
-- (SOGoDateFormatter *)dateFormatter {
-  if (dateFormatter == nil) {
-    dateFormatter =
-      [[SOGoDateFormatter alloc] initWithLocale:[self locale]];
-    [dateFormatter setFullWeekdayNameAndDetails];
-  }
-  return dateFormatter;
-}
-
-- (NSCalendarDate *) startTime
-{
-  NSCalendarDate *date;
-  NSTimeZone *timeZone;
-
-  timeZone = [[context activeUser] timeZone];
-  date = [[self task] startDate];
-  [date setTimeZone: timeZone];
-
-  return date;
-}
-
-- (NSCalendarDate *) endTime
-{
-  NSCalendarDate *date;
-  NSTimeZone *timeZone;
-
-  timeZone = [[context activeUser] timeZone];
-  date = [[self task] due];
-  [date setTimeZone: timeZone];
-
-  return date;
-}
-
-- (NSString *)resourcesAsString {
-  NSArray *resources, *cns;
-
-  resources = [[self task] resources];
-  cns = [resources valueForKey:@"cnForDisplay"];
-  return [cns componentsJoinedByString:@"<br />"];
-}
-
-- (NSString *) categoriesAsString
-{
-  NSEnumerator *categories;
-  NSArray *rawCategories;
-  NSMutableArray *l10nCategories;
-  NSString *currentCategory, *l10nCategory;
-
-  rawCategories
-    = [[task categories] componentsSeparatedByString: @","];
-  l10nCategories = [NSMutableArray arrayWithCapacity: [rawCategories count]];
-  categories = [rawCategories objectEnumerator];
-  currentCategory = [categories nextObject];
-  while (currentCategory)
-    {
-      l10nCategory
-        = [self labelForKey: [currentCategory stringByTrimmingSpaces]];
-      if (l10nCategory)
-        [l10nCategories addObject: l10nCategory];
-      currentCategory = [categories nextObject];
-    }
-
-  return [l10nCategories componentsJoinedByString: @", "];
-}
-
-// task.organizer.cnForDisplay
-- (NSString *) eventOrganizer
-{
-  CardElement *organizer;
-
-  organizer = [[self task] uniqueChildWithTag: @"organizer"];
-
-  return [organizer value: 0 ofAttribute: @"cn"];
-}
-
-- (NSString *) priorityLabelKey
-{
-  return [NSString stringWithFormat: @"prio_%@", [task priority]];
-}
-
-/* backend */
-
-- (iCalToDo *) task
-{
-  SOGoTaskObject *clientObject;
-
-  if (!task)
-    {
-      clientObject = [self clientObject];
-      task = (iCalToDo *) [clientObject component: NO];
-      [task retain];
-    }
-
-  return task;
-}
-
-/* hrefs */
-
-- (NSString *)attributesTabLink {
-  return [self completeHrefForMethod:[self ownMethodName]
-              withParameter:@"attributes"
-              forKey:@"tab"];
-}
-
-- (NSString *)participantsTabLink {
-    return [self completeHrefForMethod:[self ownMethodName]
-                 withParameter:@"participants"
-                 forKey:@"tab"];
-}
-
-- (NSString *)debugTabLink {
-  return [self completeHrefForMethod:[self ownMethodName]
-              withParameter:@"debug"
-              forKey:@"tab"];
-}
-
-- (NSString *)completeHrefForMethod:(NSString *)_method
-  withParameter:(NSString *)_param
-  forKey:(NSString *)_key
-{
-  NSString *href;
-
-  [self setQueryParameter:_param forKey:_key];
-  href = [self completeHrefForMethod:[self ownMethodName]];
-  [self setQueryParameter:nil forKey:_key];
-  return href;
-}
-
-
-/* access */
-
-- (BOOL)isMyApt {
-  NSString   *email;
-  iCalPerson *organizer;
-
-  email     = [[[self context] activeUser] primaryEmail];
-  organizer = [[self task] organizer];
-  if (!organizer) return YES; // assume this is correct to do, right?
-  return [[organizer rfc822Email] isEqualToString:email];
-}
-
-- (BOOL)canAccessApt {
-  NSString *email;
-  NSArray  *partMails;
-
-  if ([self isMyApt])
-    return YES;
-  
-  /* not my apt - can access if it's public */
-  if ([[[self task] accessClass] isEqualToString: @"PUBLIC"])
-    return YES;
-
-  /* can access it if I'm invited :-) */
-  email     = [[[self context] activeUser] primaryEmail];
-  partMails = [[[self task] participants] valueForKey:@"rfc822Email"];
-  return [partMails containsObject: email];
-}
-
-- (BOOL)canEditApt {
-  return [self isMyApt];
-}
-
-
-/* action */
-
-- (id<WOActionResults>)defaultAction {
-  if ([self task] == nil) {
-    return [NSException exceptionWithHTTPStatus:404 /* Not Found */
-                       reason:@"could not locate task"];
-  }
-  
-  return self;
-}
-
-- (BOOL)isDeletableClientObject {
-  return [[self clientObject] respondsToSelector:@selector(delete)];
-}
-
-- (id)deleteAction {
-  NSException *ex;
-  id url;
-
-  if ([self task] == nil) {
-    return [NSException exceptionWithHTTPStatus:404 /* Not Found */
-                       reason:@"could not locate task"];
-  }
-
-  if (![self isDeletableClientObject]) {
-    /* return 400 == Bad Request */
-    return [NSException exceptionWithHTTPStatus:400
-                        reason:@"method cannot be invoked on "
-                               @"the specified object"];
-  }
-  
-  if ((ex = [[self clientObject] delete]) != nil) {
-    // TODO: improve error handling
-    [self debugWithFormat:@"failed to delete: %@", ex];
-    return ex;
-  }
-  
-  url = [[[self clientObject] container] baseURLInContext:[self context]];
-  return [self redirectToLocation:url];
-}
-
-@end /* UIxTaskView */
index 63d85f5ef198cfef1e9d950abf2be129a81f3420..2041d757081c767c0aaaae9abebbc5b627161b68 100644 (file)
           };
        };
        methods = {
-          view = { 
-             protectedBy = "ViewAllComponent";
-             pageName    = "UIxAppointmentView"; 
-          };
-          delete = { 
-             protectedBy = "Delete Objects";
-             pageName    = "UIxAppointmentView"; 
-             actionName  = "delete";
-          };
           edit = {
              protectedBy = "ViewAllComponent";
              pageName    = "UIxAppointmentEditor"; 
           };
        };
        methods = {
-          view = { 
-             protectedBy = "ViewAllComponent";
-             pageName    = "UIxTaskView"; 
-          };
-          delete = { 
-             protectedBy = "Delete Objects";
-             pageName    = "UIxTaskView"; 
-             actionName  = "delete";
-          };
+//        delete = { 
+//           protectedBy = "Delete Objects";
+//           pageName    = "UIxTaskView"; 
+//           actionName  = "delete";
+//        };
           edit = { 
              protectedBy = "ViewAllComponent";
              pageName    = "UIxTaskEditor"; 
index 55d2d69abb947d5bd46ce373379bcc432e455a06..741252ca05bd762cae8d1440918af05639ce3cde 100644 (file)
             
             ><td class="messageDateColumn"
             ><span class="mailer_datefield"
-              ><var:string value="message.envelope.date" 
-                formatter="context.mailDateFormatter"
+              ><var:string value="messageDate" 
                 /></span
               ><entity name="nbsp"
               /></td
diff --git a/UI/Templates/PreferencesUI/UIxPreferences.wox b/UI/Templates/PreferencesUI/UIxPreferences.wox
new file mode 100644 (file)
index 0000000..223c86b
--- /dev/null
@@ -0,0 +1,104 @@
+<?xml version="1.0" standalone="yes"?>
+<!DOCTYPE var:component>
+<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:uix="OGo:uix"
+  xmlns:rsrc="OGo:url"
+  xmlns:label="OGo:label"
+  className="UIxPageFrame"
+  title="title"
+  const:popup="YES"
+  >
+  <form id="mainForm" var:href="ownPath">
+    <div class="tabsContainer" id="preferencesTabs">
+      <ul>
+       <li target="outOfOfficeView"><var:string
+           label:value="Out of Office"/></li>
+       <li target="dateTimeView"><var:string
+           label:value="Date and Time"/></li>
+       <li target="calendarOptionsView"><var:string
+           label:value="Calendar Options"/></li>
+       <li target="passwordView"><var:string label:value="Password"/></li>
+      </ul>
+      <div id="outOfOfficeView" class="tab">
+       <label><input
+           const:name="inTheOffice" type="radio" const:value="YES"
+           var:selection="inTheOffice"/>
+         <var:string label:value="I'm currently in the office"/></label><br/>
+       <label><input
+           const:name="inTheOffice" type="radio" const:value="NO"
+           var:selection="inTheOffice"/>
+         <var:string label:value="I'm currently out of the office"/></label><br/>
+       <br/>
+       <div id="outOfOfficeMessage">
+         <label><var:string label:value="AutoReply only once to each sender with the following text :"/><br/>
+           <textarea const:name="autoReplyText" var:value="autoReplyText"/>
+         </label>
+       </div>
+      </div>
+      <div id="dateTimeView" class="tab">
+       <label><var:string label:value="Current Time Zone :"/>
+           <var:popup list="timeZonesList" item="item"
+             string="item" selection="userTimeZone" /></label><br/>
+       <br/>
+       <div id="dateTimeFormat">
+         <label><var:string label:value="Short Date Format :"/>
+           <var:popup list="shortDateFormatsList" item="item"
+             string="itemShortDateFormatText" selection="userShortDateFormat"
+             /></label><br/>
+         <label><var:string label:value="Long Date Format :"/>
+           <var:popup list="longDateFormatsList" item="item"
+             string="itemLongDateFormatText" selection="userLongDateFormat"
+             /></label><br/>
+         <label><var:string label:value="Time Format :"/>
+           <var:popup list="timeFormatsList" item="item"
+             string="itemTimeFormatText" selection="userTimeFormat"
+             /></label>
+       </div>
+      </div>
+      <div id="calendarOptionsView" class="tab">
+       <label><var:string label:value="Week begins on :"/>
+         <var:popup list="daysList" item="item"
+           string="itemWeekStartDay" selection="userWeekStartDay"
+           /></label><br/>
+       <label><var:string label:value="Day start time :"/>
+         <var:popup list="hoursList" item="item"
+           string="item" selection="userDayStartTime"
+           /></label>
+       <label><var:string label:value="Day end time :"/>
+         <var:popup list="hoursList" item="item"
+           string="item" selection="userDayEndTime"
+           /></label><br/>
+       <label><var:string label:value="First week of year :"/>
+         <var:popup list="firstWeekList" item="item"
+         string="itemFirstWeekText" selection="userFirstWeek"
+           /></label><br/>
+       <br/>
+       <label><input class="checkBox"
+           type="checkbox" var:selection="reminderEnabled"
+           var:checked="reminderEnabled"/><var:string
+           label:value="Enable reminders for Calendar items"/></label><br/>
+       <label><input class="checkBox"
+           type="checkbox" var:selection="remindWithASound"
+           var:checked="remindWithASound"/><var:string
+           label:value="Play a sound when a reminder comes due"/></label><br/>
+       <label><var:string label:value="Default reminder :"/>
+         <var:popup list="reminderTimesList" item="item"
+           string="itemReminderTimeText" selection="userReminderTime"/></label>
+      </div>
+      <div id="passwordView" class="tab">
+       <label><var:string label:value="New password:"
+           /><input type="text" class="textField"
+           const:enabled="disabled"
+           var:value="newPassword"/></label><br/>
+       <label><var:string label:value="Confirmation:"
+           /><input type="text" class="textField"
+           const:enabled="disabled"
+           var:value="newPasswordConfirmation"/></label><br/>
+       <input type="button" class="button"
+         id="changePasswordBtn" label:value="Change"/>
+      </div>
+    </div>
+  </form>
+</var:component>
diff --git a/UI/Templates/SchedulerUI/UIxAppointmentView.wox b/UI/Templates/SchedulerUI/UIxAppointmentView.wox
deleted file mode 100644 (file)
index 3944c33..0000000
+++ /dev/null
@@ -1,299 +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:uix="OGo:uix"
-    xmlns:label="OGo:label"
-    className="UIxPageFrame"
-    title="name"
-    const:popup="YES"
-    >
-    <table cellspacing="0" cellpadding="5" width="100%">
-      <tr>
-        <td class="window_label"
-          ><var:string label:value="Appointment viewer" /></td>
-      </tr>
-
-      <tr>
-        <td>
-          <table border="0" cellpadding="2" width="100%" cellspacing="0">
-            <tr bgcolor="#e8e8e0">
-              <td align="left">
-                <span class="aptview_title"
-                  ><var:string value="startTime"
-                    formatter="dateFormatter"
-                    /></span>
-              </td>
-              <td align="right" >
-                <table border='0' cellpadding='0' cellspacing='1'>
-                  <tr>
-                    <td class="button_auto_env" nowrap="true"
-                      valign='middle' align='center'>
-                      <!--<a class="button_auto"
-                      href="printview"
-                      var:queryDictionary="queryParameters"
-                      target="SOGoPrintView"
-                      ><var:string label:value="printview" /></a>-->
-                    </td>
-                    <var:if condition="canEditApt">
-                      <td class="button_auto_env" nowrap="true"
-                        valign='middle' align='center'>
-                        <a class="button_auto"
-                          href="edit"
-                          var:queryDictionary="queryParameters"
-                          ><var:string label:value="edit" /></a>
-                      </td>
-                      <td class="button_auto_env" nowrap="true"
-                        valign='middle' align='center'>
-                        <a class="button_auto"
-                          href="delete"
-                          var:queryDictionary="queryParameters"
-                          ><var:string label:value="delete" /></a>
-                      </td>
-                    </var:if>
-                  </tr>
-                </table>
-              </td>
-            </tr>
-          </table>
-        </td>
-      </tr>
-      <tr>
-        <td valign="top" width="100%">
-          <table width="100%" border="0" cellpadding="4" cellspacing="0">  
-            <!-- general appointment info -->
-            <var:if condition="canAccessApt">  
-              <tr valign="top">
-                <td align="right" width="15%" bgcolor="#E8E8E0" class="aptview_text">
-                  <var:string label:value="Title" />:
-                </td>
-                <td align="left" bgcolor="#FFFFF0" class="aptview_text">
-                  <var:string value="appointment.summary" const:escapeHTML="NO" />
-                </td>
-              </tr>
-              <tr valign="top">
-                <td align="right" width="15%" bgcolor="#E8E8E0" class="aptview_text">
-                  <var:string label:value="Location" />:
-                </td>
-                <td align="left" bgcolor="#FFFFF0" class="aptview_text">
-                  <var:string value="appointment.location" const:escapeHTML="NO" />
-                </td>
-              </tr>
-              <tr valign="top">
-                <td align="right" width="15%" bgcolor="#E8E8E0" class="aptview_text">
-                  <var:string label:value="Priority" />:
-                </td>
-                <td align="left" bgcolor="#FFFFF0" class="aptview_text">
-                  <var:string label:value="$priorityLabelKey" />
-                </td>
-              </tr>
-            </var:if>
-            <tr valign="top">
-              <td align="right" width="15%" bgcolor="#E8E8E0" class="aptview_text">
-                <var:string label:value="Classification" />:
-              </td>
-              <td align="left" bgcolor="#FFFFF0" class="aptview_text">
-                <var:if condition="appointment.isPublic">Public</var:if>
-                <var:if condition="appointment.isPublic"
-                  const:negate="YES"
-                  >Private</var:if>
-              </td>
-            </tr>
-          </table>
-        </td>
-      </tr>
-      <tr>
-        <td valign="top" width="100%">
-          <uix:tabview var:selection="tabSelection"
-            const:tabStyle="tab"
-            const:selectedTabStyle="tab_selected"
-            const:bodyStyle="tabview_body"
-            >
-            <uix:tab const:key="attributes"
-              label:label="attributes"
-              var:href="attributesTabLink"
-              >
-              <table width="100%" border="0" cellpadding="4" cellspacing="0">
-                <tr valign="top">
-                  <td align="right"
-                    width="15%"
-                    bgcolor="#E8E8E0"
-                    class="aptview_text"
-                    >
-                    <var:string label:value="Start time" />:
-                  </td>
-                  <td align="left" bgcolor="#FFFFF0" class="aptview_text">
-                    <var:string value="startTime"
-                      formatter="dateFormatter"
-                      />
-                  </td>
-                </tr>
-                <tr valign="top">
-                  <td align="right"
-                    width="15%"
-                    bgcolor="#E8E8E0"
-                    class="aptview_text"
-                    >
-                    <var:string label:value="End time" />:
-                  </td>
-                  <td align="left" bgcolor="#FFFFF0" class="aptview_text">
-                    <var:string value="endTime"
-                      formatter="dateFormatter"
-                      />
-                  </td>
-                </tr>
-                <var:if condition="canAccessApt">  
-                  <tr valign="top">
-                    <td align="right"
-                      width="15%"
-                      bgcolor="#E8E8E0"
-                      class="aptview_text"
-                      >
-                      <var:string label:value="Categories" />:
-                    </td>
-                    <td align="left" bgcolor="#FFFFF0" class="aptview_text">
-                      <var:string value="categoriesAsString"  const:escapeHTML="NO" />
-                    </td>
-                  </tr>
-                  <!-- Resources removed for v0.8
-                  <tr valign="top">
-                  <td align="right"
-                  width="15%"
-                  bgcolor="#E8E8E0"
-                  class="aptview_text"
-                  >
-                  <var:string label:value="Resources" />:
-                </td>
-                  <td align="left" bgcolor="#FFFFF0" class="aptview_text">
-                  <var:string value="resourcesAsString"
-                  const:escapeHTML="NO"
-                  />
-                </td>
-                </tr>
-                  -->
-                  <tr valign="top">
-                    <td align="right"
-                      width="15%"
-                      bgcolor="#E8E8E0"
-                      class="aptview_text"
-                      >
-                      <var:string label:value="Organizer" />:
-                    </td>
-                    <td align="left" bgcolor="#FFFFF0" class="aptview_text">
-                      <var:string value="eventOrganizer" />
-                    </td>
-                  </tr>
-                  <tr valign="top">
-                    <td align="right"
-                      width="15%"
-                      bgcolor="#E8E8E0"
-                      class="aptview_text"
-                      >
-                      <var:string label:value="Comment" />:
-                    </td>
-                    <td align="left" bgcolor="#FFFFF0" class="aptview_text">
-                      <var:string value="appointment.comment" const:insertBR="1"
-                        const:escapeHTML="NO" />
-                    </td>
-                  </tr>
-                </var:if>
-              </table>
-            </uix:tab>
-            <var:if condition="canAccessApt">    
-              
-              <uix:tab const:key="participants"
-                label:label="participants"
-                var:href="participantsTabLink"
-                >
-                <table width="100%" border="0" cellpadding="4" cellspacing="0">
-                  <tr valign="top">
-                    <td align="left" bgcolor="#E8E8E0" class="aptview_title">
-                      <var:string label:value="Name" />
-                    </td>
-                    <td align="left" bgcolor="#E8E8E0" class="aptview_title">
-                      <var:string label:value="Email" />
-                    </td>
-                    <td align="left"
-                      bgcolor="#E8E8E0"
-                      class="aptview_title"
-                      colspan="2"
-                      >
-                      <var:string label:value="Status" />
-                    </td>
-                  </tr>
-                  <var:foreach list="appointment.participants"
-                    item="attendee"
-                    >
-                    <tr valign="top">
-                      <td align="left" bgcolor="#FFFFF0" class="aptview_text">
-                        <var:string value="attendee.cnForDisplay" />
-                      </td>
-                      <td align="left" bgcolor="#FFFFF0" class="aptview_text">
-                        <a var:href="attendee.email"
-                          ><var:string value="attendee.rfc822Email" /></a>
-                      </td>
-                      <td align="left"
-                        bgcolor="#FFFFF0"
-                        class="aptview_text"
-                        var:colspan="attendeeStatusColspan"
-                        >
-                        <var:component className="UIxCalParticipationStatusView"
-                          partStat="attendee.participationStatus"
-                          />
-                      </td>
-                      <var:if condition="isAttendeeActiveUser">
-                        <td align="left"
-                          bgcolor="#FFFFF0"
-                          class="button_auto_env"
-                          >
-                          <var:if condition="showAcceptButton">  
-                            <a href="accept"
-                              class="button_auto"
-                              _tab="participants"
-                              ><var:string label:value="accept" /></a>
-                          </var:if>
-                          <var:if condition="showRejectButton">
-                            <a href="decline"
-                              class="button_auto"
-                              _tab="participants"
-                              ><var:string label:value="decline" /></a>
-                          </var:if>
-                        </td>
-                      </var:if>
-                    </tr>
-                  </var:foreach>
-                </table>
-              </uix:tab>
-            </var:if>
-            <var:if condition="isUIxDebugEnabled">
-              <uix:tab const:key="debug"
-                const:label="DEBUG"
-                var:href="debugTabLink">
-                SOGo Server - <var:string value="name"/>
-                <br />
-                Client: <var:string value="clientObject"/>
-                <br />
-                Group:      <var:string value="clientObject.group"
-                  /><br />
-                Deletable:  <var:string value="clientObject.isDeletionAllowed"
-                  /><br />
-                Generation: <var:string value="clientObject.zlGenerationCount"
-                  /><br />
-                MsgClass:   <var:string value="clientObject.outlookMessageClass"
-                  /><br />
-                
-                <hr />
-                As iCal:<br />
-                <pre><var:string value="clientObject.iCalString"/></pre>
-                
-                <hr />
-                As Mail:<br />
-                <pre><var:string value="clientObject.iCalMailString"/></pre>
-                
-              </uix:tab>
-            </var:if>
-          </uix:tabview>
-        </td>
-      </tr>
-    </table>
-  </var:component>
index 34c751a41130e25760fc706cf027da5a4ead9a73..863be2ff4477a748616f0f0214facf1f5d8cc24f 100644 (file)
 <?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:uix="OGo:uix"
-    xmlns:rsrc="OGo:url"
-    xmlns:label="OGo:label"
-    className="UIxPageFrame"
-    title="title"
-    >
-    <div class="preload" style="visibility: hidden;">
-      <img rsrc:src="event-gradient.png"/>
-    </div>
-    <div class="menu" id="monthListMenu">
-      <ul>
-        <var:foreach list="monthMenuItems" item="monthMenuItem"
-          ><li var:month="monthMenuItem"
-            ><var:string value="monthMenuItemLabel" /></li>
-        </var:foreach
-          ></ul>
-    </div>
-    
-    <div class="menu" id="yearListMenu">
-      <ul>
-        <var:foreach list="yearMenuItems" item="yearMenuItem"
-          ><li><var:string value="yearMenuItem" /></li>
-        </var:foreach
+<!DOCTYPE var:component>
+<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:uix="OGo:uix"
+  xmlns:rsrc="OGo:url"
+  xmlns:label="OGo:label"
+  className="UIxPageFrame"
+  title="title"
+  >
+  <div class="preload" style="visibility: hidden;">
+    <img rsrc:src="event-gradient.png"/>
+  </div>
+  <div class="menu" id="monthListMenu">
+    <ul>
+      <var:foreach list="monthMenuItems" item="monthMenuItem"
+       ><li var:month="monthMenuItem"
+         ><var:string value="monthMenuItemLabel" /></li>
+      </var:foreach
+       ></ul>
+  </div>
+  
+  <div class="menu" id="yearListMenu">
+    <ul>
+      <var:foreach list="yearMenuItems" item="yearMenuItem"
+       ><li><var:string value="yearMenuItem" /></li>
+      </var:foreach
         ></ul>
-    </div>
+  </div>
 
-    <div class="menu" id="eventsListMenu">
-      <ul>
-        <li><var:string label:value="New Event..."/></li>
-        <li><!-- separator --></li>
-        <li><var:string label:value="New Task..."/></li>
-        <li><var:string label:value="Edit Selected Event..."/></li>
-        <li><var:string label:value="Delete Selected Event"/></li>
-        <li><!-- separator --></li>
-        <li><var:string label:value="Select All"/></li>
-        <li><!-- separator --></li>
-        <li><var:string label:value="Workweek days only"/></li>
-        <li><var:string label:value="Tasks in View"/></li>
-      </ul>
-    </div>
+  <div class="menu" id="eventsListMenu">
+    <ul>
+      <li><var:string label:value="New Event..."/></li>
+      <li><!-- separator --></li>
+      <li><var:string label:value="New Task..."/></li>
+      <li><var:string label:value="Edit Selected Event..."/></li>
+      <li><var:string label:value="Delete Selected Event"/></li>
+      <li><!-- separator --></li>
+      <li><var:string label:value="Select All"/></li>
+      <li><!-- separator --></li>
+      <li><var:string label:value="Workweek days only"/></li>
+      <li><var:string label:value="Tasks in View"/></li>
+    </ul>
+  </div>
+
+  <div class="menu" id="calendarsMenu">
+    <ul>
+      <li><var:string label:value="New Calendar..."/></li>
+      <li><var:string label:value="Delete Calendar"/></li>
+      <li><!-- separator --></li>
+      <li><var:string label:value="Export Calendar..."/></li>
+      <li><var:string label:value="Publish Calendar..."/></li>
+      <li><!-- separator --></li>
+      <li><var:string label:value="Reload Remote Calendars"/></li>
+      <li><!-- separator --></li>
+      <li><var:string label:value="Sharing..." /></li>
+    </ul>
+  </div>
 
-    <div class="menu" id="calendarsMenu">
+  <div id="leftPanel">
+    <div class="tabsContainer" id="schedulerTabs">
       <ul>
-        <li><var:string label:value="New Calendar..."/></li>
-        <li><var:string label:value="Delete Calendar"/></li>
-        <li><!-- separator --></li>
-        <li><var:string label:value="Export Calendar..."/></li>
-        <li><var:string label:value="Publish Calendar..."/></li>
-        <li><!-- separator --></li>
-        <li><var:string label:value="Reload Remote Calendars"/></li>
-        <li><!-- separator --></li>
-        <li><var:string label:value="Sharing..." /></li>
+       <li target="dateSelectorView"><var:string label:value="Date" /></li>
+       <li target="calendarSelectorView"><var:string label:value="Calendars" /></li>
       </ul>
-    </div>
-
-    <div id="leftPanel">
-      <div class="tabsContainer" id="schedulerTabs">
-        <ul>
-          <li target="dateSelectorView"><var:string label:value="Date" /></li>
-          <li target="calendarSelectorView"><var:string label:value="Calendars" /></li>
-        </ul>
 
-        <div id="dateSelectorView"
-          class="tab"
-          ><var:component className="UIxCalDateSelector"
-            selectedDate="thisMonth"
-            /></div>
-        <div id="calendarSelectorView" class="tab"
-          ><var:component className="UIxCalendarSelector"
-           var:calendarFolders="calendarFolders" /></div>
-      </div>
+      <div id="dateSelectorView"
+       class="tab"
+       ><var:component className="UIxCalDateSelector"
+         selectedDate="thisMonth"
+         /></div>
+      <div id="calendarSelectorView" class="tab"
+       ><var:component className="UIxCalendarSelector"
+         var:calendarFolders="calendarFolders" /></div>
+    </div>
 
-      <div id="tasksListView">
-       <label><input id="showHideCompletedTasks"
-           type="checkbox" class="checkBox"
-           /><var:string label:value="Show completed tasks"/></label>
-       <ul id="tasksList"><!-- space --></ul>
-      </div>
+    <div id="tasksListView">
+      <label><input id="showHideCompletedTasks"
+         type="checkbox" class="checkBox"
+         /><var:string label:value="Show completed tasks"/></label>
+      <ul id="tasksList"><!-- space --></ul>
     </div>
+  </div>
 
-    <div id="verticalDragHandle" class="dragHandle"><!-- space --></div>
+  <div id="verticalDragHandle" class="dragHandle"><!-- space --></div>
 
-    <div id="rightPanel">
-      <var:component className="UIxCalFilterPanel" />
-      <div id="eventsListView">
-       <table id="eventsList">
-         <tr>
-           <td class="headerCell headerTitle"><span class="sortableTableHeader"><var:string label:value="Title"/></span></td>
-           <td class="headerCell headerDateTime"><span class="sortableTableHeader"><var:string label:value="Start"/></span></td>
-           <td class="headerCell headerDateTime"><span class="sortableTableHeader"><var:string label:value="End"/></span></td>
-           <td class="headerCell headerLocation"><span class="sortableTableHeader"><var:string label:value="Location"/></span></td>
-         </tr>
-       </table>
-      </div>
-      <div id="rightDragHandle" class="dragHandle"><!-- space --></div>
-      <div id="calendarView"><!-- space --></div>
+  <div id="rightPanel">
+    <var:component className="UIxCalFilterPanel" />
+    <div id="eventsListView">
+      <table id="eventsList">
+       <tr>
+         <td class="headerCell headerTitle"><span class="sortableTableHeader"><var:string label:value="Title"/></span></td>
+         <td class="headerCell headerDateTime"><span class="sortableTableHeader"><var:string label:value="Start"/></span></td>
+         <td class="headerCell headerDateTime"><span class="sortableTableHeader"><var:string label:value="End"/></span></td>
+         <td class="headerCell headerLocation"><span class="sortableTableHeader"><var:string label:value="Location"/></span></td>
+       </tr>
+      </table>
     </div>
-  </var:component>
+    <div id="rightDragHandle" class="dragHandle"><!-- space --></div>
+    <div id="calendarView"><!-- space --></div>
+  </div>
+</var:component>
diff --git a/UI/Templates/SchedulerUI/UIxTaskView.wox b/UI/Templates/SchedulerUI/UIxTaskView.wox
deleted file mode 100644 (file)
index 3944c33..0000000
+++ /dev/null
@@ -1,299 +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:uix="OGo:uix"
-    xmlns:label="OGo:label"
-    className="UIxPageFrame"
-    title="name"
-    const:popup="YES"
-    >
-    <table cellspacing="0" cellpadding="5" width="100%">
-      <tr>
-        <td class="window_label"
-          ><var:string label:value="Appointment viewer" /></td>
-      </tr>
-
-      <tr>
-        <td>
-          <table border="0" cellpadding="2" width="100%" cellspacing="0">
-            <tr bgcolor="#e8e8e0">
-              <td align="left">
-                <span class="aptview_title"
-                  ><var:string value="startTime"
-                    formatter="dateFormatter"
-                    /></span>
-              </td>
-              <td align="right" >
-                <table border='0' cellpadding='0' cellspacing='1'>
-                  <tr>
-                    <td class="button_auto_env" nowrap="true"
-                      valign='middle' align='center'>
-                      <!--<a class="button_auto"
-                      href="printview"
-                      var:queryDictionary="queryParameters"
-                      target="SOGoPrintView"
-                      ><var:string label:value="printview" /></a>-->
-                    </td>
-                    <var:if condition="canEditApt">
-                      <td class="button_auto_env" nowrap="true"
-                        valign='middle' align='center'>
-                        <a class="button_auto"
-                          href="edit"
-                          var:queryDictionary="queryParameters"
-                          ><var:string label:value="edit" /></a>
-                      </td>
-                      <td class="button_auto_env" nowrap="true"
-                        valign='middle' align='center'>
-                        <a class="button_auto"
-                          href="delete"
-                          var:queryDictionary="queryParameters"
-                          ><var:string label:value="delete" /></a>
-                      </td>
-                    </var:if>
-                  </tr>
-                </table>
-              </td>
-            </tr>
-          </table>
-        </td>
-      </tr>
-      <tr>
-        <td valign="top" width="100%">
-          <table width="100%" border="0" cellpadding="4" cellspacing="0">  
-            <!-- general appointment info -->
-            <var:if condition="canAccessApt">  
-              <tr valign="top">
-                <td align="right" width="15%" bgcolor="#E8E8E0" class="aptview_text">
-                  <var:string label:value="Title" />:
-                </td>
-                <td align="left" bgcolor="#FFFFF0" class="aptview_text">
-                  <var:string value="appointment.summary" const:escapeHTML="NO" />
-                </td>
-              </tr>
-              <tr valign="top">
-                <td align="right" width="15%" bgcolor="#E8E8E0" class="aptview_text">
-                  <var:string label:value="Location" />:
-                </td>
-                <td align="left" bgcolor="#FFFFF0" class="aptview_text">
-                  <var:string value="appointment.location" const:escapeHTML="NO" />
-                </td>
-              </tr>
-              <tr valign="top">
-                <td align="right" width="15%" bgcolor="#E8E8E0" class="aptview_text">
-                  <var:string label:value="Priority" />:
-                </td>
-                <td align="left" bgcolor="#FFFFF0" class="aptview_text">
-                  <var:string label:value="$priorityLabelKey" />
-                </td>
-              </tr>
-            </var:if>
-            <tr valign="top">
-              <td align="right" width="15%" bgcolor="#E8E8E0" class="aptview_text">
-                <var:string label:value="Classification" />:
-              </td>
-              <td align="left" bgcolor="#FFFFF0" class="aptview_text">
-                <var:if condition="appointment.isPublic">Public</var:if>
-                <var:if condition="appointment.isPublic"
-                  const:negate="YES"
-                  >Private</var:if>
-              </td>
-            </tr>
-          </table>
-        </td>
-      </tr>
-      <tr>
-        <td valign="top" width="100%">
-          <uix:tabview var:selection="tabSelection"
-            const:tabStyle="tab"
-            const:selectedTabStyle="tab_selected"
-            const:bodyStyle="tabview_body"
-            >
-            <uix:tab const:key="attributes"
-              label:label="attributes"
-              var:href="attributesTabLink"
-              >
-              <table width="100%" border="0" cellpadding="4" cellspacing="0">
-                <tr valign="top">
-                  <td align="right"
-                    width="15%"
-                    bgcolor="#E8E8E0"
-                    class="aptview_text"
-                    >
-                    <var:string label:value="Start time" />:
-                  </td>
-                  <td align="left" bgcolor="#FFFFF0" class="aptview_text">
-                    <var:string value="startTime"
-                      formatter="dateFormatter"
-                      />
-                  </td>
-                </tr>
-                <tr valign="top">
-                  <td align="right"
-                    width="15%"
-                    bgcolor="#E8E8E0"
-                    class="aptview_text"
-                    >
-                    <var:string label:value="End time" />:
-                  </td>
-                  <td align="left" bgcolor="#FFFFF0" class="aptview_text">
-                    <var:string value="endTime"
-                      formatter="dateFormatter"
-                      />
-                  </td>
-                </tr>
-                <var:if condition="canAccessApt">  
-                  <tr valign="top">
-                    <td align="right"
-                      width="15%"
-                      bgcolor="#E8E8E0"
-                      class="aptview_text"
-                      >
-                      <var:string label:value="Categories" />:
-                    </td>
-                    <td align="left" bgcolor="#FFFFF0" class="aptview_text">
-                      <var:string value="categoriesAsString"  const:escapeHTML="NO" />
-                    </td>
-                  </tr>
-                  <!-- Resources removed for v0.8
-                  <tr valign="top">
-                  <td align="right"
-                  width="15%"
-                  bgcolor="#E8E8E0"
-                  class="aptview_text"
-                  >
-                  <var:string label:value="Resources" />:
-                </td>
-                  <td align="left" bgcolor="#FFFFF0" class="aptview_text">
-                  <var:string value="resourcesAsString"
-                  const:escapeHTML="NO"
-                  />
-                </td>
-                </tr>
-                  -->
-                  <tr valign="top">
-                    <td align="right"
-                      width="15%"
-                      bgcolor="#E8E8E0"
-                      class="aptview_text"
-                      >
-                      <var:string label:value="Organizer" />:
-                    </td>
-                    <td align="left" bgcolor="#FFFFF0" class="aptview_text">
-                      <var:string value="eventOrganizer" />
-                    </td>
-                  </tr>
-                  <tr valign="top">
-                    <td align="right"
-                      width="15%"
-                      bgcolor="#E8E8E0"
-                      class="aptview_text"
-                      >
-                      <var:string label:value="Comment" />:
-                    </td>
-                    <td align="left" bgcolor="#FFFFF0" class="aptview_text">
-                      <var:string value="appointment.comment" const:insertBR="1"
-                        const:escapeHTML="NO" />
-                    </td>
-                  </tr>
-                </var:if>
-              </table>
-            </uix:tab>
-            <var:if condition="canAccessApt">    
-              
-              <uix:tab const:key="participants"
-                label:label="participants"
-                var:href="participantsTabLink"
-                >
-                <table width="100%" border="0" cellpadding="4" cellspacing="0">
-                  <tr valign="top">
-                    <td align="left" bgcolor="#E8E8E0" class="aptview_title">
-                      <var:string label:value="Name" />
-                    </td>
-                    <td align="left" bgcolor="#E8E8E0" class="aptview_title">
-                      <var:string label:value="Email" />
-                    </td>
-                    <td align="left"
-                      bgcolor="#E8E8E0"
-                      class="aptview_title"
-                      colspan="2"
-                      >
-                      <var:string label:value="Status" />
-                    </td>
-                  </tr>
-                  <var:foreach list="appointment.participants"
-                    item="attendee"
-                    >
-                    <tr valign="top">
-                      <td align="left" bgcolor="#FFFFF0" class="aptview_text">
-                        <var:string value="attendee.cnForDisplay" />
-                      </td>
-                      <td align="left" bgcolor="#FFFFF0" class="aptview_text">
-                        <a var:href="attendee.email"
-                          ><var:string value="attendee.rfc822Email" /></a>
-                      </td>
-                      <td align="left"
-                        bgcolor="#FFFFF0"
-                        class="aptview_text"
-                        var:colspan="attendeeStatusColspan"
-                        >
-                        <var:component className="UIxCalParticipationStatusView"
-                          partStat="attendee.participationStatus"
-                          />
-                      </td>
-                      <var:if condition="isAttendeeActiveUser">
-                        <td align="left"
-                          bgcolor="#FFFFF0"
-                          class="button_auto_env"
-                          >
-                          <var:if condition="showAcceptButton">  
-                            <a href="accept"
-                              class="button_auto"
-                              _tab="participants"
-                              ><var:string label:value="accept" /></a>
-                          </var:if>
-                          <var:if condition="showRejectButton">
-                            <a href="decline"
-                              class="button_auto"
-                              _tab="participants"
-                              ><var:string label:value="decline" /></a>
-                          </var:if>
-                        </td>
-                      </var:if>
-                    </tr>
-                  </var:foreach>
-                </table>
-              </uix:tab>
-            </var:if>
-            <var:if condition="isUIxDebugEnabled">
-              <uix:tab const:key="debug"
-                const:label="DEBUG"
-                var:href="debugTabLink">
-                SOGo Server - <var:string value="name"/>
-                <br />
-                Client: <var:string value="clientObject"/>
-                <br />
-                Group:      <var:string value="clientObject.group"
-                  /><br />
-                Deletable:  <var:string value="clientObject.isDeletionAllowed"
-                  /><br />
-                Generation: <var:string value="clientObject.zlGenerationCount"
-                  /><br />
-                MsgClass:   <var:string value="clientObject.outlookMessageClass"
-                  /><br />
-                
-                <hr />
-                As iCal:<br />
-                <pre><var:string value="clientObject.iCalString"/></pre>
-                
-                <hr />
-                As Mail:<br />
-                <pre><var:string value="clientObject.iCalMailString"/></pre>
-                
-              </uix:tab>
-            </var:if>
-          </uix:tabview>
-        </td>
-      </tr>
-    </table>
-  </var:component>
index f74e885f563b12147c6f7c3b3865eb12c2b94fbf..f1bd213e415abcbd73e2636f9d469426d5b6d957 100644 (file)
@@ -68,7 +68,9 @@
            <a var:href="relativeContactsPath"
              ><var:string label:value="Address Book" /></a> |
            <a var:href="relativeMailPath"
-             ><var:string label:value="Mail" /></a>
+             ><var:string label:value="Mail" /></a> |
+           <a var:href="relativePreferencesPath"
+             ><var:string label:value="Preferences" /></a>
            <!--              | <a var:href="logoffPath"
            ><var:string label:value="Logoff" /></a> -->
            <var:if condition="context.isUIxDebugEnabled"
index d1ff0109c3921dfaee63c1b4887fe0a8223e49b7..2010ef5699be9e58bc747e0c3706152701ab2914 100644 (file)
@@ -500,15 +500,18 @@ TABLE#messageList TD.messageFlagColumn
 TABLE#messageList TD.tbtv_subject_headercell,
 TABLE#messageList td.mailer_unreadmailsubject,
 TABLE#messageList td.mailer_readmailsubject
-{ width: 40%; }
+{ width: 40%;
+  min-width: 40%; }
 
 TABLE#messageList TD.tbtv_from_headercell,
 TABLE#messageList TD.messageAddressColumn
-{ width: 35%; }
+{ width: 35%;
+  overflow: hidden; }
 
 TABLE#messageList TD.tbtv_date_headercell,
 TABLE#messageList TD.messageDateColumn
-{ width: 25%; }
+{ width: 25%;
+  overflow: hidden; }
 
 TABLE#messageList TR._selected TD
 { 
diff --git a/UI/WebServerResources/UIxPreferences.css b/UI/WebServerResources/UIxPreferences.css
new file mode 100644 (file)
index 0000000..6fdb861
--- /dev/null
@@ -0,0 +1,34 @@
+DIV#preferencesTabs
+{ position: absolute;
+  top: 5em;
+  left: .5em;
+  right: .5em;
+  bottom: .5em; }
+
+DIV#dateTimeFormat,
+DIV#passwordView
+{ text-align: right; }
+
+DIV#outOfOfficeView
+{ padding-top: 2em;
+  padding-left: 2em;
+  padding-right: 5em; }
+
+DIV#outOfOfficeView LABEL
+{ text-align: left;
+  margin-left: 0px;
+  white-space: normal; }
+
+DIV#outOfOfficeView TEXTAREA
+{ width: 30em;
+  margin: 0px;
+  height: 4em; }
+
+DIV#dateTimeView
+{ padding-top: 3em;
+  padding-left: 1em;
+  padding-right: 2em; }
+
+DIV#passwordView
+{ padding-top: 3em;
+  padding-right: 10em; }
diff --git a/UI/WebServerResources/UIxPreferences.js b/UI/WebServerResources/UIxPreferences.js
new file mode 100644 (file)
index 0000000..8549871
--- /dev/null
@@ -0,0 +1,5 @@
+function savePreferences(sender) {
+   $("mainForm").submit();
+
+   return false;
+}
index 2ca3eef8b54ff6d2b72971b31db1e5c2df8a0b17..5ea9c2e1bf132fcb66ee14af1f9d1e65bd84428f 100644 (file)
@@ -614,8 +614,7 @@ DIV.dTreeNode SPAN._dragOver
 
 /* tabs */
 DIV.tabsContainer
-{ 
-  position: relative;
+{ position: relative;
   color: #000;
   background-color: #d4d0c8;
   margin-top: 1.5em;
index 1d5428f7fcbc096396a9ed60f41c899b0941abab..0ff9cfa81c5a7250105891b378b4873a5b463c08 100644 (file)
@@ -1211,6 +1211,16 @@ function onLinkBannerClick() {
   checkAjaxRequestsState();
 }
 
+function onPreferencesClick(event) {
+   var urlstr = UserFolderURL + "preferences";
+   var w = window.open(urlstr, "User Preferences",
+                      "width=430,height=250,resizable=0,scrollbars=0");
+   w.opener = window;
+   w.focus();
+
+   event.preventDefault();
+}
+
 function configureLinkBanner() {
   var linkBanner = $("linkBanner");
   if (linkBanner) {
@@ -1219,8 +1229,10 @@ function configureLinkBanner() {
        Event.observe(anchors[i], "mousedown", listRowMouseDownHandler);
        Event.observe(anchors[i], "click", onLinkBannerClick);
     }
-    if (anchors.length > 3)
-       Event.observe(anchors[3], "click", toggleLogConsole);
+    Event.observe(anchors[3], "mousedown", listRowMouseDownHandler);
+    Event.observe(anchors[3], "click", onPreferencesClick);
+    if (anchors.length > 4)
+       Event.observe(anchors[4], "click", toggleLogConsole);
   }
 }