+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
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";
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 */;
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];
}
{
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;
}
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.
#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
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
}
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];
02111-1307, USA.
*/
+#warning importing common is baaad
+
#import <Foundation/Foundation.h>
#import <Foundation/NSObjCRuntime.h>
- (void) setFloat: (float) value forKey: (NSString *) key;
- (void) setInteger: (int) value forKey: (NSString *) key;
+- (NSString *) jsonRepresentation;
+
/* saving changes */
- (BOOL) synchronize;
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
return (values || [self primaryFetchProfile]);
}
+- (NSString *) jsonRepresentation
+{
+ [self fetchProfile];
+
+ return [values jsonRepresentation];
+}
+
/* value access */
- (void) setObject: (id) value
\
LDAPUserManager.h \
LDAPSource.h \
+ SOGoDateFormatter.h \
SOGoPermissions.h \
- SOGoLRUCache.h \
- WOContext+Agenor.h \
SOGoDAVRendererTypes.h \
NSArray+Utilities.h \
NSDictionary+URL.h \
SOGoGroupFolder.m \
SOGoCustomGroupFolder.m \
\
+ SOGoDateFormatter.m \
SOGoPermissions.m \
- SOGoLRUCache.m \
LDAPUserManager.m \
LDAPSource.m \
- WOContext+Agenor.m \
SOGoDAVRendererTypes.m \
AgenorUserDefaults.m \
NSArray+Utilities.m \
@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
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;
- (void) dealloc
{
- if (LDAPBaseDN)
- [LDAPBaseDN release];
- if (LDAPHost)
- [LDAPHost release];
[authMethod release];
[super dealloc];
}
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 */
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;
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"
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
--- /dev/null
+/*
+ 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_ */
--- /dev/null
+/*
+ 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 */
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>";
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];
}
NSArray *luids;
unsigned i, count;
- if (self->uidToFolder != nil)
+ if (uidToFolder != nil)
return;
if ((luids = [self uids]) == nil)
return;
}
/* 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 {
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];
}
/* name lookup */
-- (id)groupCalendar:(NSString *)_key inContext:(id)_ctx {
+- (id) groupCalendar: (NSString *) _key
+ inContext: (id) _ctx
+{
static Class calClass = Nil;
id calendar;
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 */
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 */
+++ /dev/null
-/*
- 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_ */
+++ /dev/null
-/*
- 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
#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 */
- (NSString *) cn;
- (NSURL *) freeBusyURL;
+- (SOGoDateFormatter *) dateFormatterInContext: (WOContext *) context;
+
/* shares and identities */
- (NSString *) primaryIMAP4AccountString;
#import "AgenorUserDefaults.h"
#import "LDAPUserManager.h"
-#import "SOGoContentObject.h"
+#import "SOGoDateFormatter.h"
+#import "SOGoObject.h"
#import "SOGoPermissions.h"
#import "NSArray+Utilities.h"
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;
userSettings = nil;
allEmails = nil;
language = nil;
+ currentPassword = nil;
+ dateFormatter = nil;
}
return self;
- (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;
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
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;
}
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"
+++ /dev/null
-/*
- 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_ */
+++ /dev/null
-/*
- 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) */
+++ /dev/null
-/*
- 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>
return [self relativePathToUserFolderSubPath: @"Mail/"];
}
+- (NSString *) relativePreferencesPath
+{
+ return [self relativePathToUserFolderSubPath: @"preferences"];
+}
+
- (NSString *) logoffPath
{
return [self relativePathToUserFolderSubPath: @"logoff"];
include $(GNUSTEP_MAKEFILES)/common.make
SUBPROJECTS += \
- SOGoUI \
- MainUI \
Common \
- Scheduler \
Contacts \
MailerUI \
MailPartViewers \
+ MainUI \
+ PreferencesUI \
+ Scheduler \
+ SOGoUI \
Templates
include $(GNUSTEP_MAKEFILES)/aggregate.make
- (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;
}
#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>
/*
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 {
{
NSException *error;
NSString *mailPath;
- NSDictionary *h;
id <WOActionResults> result;
// TODO: need to validate whether we have a To etc
/* 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 */
#ifndef UIXMAILLISTVIEW_H
#define UIXMAILLISTVIEW_H
-#include <SOGoUI/UIxComponent.h>
+#import <SOGoUI/UIxComponent.h>
@class EOQualifier;
+@class SOGoDateFormatter;
@interface UIxMailListView : UIxComponent
{
unsigned firstMessageNumber;
id message;
EOQualifier *qualifier;
+ SOGoDateFormatter *dateFormatter;
+ NSTimeZone *userTimeZone;
}
- (NSString *)defaultSortKey;
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
[self->sortedUIDs release];
[self->messages release];
[self->message release];
+ [dateFormatter release];
+ [userTimeZone release];
[super dealloc];
}
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);
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)
/* 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";
}
/* 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$";
}
--- /dev/null
+/* 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";
--- /dev/null
+/* 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";
--- /dev/null
+# 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
+
+
--- /dev/null
+/* 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
--- /dev/null
+( /* 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"; }
+ )
+)
--- /dev/null
+/* 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 */
--- /dev/null
+/* 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
--- /dev/null
+/* 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 */
--- /dev/null
+/* 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
--- /dev/null
+# nothing here
--- /dev/null
+{ /* -*-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";
+ };
+ };
+ };
+ };
+}
\
UIxJSClose.h \
UIxComponent.h \
- SOGoDateFormatter.h \
SOGoAptFormatter.h \
SOGoJSStringFormatter.h \
WOContext+UIx.h \
\
UIxJSClose.m \
UIxComponent.m \
- SOGoDateFormatter.m \
SOGoAptFormatter.m \
SOGoJSStringFormatter.m \
WOContext+UIx.m \
+++ /dev/null
-/*
- 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_ */
+++ /dev/null
-/*
- 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 */
UIxAttendeesEditor.m \
UIxComponentEditor.m \
UIxCalendarSelector.m \
- UIxAppointmentView.m \
UIxAppointmentEditor.m \
UIxAppointmentProposal.m \
- UIxTaskView.m \
UIxTaskEditor.m \
UIxTaskProposal.m \
UIxCalDateLabel.m \
+++ /dev/null
-// $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__ */
+++ /dev/null
-/*
- 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 */
@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;
#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
NSString *userLogin;
WORequest *request;
SOGoDateFormatter *dateFormatter;
+ NSTimeZone *userTimeZone;
}
- (WOResponse *) eventsListAction;
#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"
- (id) initWithRequest: (WORequest *) newRequest
{
- NSDictionary *locale;
+ SOGoUser *user;
if ((self = [super initWithRequest: newRequest]))
{
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;
[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];
NSArray *daysToDisplay;
NSCalendarDate *currentTableDay;
NSArray *currentTableColumn;
+
+ NSArray *dayNames;
+ NSArray *monthNames;
}
- (NSDictionary *) monthBeforePrevMonthQueryParameters;
- (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
@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;
#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;
+++ /dev/null
-// $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__ */
+++ /dev/null
-/*
- 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 */
};
};
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";
><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
--- /dev/null
+<?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>
+++ /dev/null
-<?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>
<?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>
+++ /dev/null
-<?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>
<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"
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
{
--- /dev/null
+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; }
--- /dev/null
+function savePreferences(sender) {
+ $("mainForm").submit();
+
+ return false;
+}
/* tabs */
DIV.tabsContainer
-{
- position: relative;
+{ position: relative;
color: #000;
background-color: #d4d0c8;
margin-top: 1.5em;
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) {
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);
}
}