+2007-08-22 Wolfgang Sourdeau <wsourdeau@inverse.ca>
+
+ * UI/PreferencesUI/UIxPreferences.m ([UIxPreferences
+ -messageForwardingList])
+ ([UIxPreferences -itemMessageForwardingText])D
+ ([UIxPreferences -userMessageForwarding])
+ ([UIxPreferences -setUserMessageForwarding:newMessageForwarding]):
+ new template methods for manage the user preference regarding
+ message forwarding.
+
+ * SoObjects/SOGo/SOGoUser.m ([SOGoUser -language]): change the
+ algorithm to return, in order, the user's defined language or the
+ first browser language or, finally, the default language.
+ ([SOGoUser -messageForwarding]): new method that returns the user
+ preference for message forwarding: "inline" or "attached",
+ defaulting to "attached".
+
+ * SoObjects/Mailer/SOGoMailObject+Draft.m ([SOGoMailObject
+ -contentForInlineForward]): new method that returns the content of
+ the message for inline forwarding based on the SOGoMailForward
+ templates.
+
+ * SoObjects/Mailer/SOGoDraftObject.m ([SOGoDraftObject
+ -fetchMailForForwarding:sourceMail]): check the user preference
+ for message forwarding and compose inline forwarded messages if required.
+
+ * SoObjects/Appointments/SOGoCalendarComponent.m
+ ([SOGoCalendarComponent
+ -sendEMailUsingTemplateNamed:_pageNameforOldObject:_oldObjectandNewObject:_newObjecttoAttendees:_attendees]):
+ now use a template based on the language returned from the
+ SOGoUser object.
+
+ * SoObjects/Mailer/SOGoMailEnglishForward.m: new module containing
+ a subclass of SOGoMailForward for English locale.
+
+ * SoObjects/Mailer/SOGoMailFrenchForward.m: new module containing
+ a subclass of SOGoMailForward for French locale.
+
+ * SoObjects/Mailer/SOGoMailForward.[hm]: new module class that
+ helps build template for inline forwarded messages.
+
2007-08-21 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* UI/SOGoElements/SOGoIEConditional.m: new extension module class
#include "SOGoAptMailNotification.h"
@interface SOGoAptMailEnglishDeletion : SOGoAptMailNotification
-{
-}
@end
@implementation SOGoAptMailEnglishDeletion
@end
@interface SOGoAptMailFrenchDeletion : SOGoAptMailNotification
-{
-}
@end
@implementation SOGoAptMailFrenchDeletion
@end
+
+@interface SOGoAptMailGermanDeletion : SOGoAptMailNotification
+@end
+
+@implementation SOGoAptMailGermanDeletion
+@end
--- /dev/null
+<#IsSubject>Der Termin am <#AptStartDate /> um <#AptStartTime /> wurde gelöscht.</#IsSubject>
+<#IsBody>
+Der Termin am <#AptStartDate /> um <#AptStartTime /> wurde von <#Organizer /> gelöscht.
+</#IsBody>
--- /dev/null
+AptStartDate: WOString {
+ value = newStartDate;
+ dateformat = "%d/%m/%y";
+ escapeHTML = NO;
+}
+
+AptStartTime: WOString {
+ value = newStartDate;
+ dateformat = "%H:%M";
+ escapeHTML = NO;
+}
+
+Organizer: WOString {
+ value = newApt.organizer.cnWithoutQuotes;
+ escapeHTML = NO;
+}
+
+HasHomePageURL: WOConditional {
+ condition = homePageURL.length;
+}
+
+HomePageURL: WOString {
+ value = appointmentURL;
+ escapeHTML = NO;
+}
+
+IsSubject: WOConditional {
+ condition = isSubject;
+}
+
+IsBody: WOConditional {
+ condition = isSubject;
+ negate = YES;
+}
--- /dev/null
+<#IsSubject>Termin am <#AptStartDate /> um <#AptStartTime /></#IsSubject>
+<#IsBody>
+<#Organizer /> lädt Sie zu einem Termin am <#AptStartDate /> um <#AptStartTime /> ein.
+<#HasHomePageURL>
+Bitte benutzen Sie folgende URL, um anzugeben, ob Sie an dem Termin teilnehmen können: <#HomePageURL />.
+</#HasHomePageURL>
+</#IsBody>
--- /dev/null
+AptStartDate: WOString {
+ value = newStartDate;
+ dateformat = "%d/%m/%y";
+ escapeHTML = NO;
+}
+
+AptStartTime: WOString {
+ value = newStartDate;
+ dateformat = "%H:%M";
+ escapeHTML = NO;
+}
+
+Organizer: WOString {
+ value = newApt.organizer.cnWithoutQuotes;
+ escapeHTML = NO;
+}
+
+HasHomePageURL: WOConditional {
+ condition = homePageURL.length;
+}
+
+HomePageURL: WOString {
+ value = appointmentURL;
+ escapeHTML = NO;
+}
+
+IsSubject: WOConditional {
+ condition = isSubject;
+}
+
+IsBody: WOConditional {
+ condition = isSubject;
+ negate = YES;
+}
--- /dev/null
+<#IsSubject>Von dem Termin am <#AptStartDate /> um <#AptStartTime /> gelöscht</#IsSubject>
+<#IsBody>
+Sie sind nicht mehr eingeladen zu dem Termin am <#AptStartDate /> um <#AptStartTime /> organisiert von <#Organizer />.
+</#IsBody>
--- /dev/null
+AptStartDate: WOString {
+ value = newStartDate;
+ dateformat = "%d/%m/%y";
+ escapeHTML = NO;
+}
+
+AptStartTime: WOString {
+ value = newStartDate;
+ dateformat = "%H:%M";
+ escapeHTML = NO;
+}
+
+Organizer: WOString {
+ value = newApt.organizer.cnWithoutQuotes;
+ escapeHTML = NO;
+}
+
+HasHomePageURL: WOConditional {
+ condition = homePageURL.length;
+}
+
+HomePageURL: WOString {
+ value = appointmentURL;
+ escapeHTML = NO;
+}
+
+IsSubject: WOConditional {
+ condition = isSubject;
+}
+
+IsBody: WOConditional {
+ condition = isSubject;
+ negate = YES;
+}
--- /dev/null
+<#IsSubject>Veränderung des Termins am <#OldAptStartDate /> um <#OldAptStartTime /></#IsSubject>
+<#IsBody>
+Der Termin, der ursprünglich am <#OldAptStartDate /> um <#OldAptStartTime /> stattfinden sollte, ist jetzt für den <#NewAptStartDate /> um <#NewAptStartTime /> geplant.
+Bitte geben Sie an folgender URL an, ob Sie an diesem Termin zum neuen Datum teilnehmen können: <#HomePageURL />.
+</#IsBody>
--- /dev/null
+OldAptStartDate: WOString {
+ value = oldStartDate;
+ dateformat = "%d/%m/%y";
+ escapeHTML = NO;
+}
+
+OldAptStartTime: WOString {
+ value = oldStartDate;
+ dateformat = "%H:%M";
+ escapeHTML = NO;
+}
+
+NewAptStartDate: WOString {
+ value = newStartDate;
+ dateformat = "%d/%m/%y";
+ escapeHTML = NO;
+}
+
+NewAptStartTime: WOString {
+ value = newStartDate;
+ dateformat = "%H:%M";
+ escapeHTML = NO;
+}
+
+Organizer: WOString {
+ value = newApt.organizer.cnWithoutQuotes;
+ escapeHTML = NO;
+}
+
+HasHomePageURL: WOConditional {
+ condition = homePageURL.length;
+}
+
+HomePageURL: WOString {
+ value = appointmentURL;
+ escapeHTML = NO;
+}
+
+IsSubject: WOConditional {
+ condition = isSubject;
+}
+
+IsBody: WOConditional {
+ condition = isSubject;
+ negate = YES;
+}
02111-1307, USA.
*/
-#include "SOGoAptMailNotification.h"
+#import "SOGoAptMailNotification.h"
@interface SOGoAptMailEnglishInvitation : SOGoAptMailNotification
-{
-}
@end
@implementation SOGoAptMailEnglishInvitation
@end
@interface SOGoAptMailFrenchInvitation : SOGoAptMailNotification
-{
-}
@end
@implementation SOGoAptMailFrenchInvitation
@end
+
+@interface SOGoAptMailGermanInvitation : SOGoAptMailNotification
+@end
+
+@implementation SOGoAptMailGermanInvitation
+@end
02111-1307, USA.
*/
-#include "SOGoAptMailNotification.h"
+#import "SOGoAptMailNotification.h"
@interface SOGoAptMailEnglishRemoval : SOGoAptMailNotification
-{
-}
@end
@implementation SOGoAptMailEnglishRemoval
@end
@interface SOGoAptMailFrenchRemoval : SOGoAptMailNotification
-{
-}
@end
@implementation SOGoAptMailFrenchRemoval
@end
+
+@interface SOGoAptMailGermanRemoval : SOGoAptMailNotification
+@end
+
+@implementation SOGoAptMailGermanRemoval
+@end
#import "iCalEntityObject+SOGo.h"
#import "SOGoCalendarComponent.h"
-static NSString *mailTemplateDefaultLanguage = nil;
static BOOL sendEMailNotifications = NO;
@implementation SOGoCalendarComponent
didInit = YES;
ud = [NSUserDefaults standardUserDefaults];
- mailTemplateDefaultLanguage = [[ud stringForKey:@"SOGoDefaultLanguage"]
- retain];
- if (!mailTemplateDefaultLanguage)
- mailTemplateDefaultLanguage = @"English";
-
sendEMailNotifications
= [ud boolForKey: @"SOGoAppointmentSendEMailNotifications"];
}
WOApplication *app;
unsigned i, count;
iCalPerson *attendee;
- NSString *recipient;
+ NSString *recipient, *language;
SOGoAptMailNotification *p;
NSString *mailDate, *subject, *text, *header;
NGMutableHashMap *headerMap;
else
recipient = email;
+ language = [[context activeUser] language];
#warning this could be optimized in a class hierarchy common with the \
SOGoObject's acl notification mechanism
/* create page name */
// TODO: select user's default language?
pageName = [NSString stringWithFormat: @"SOGoAptMail%@%@",
- mailTemplateDefaultLanguage,
+ language,
_pageName];
/* construct message content */
p = [app pageWithName: pageName inContext: context];
include ../common.make
-BUNDLE_NAME = Mailer
+WOBUNDLE_NAME = Mailer
Mailer_PRINCIPAL_CLASS = SOGoMailerProduct
\
SOGoDraftsFolder.m \
SOGoDraftObject.m \
+ \
+ SOGoMailForward.m
Mailer_RESOURCE_FILES += \
Version \
product.plist \
+Mailer_RESOURCE_FILES += \
+ SOGoMailEnglishForward.wo \
+ SOGoMailFrenchForward.wo \
+ SOGoMailGermanForward.wo
+
-include GNUmakefile.preamble
-include $(GNUSTEP_MAKEFILES)/bundle.make
+include $(GNUSTEP_MAKEFILES)/wobundle.make
-include GNUmakefile.postamble
include ../../fhsbundle.make
#import <NGObjWeb/NSException+HTTP.h>
#import <NGObjWeb/SoObject+SoDAV.h>
-#import <NGObjWeb/WOContext.h>
+#import <NGObjWeb/WOContext+SoObjects.h>
#import <NGObjWeb/WORequest+So.h>
#import <NGObjWeb/WOResponse.h>
#import <NGExtensions/NGBase64Coding.h>
#import <SoObjects/SOGo/NSArray+Utilities.h>
#import <SoObjects/SOGo/NSCalendarDate+SOGo.h>
#import <SoObjects/SOGo/SOGoMailer.h>
+#import <SoObjects/SOGo/SOGoUser.h>
#import "SOGoMailAccount.h"
#import "SOGoMailFolder.h"
#import "SOGoMailObject.h"
- (void) fetchMailForForwarding: (SOGoMailObject *) sourceMail
{
NSDictionary *info, *attachment;
+ SOGoUser *currentUser;
[sourceMail fetchCoreInfos];
[self setSourceFlag: @"$Forwarded"];
/* attach message */
-
+ currentUser = [context activeUser];
+ if ([[currentUser messageForwarding] isEqualToString: @"inline"])
+ [self setText: [sourceMail contentForInlineForward]];
+ else
+ {
// TODO: use subject for filename?
// error = [newDraft saveAttachment:content withName:@"forward.mail"];
- attachment = [NSDictionary dictionaryWithObjectsAndKeys:
- [sourceMail filenameForForward], @"filename",
- @"message/rfc822", @"mime-type",
- nil];
- [self saveAttachment: [sourceMail content]
- withMetadata: attachment];
+ attachment = [NSDictionary dictionaryWithObjectsAndKeys:
+ [sourceMail filenameForForward], @"filename",
+ @"message/rfc822", @"mime-type",
+ nil];
+ [self saveAttachment: [sourceMail content]
+ withMetadata: attachment];
+ }
[self storeInfo];
}
-/* SOGoACLEnglishAdditionAdvisory.m - this file is part of SOGo
+/* SOGoMailForward.h - this file is part of SOGo
*
* Copyright (C) 2007 Inverse groupe conseil
*
* Boston, MA 02111-1307, USA.
*/
-#import "SOGoACLEnglishAdditionAdvisory.h"
+#ifndef SOGOMAILFORWARD_H
+#define SOGOMAILFORWARD_H
-@implementation SOGoACLEnglishAdditionAdvisory
+#import <NGObjWeb/SoComponent.h>
-- (NSString *) aclMethod
+@class SOGoMailObject;
+
+@interface SOGoMailForward : SoComponent
{
- return @"add";
+ SOGoMailObject *sourceMail;
+ NSString *field;
+ NSString *currentValue;
}
+- (void) setForwardedMail: (SOGoMailObject *) newSourceMail;
+
@end
+
+@interface SOGoMailEnglishForward : SOGoMailForward
+@end
+
+@interface SOGoMailFrenchForward : SOGoMailForward
+@end
+
+@interface SOGoMailGermanForward : SOGoMailForward
+@end
+
+#endif /* SOGOMAILFORWARD_H */
--- /dev/null
+/* SOGoMailForward.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 <NGObjWeb/WOContext+SoObjects.h>
+
+#import <SoObjects/SOGo/SOGoDateFormatter.h>
+#import <SoObjects/SOGo/SOGoUser.h>
+
+#import "SOGoMailObject+Draft.h"
+#import "SOGoMailForward.h"
+
+@implementation SOGoMailForward
+
+- (id) init
+{
+ if ((self = [super init]))
+ {
+ sourceMail = nil;
+ currentValue = nil;
+ }
+
+ return self;
+}
+
+- (void) dealloc
+{
+ [sourceMail release];
+ [currentValue release];
+ [super dealloc];
+}
+
+- (void) setForwardedMail: (SOGoMailObject *) newSourceMail
+{
+ ASSIGN (sourceMail, newSourceMail);
+}
+
+- (NSString *) subject
+{
+ return [sourceMail subject];
+}
+
+- (NSString *) date
+{
+ SOGoDateFormatter *formatter;
+
+ formatter = [[context activeUser] dateFormatterInContext: context];
+
+ return [formatter formattedDateAndTime: [sourceMail date]];
+}
+
+- (NSString *) from
+{
+ return [[sourceMail mailHeaders] objectForKey: @"from"];
+}
+
+- (NSString *) _headerField: (NSString *) fieldName
+{
+ if (![field isEqualToString: fieldName])
+ {
+ [currentValue release];
+ currentValue = [[sourceMail mailHeaders] objectForKey: fieldName];
+ [currentValue retain];
+ }
+
+ return currentValue;
+}
+
+- (BOOL) hasReplyTo
+{
+ return ([[self _headerField: @"reply-to"] length] > 0);
+}
+
+- (NSString *) replyTo
+{
+ return ([NSString stringWithFormat: @"%@\n",
+ [self _headerField: @"reply-to"]]);
+}
+
+- (BOOL) hasOrganization
+{
+ return ([[self _headerField: @"organization"] length] > 0);
+}
+
+- (NSString *) organization
+{
+ return ([NSString stringWithFormat: @"%@\n",
+ [self _headerField: @"organization"]]);
+}
+
+- (NSString *) to
+{
+ return [[sourceMail mailHeaders] objectForKey: @"to"];
+}
+
+- (BOOL) hasCc
+{
+ return ([[self _headerField: @"cc"] length] > 0);
+}
+
+- (NSString *) cc
+{
+ return ([NSString stringWithFormat: @"%@\n",
+ [self _headerField: @"cc"]]);
+}
+
+- (BOOL) hasNewsGroups
+{
+ return ([[self _headerField: @"newsgroups"] length] > 0);
+}
+
+- (NSString *) newsgroups
+{
+ return ([NSString stringWithFormat: @"%@\n",
+ [self _headerField: @"newsgroups"]]);
+}
+
+- (BOOL) hasReferences
+{
+ return ([[self _headerField: @"references"] length] > 0);
+}
+
+- (NSString *) references
+{
+ return ([NSString stringWithFormat: @"%@\n",
+ [self _headerField: @"references"]]);
+}
+
+- (NSString *) messageBody
+{
+ return [sourceMail contentForEditing];
+}
+
+@end
+
+@implementation SOGoMailEnglishForward
+@end
+
+@implementation SOGoMailFrenchForward
+@end
+
+@implementation SOGoMailGermanForward
+@end
--- /dev/null
+-------- Original E-Mail --------
+Betreff: <#subject/>
+Datum: <#date/>
+Sender: <#from/>
+<#hasReplyTo>Antworten an: <#replyTo/></#hasReplyTo><#hasOrganization>Organisation: <#organization/></#hasOrganization>An: <#to/>
+<#hasCc>Kopie: <#cc/></#hasCc><#hasNewsGroups>Newsgroup: <#newsgroups/></#hasNewsGroups><#hasReferences>Referenzen: <#references/></#hasReferences>
+
+<#messageBody/>
--- /dev/null
+subject: WOString {
+ value = subject;
+ escapeHTML = NO;
+}
+
+date: WOString {
+ value = date;
+ escapeHTML = NO;
+}
+
+from: WOString {
+ value = from;
+ escapeHTML = NO;
+}
+
+hasReplyTo: WOConditional {
+ condition = hasReplyTo;
+}
+
+replyTo: WOString {
+ value = replyTo;
+ escapeHTML = NO;
+}
+
+hasOrganization: WOConditional {
+ condition = hasOrganization;
+}
+
+organization: WOString {
+ value = organization;
+ escapeHTML = NO;
+}
+
+to: WOString {
+ value = to;
+ escapeHTML = NO;
+}
+
+hasCc: WOConditional {
+ condition = hasCc;
+}
+
+cc: WOString {
+ value = cc;
+ escapeHTML = NO;
+}
+
+hasNewsGroups: WOConditional {
+ condition = hasNewsGroups;
+}
+
+newsgroups: WOString {
+ value = newsgroups;
+ escapeHTML = NO;
+}
+
+hasReferences: WOConditional {
+ condition = hasReferences;
+}
+
+references: WOString {
+ value = references;
+ escapeHTML = NO;
+}
+
+messageBody: WOString {
+ value = messageBody;
+ escapeHTML = NO;
+}
- (NSString *) subjectForForward;
- (NSString *) filenameForForward;
+- (NSString *) contentForInlineForward;
@end
#import <Foundation/NSArray.h>
+#import <NGObjWeb/WOApplication.h>
+#import <NGObjWeb/WOContext+SoObjects.h>
#import <NGExtensions/NSString+misc.h>
#import <NGExtensions/NSObject+Logs.h>
+#import <SoObjects/SOGo/SOGoUser.h>
+
+#import "SOGoMailForward.h"
#import "SOGoMailObject+Draft.h"
#define maxFilenameLength 64
return newSubject;
}
+- (NSString *) contentForInlineForward
+{
+ SOGoUser *currentUser;
+ NSString *pageName;
+ SOGoMailForward *page;
+
+ currentUser = [context activeUser];
+ pageName = [NSString stringWithFormat: @"SOGoMail%@Forward",
+ [currentUser language]];
+ page = [[WOApplication application] pageWithName: pageName
+ inContext: context];
+ [page setForwardedMail: self];
+
+ return [[page generateResponse] contentAsString];
+}
+
- (void) _fetchFileAttachmentKey: (NSDictionary *) part
intoArray: (NSMutableArray *) keys
withPath: (NSString *) path
- (NSArray *)toEnvelopeAddresses;
- (NSArray *)ccEnvelopeAddresses;
+- (NSDictionary *) mailHeaders;
+
- (id)bodyStructure;
- (id)lookupInfoForBodyPart:(id)_path;
return headers;
}
-- (id)lookupInfoForBodyPart:(id)_path {
+- (id) lookupInfoForBodyPart: (id) _path
+{
NSEnumerator *pe;
NSString *p;
id info;
/* content */
-- (NSData *)content {
+- (NSData *) content
+{
NSData *content;
id result, fullResult;
return flatContents;
}
-- (NSDictionary *)fetchPlainTextParts {
+- (NSDictionary *) fetchPlainTextParts
+{
return [self fetchPlainTextParts:[self plainTextContentFetchKeys]];
}
/* convert parts to strings */
-- (NSString *)stringForData:(NSData *)_data partInfo:(NSDictionary *)_info
+- (NSString *) stringForData: (NSData *) _data
+ partInfo: (NSDictionary *) _info
{
NSString *charset, *encoding, *s;
NSData *mailData;
return s;
}
-- (NSDictionary *)stringifyTextParts:(NSDictionary *)_datas {
+- (NSDictionary *) stringifyTextParts: (NSDictionary *) _datas
+{
NSMutableDictionary *md;
NSEnumerator *keys;
NSString *key;
}
return md;
}
-- (NSDictionary *)fetchPlainTextStrings:(NSArray *)_fetchKeys {
+
+- (NSDictionary *) fetchPlainTextStrings: (NSArray *) _fetchKeys
+{
/*
The fetched parts are NSData objects, this method converts them into
NSString objects based on the information inside the bodystructure.
return [clazz objectWithName:_key inContainer: self];
}
-- (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 */
/* WebDAV */
-- (BOOL)davIsCollection {
+- (BOOL) davIsCollection
+{
/* while a mail has child objects, it should appear as a file in WebDAV */
return NO;
}
-- (id)davContentLength {
+- (id) davContentLength
+{
return [[self fetchCoreInfos] valueForKey: @"size"];
}
-- (NSDate *)davCreationDate {
+- (NSDate *) davCreationDate
+{
// TODO: use INTERNALDATE once NGImap4 supports that
return nil;
}
-- (NSDate *)davLastModified {
+
+- (NSDate *) davLastModified
+{
return [self davCreationDate];
}
-- (NSException *)davMoveToTargetObject:(id)_target newName:(NSString *)_name
- inContext:(id)_ctx
+- (NSException *) davMoveToTargetObject: (id) _target
+ newName: (NSString *) _name
+ inContext: (id)_ctx
{
[self logWithFormat: @"TODO: should move mail as '%@' to: %@",
_name, _target];
- return [NSException exceptionWithHTTPStatus:501 /* Not Implemented */
+ return [NSException exceptionWithHTTPStatus: 501 /* Not Implemented */
reason: @"not implemented"];
}
-- (NSException *)davCopyToTargetObject:(id)_target newName:(NSString *)_name
- inContext:(id)_ctx
+- (NSException *) davCopyToTargetObject: (id) _target
+ newName: (NSString *) _name
+ inContext: (id)_ctx
{
/*
Note: this is special because we create SOGoMailObject's even if they do
/* actions */
-- (id)GETAction:(id)_ctx {
+- (id) GETAction: (id) _ctx
+{
NSException *error;
WOResponse *r;
NSData *content;
/* operations */
-- (NSException *)trashInContext:(id)_ctx {
+- (NSException *) trashInContext: (id) _ctx
+{
/*
Trashing is three actions:
a) copy to trash folder
return nil;
}
-- (NSException *)delete {
+- (NSException *) delete
+{
/*
Note: delete is different to DELETEAction: for mails! The 'delete' runs
either flags a message as deleted or moves it to the Trash while
error = [[self imap4Connection] markURLDeleted:[self imap4URL]];
return error;
}
-- (id)DELETEAction:(id)_ctx {
+
+- (id) DELETEAction: (id) _ctx
+{
NSException *error;
// TODO: ensure safe HTTP method
/* some mail classification */
-- (BOOL)isKolabObject {
+- (BOOL) isKolabObject
+{
NSDictionary *h;
if ((h = [self mailHeaders]) != nil)
return NO;
}
-- (BOOL)isMailingListMail {
+- (BOOL) isMailingListMail
+{
NSDictionary *h;
if ((h = [self mailHeaders]) == nil)
return [[h objectForKey: @"list-id"] isNotEmpty];
}
-- (BOOL)isVirusScanned {
+- (BOOL) isVirusScanned
+{
NSDictionary *h;
if ((h = [self mailHeaders]) == nil)
return YES;
}
-- (NSString *)scanListHeaderValue:(id)_value
- forFieldWithPrefix:(NSString *)_prefix
+- (NSString *) scanListHeaderValue: (id) _value
+ forFieldWithPrefix: (NSString *) _prefix
{
/* Note: not very tolerant on embedded commands and <> */
// TODO: does not really belong here, should be a header-field-parser
return _value;
}
-- (NSString *)mailingListArchiveURL {
+- (NSString *) mailingListArchiveURL
+{
return [self scanListHeaderValue:
[[self mailHeaders] objectForKey: @"list-archive"]
forFieldWithPrefix: @"<http://"];
}
-- (NSString *)mailingListSubscribeURL {
+
+- (NSString *) mailingListSubscribeURL
+{
return [self scanListHeaderValue:
[[self mailHeaders] objectForKey: @"list-subscribe"]
forFieldWithPrefix: @"<http://"];
}
-- (NSString *)mailingListUnsubscribeURL {
+
+- (NSString *) mailingListUnsubscribeURL
+{
return [self scanListHeaderValue:
[[self mailHeaders] objectForKey: @"list-unsubscribe"]
forFieldWithPrefix: @"<http://"];
/* etag support */
-- (id)davEntityTag {
+- (id) davEntityTag
+{
/*
Note: There is one thing which *can* change for an existing message,
those are the IMAP4 flags (and annotations, which we do not use).
*/
return mailETag;
}
-- (int)zlGenerationCount {
+
+- (int) zlGenerationCount
+{
return 0; /* mails never change */
}
/* Outlook mail tagging */
-- (NSString *)outlookMessageClass {
+- (NSString *) outlookMessageClass
+{
NSString *type;
if ((type = [[self mailHeaders] objectForKey: @"x-kolab-type"]) != nil) {
/* debugging */
-- (BOOL)isDebuggingEnabled {
+- (BOOL) isDebuggingEnabled
+{
return debugOn;
}
- (NSArray *) mailAccounts;
- (NSArray *) allIdentities;
- (NSDictionary *) primaryIdentity;
+- (NSString *) messageForwarding;
/* folders */
#import <Foundation/NSUserDefaults.h>
#import <Foundation/NSValue.h>
#import <NGObjWeb/WOApplication.h>
+#import <NGObjWeb/WOContext.h>
+#import <NGObjWeb/WORequest.h>
#import <NGObjWeb/SoObject.h>
#import <NGExtensions/NSNull+misc.h>
- (NSString *) language
{
+ NSArray *bLanguages;
+ WOContext *context;
+
if (!language)
{
language = [[self userDefaults] stringForKey: @"Language"];
- if (!language)
+ if (![language length])
+ {
+ context = [[WOApplication application] context];
+ bLanguages = [[context request] browserLanguages];
+ if ([bLanguages count] > 0)
+ language = [bLanguages objectAtIndex: 0];
+ }
+ if (![language length])
language = defaultLanguage;
[language retain];
}
return [[defaultAccount objectForKey: @"identities"] objectAtIndex: 0];
}
+- (NSString *) messageForwarding
+{
+ NSString *messageForwarding;
+
+ messageForwarding
+ = [[self userDefaults] stringForKey: @"MessageForwarding"];
+ if (![messageForwarding length])
+ messageForwarding = @"attached";
+
+ return messageForwarding;
+}
+
/* folders */
// TODO: those methods should check whether the traversal stack in the context
"Out of Office" = "Out of Office";
"Date and Time" = "Date and Time";
"Calendar Options" = "Calendar Options";
+"Mail Options" = "Mail Options";
"Password" = "Password";
/* ooo */
"reminderTime_2400" = "1 day";
"reminderTime_4800" = "2 days";
+/* Mailer */
+"Forward messages:" = "Forward messages:";
+"messageforward_inline" = "Inline";
+"messageforward_attached" = "As Attachment";
+
/* password */
"New password:" = "New password:";
"Confirmation:" = "Confirmation:";
"Out of Office" = "Absence du bureau";
"Date and Time" = "Date et heure";
"Calendar Options" = "Calendrier";
+"Mail Options" = "Courrier";
"Password" = "Mot de passe";
/* ooo */
"reminderTime_2400" = "1 journée";
"reminderTime_4800" = "2 journées";
+/* Mailer */
+"Forward messages:" = "Transérer les messages :";
+"messageforward_inline" = "intégrés";
+"messageforward_attached" = "en pièces jointes";
+
/* password */
"New password:" = "Nouveau mot de passe :";
"Confirmation:" = "Confirmation :";
[userDefaults setObject: newTime forKey: @"ReminderTime"];
}
+/* Mailer */
+- (NSArray *) messageForwardingList
+{
+ return [NSArray arrayWithObjects: @"inline", @"attached", nil];
+}
+
+- (NSString *) itemMessageForwardingText
+{
+ return [self labelForKey:
+ [NSString stringWithFormat: @"messageforward_%@", item]];
+}
+
+- (NSString *) userMessageForwarding
+{
+ return [user messageForwarding];
+}
+
+- (void) setUserMessageForwarding: (NSString *) newMessageForwarding
+{
+ [userDefaults setObject: newMessageForwarding forKey: @"MessageForwarding"];
+}
+
- (id <WOActionResults>) defaultAction
{
id <WOActionResults> results;
SOGoJSStringFormatter.m \
WOContext+UIx.m \
\
- SOGoACLAdvisory.m \
- SOGoACLFrenchAdditionAdvisory.m \
- SOGoACLFrenchRemovalAdvisory.m \
- SOGoACLEnglishAdditionAdvisory.m \
- SOGoACLEnglishRemovalAdvisory.m
+ SOGoACLAdvisory.m
# make
@end
+@interface SOGoACLEnglishAdditionAdvisory : SOGoACLAdvisory
+@end
+
+@interface SOGoACLEnglishRemovalAdvisory : SOGoACLAdvisory
+@end
+
+@interface SOGoACLFrenchAdditionAdvisory : SOGoACLAdvisory
+@end
+
+@interface SOGoACLFrenchRemovalAdvisory : SOGoACLAdvisory
+@end
+
+@interface SOGoACLGermanAdditionAdvisory : SOGoACLAdvisory
+@end
+
+@interface SOGoACLGermanRemovalAdvisory : SOGoACLAdvisory
+@end
+
#endif /* SOGOACLADVISORY_H */
}
@end
+
+@implementation SOGoACLEnglishAdditionAdvisory
+@end
+
+@implementation SOGoACLEnglishRemovalAdvisory
+@end
+
+@implementation SOGoACLFrenchAdditionAdvisory
+@end
+
+@implementation SOGoACLFrenchRemovalAdvisory
+@end
+
+@implementation SOGoACLGermanAdditionAdvisory
+@end
+
+@implementation SOGoACLGermanRemovalAdvisory
+@end
+++ /dev/null
-/* SOGoACLEnglishAdditionAdvisory.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 SOGOACLFRENCHADDITIONADVISORY_H
-#define SOGOACLFRENCHADDITIONADVISORY_H
-
-#import "SOGoACLAdvisory.h"
-
-@interface SOGoACLEnglishAdditionAdvisory : SOGoACLAdvisory
-@end
-
-#endif /* SOGOACLFRENCHADDITIONADVISORY_H */
+++ /dev/null
-/* SOGoACLEnglishRemovalAdvisory.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 SOGOACLENGLISHREMOVALADVISORY_H
-#define SOGOACLENGLISHREMOVALADVISORY_H
-
-#import "SOGoACLAdvisory.h"
-
-@interface SOGoACLEnglishRemovalAdvisory : SOGoACLAdvisory
-@end
-
-#endif /* SOGOACLENGLISHREMOVALADVISORY_H */
+++ /dev/null
-/* SOGoACLEnglishRemovalAdvisory.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 "SOGoACLEnglishRemovalAdvisory.h"
-
-@implementation SOGoACLEnglishRemovalAdvisory
-
-- (NSString *) aclMethod
-{
- return @"add";
-}
-
-@end
+++ /dev/null
-/* SOGoACLFrenchAdditionAdvisory.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 SOGOACLFRENCHADDITIONADVISORY_H
-#define SOGOACLFRENCHADDITIONADVISORY_H
-
-#import "SOGoACLAdvisory.h"
-
-@interface SOGoACLFrenchAdditionAdvisory : SOGoACLAdvisory
-@end
-
-#endif /* SOGOACLFRENCHADDITIONADVISORY_H */
+++ /dev/null
-/* SOGoACLFrenchAdditionAdvisory.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 "SOGoACLFrenchAdditionAdvisory.h"
-
-@implementation SOGoACLFrenchAdditionAdvisory
-
-@end
+++ /dev/null
-/* SOGoACLFrenchRemovalAdvisory.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 SOGOACLFRENCHREMOVALADVISORY_H
-#define SOGOACLFRENCHREMOVALADVISORY_H
-
-#import "SOGoACLAdvisory.h"
-
-@interface SOGoACLFrenchRemovalAdvisory : SOGoACLAdvisory
-@end
-
-#endif /* SOGOACLFRENCHREMOVALADVISORY_H */
+++ /dev/null
-/* SOGoACLFrenchRemovalAdvisory.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 "SOGoACLFrenchRemovalAdvisory.h"
-
-@implementation SOGoACLFrenchRemovalAdvisory
-
-@end
queryParameters = [[NSMutableDictionary alloc] initWithCapacity:8];
- req = [[self context] request];
+ req = [context request];
uri = [req uri];
r = [uri rangeOfString:@"?" options:NSBackwardsSearch];
if (r.length > 0)
qp = [self queryParameters];
if ([qp count] > 0)
{
- ctx = [self context];
+ ctx = context;
qps = [ctx queryPathSeparator];
[ctx setQueryPathSeparator: @"&"];
qs = [ctx queryStringFromDictionary: qp];
NSString *uri;
NSRange r;
- uri = [[[self context] request] uri];
+ uri = [[context request] uri];
/* first: cut off query parameters */
SOGoObject *currentObject;
BOOL found;
- ctx = [self context];
+ ctx = context;
objects = [[ctx objectTraversalStack] objectEnumerator];
currentObject = [objects nextObject];
found = NO;
currentClient = parent;
}
- ctx = [self context];
+ ctx = context;
return [[currentClient baseURLInContext:ctx] hostlessURL];
}
NSString *uri;
NSRange r;
- uri = [[[self context] request] uri];
+ uri = [[context request] uri];
/* first: cut off query parameters */
{
WOContext *ctx;
- ctx = [self context];
+ ctx = context;
return [[[self clientObject] authenticatorInContext: ctx] userInContext: ctx];
}
/* lookup languages */
- languages = [[self context] resourceLookupLanguages];
+ languages = [context resourceLookupLanguages];
/* find resource manager */
// TODO: move to WORequest?
NSString *m;
- m = [[[self context] request] method];
+ m = [[context request] method];
if ([m isEqualToString:@"GET"]) return YES;
if ([m isEqualToString:@"HEAD"]) return YES;
return NO;
{
WOResourceManager *rm;
- if ((rm = [[[self context] page] resourceManager]) == nil)
+ if ((rm = [[context page] resourceManager]) == nil)
rm = [[WOApplication application] resourceManager];
return rm;
if (!url)
{
rm = [self pageResourceManager];
- page = [[self context] page];
+ page = [context page];
pageBundle = [NSBundle bundleForClass: [page class]];
url = [rm urlForResourceNamed: filename
inFramework: [pageBundle bundlePath]
languages: nil
- request: [[self context] request]];
+ request: [context request]];
if (!url)
url = @"";
else
</ul>
</div>
- <form name="pageform" enctype="multipart/form-data" accept-charset="UTF-8">
+ <form const:href="send" name="pageform" enctype="multipart/form-data">
<div id="headerArea">
<div id="attachmentsArea">
<var:string label:value="Attachments:" />
<var:popup name="currentPopUpId"
list="headers"
item="item"
- label:string="$item"
+ label:displayString="$item"
selection="currentHeader"
/>
</span>
const:disabled="1"
list="headers"
item="item"
- label:string="$item"
+ label:displayString="$item"
/>
</span>
<span class="headerInput">
label:value="Date and Time"/></li>
<li target="calendarOptionsView"><var:string
label:value="Calendar Options"/></li>
+ <li target="mailOptionsView"><var:string
+ label:value="Mail Options"/></li>
<var:if condition="shouldDisplayPasswordChange">
<li target="passwordView"><var:string label:value="Password"/></li>
</var:if>
<var:popup list="reminderTimesList" item="item"
string="itemReminderTimeText" selection="userReminderTime"/></label>
</div>
+ <div id="mailOptionsView" class="tab">
+ <label><var:string label:value="Forward messages:"/>
+ <var:popup list="messageForwardingList" item="item"
+ string="itemMessageForwardingText" selection="userMessageForwarding"/></label><br/>
+ </div>
<var:if condition="shouldDisplayPasswordChange">
<div id="passwordView" class="tab">
<label><var:string label:value="New password:"
--- /dev/null
+<?xml version="1.0" standalone="yes"?>
+<!DOCTYPE container>
+<container
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:var="http://www.skyrix.com/od/binding"
+ xmlns:const="http://www.skyrix.com/od/constant"
+ xmlns:rsrc="OGo:url"
+ xmlns:label="OGo:label">
+
+<var:if condition="isSubject">
+ Zugangserlaubniss von <var:string value="currentUserName"/> erstellt
+</var:if>
+
+<var:if condition="isBody">
+<var:string value="currentUserName"/> hat Ihnen den Zugang zu seinem Ordner '<var:string value="resourceName"/>' erlaubt.
+Folgende URL erlaubt Ihnen, sich sofort an diesem Ordner zu abonnieren:
+ <var:string value="httpAdvisoryURL"/>unsubscribe?mail-invitation=YES
+
+Sie können sich auch später immer noch durch die SOGo Webseiten abonnieren.
+</var:if>
+
+</container>
--- /dev/null
+<?xml version="1.0" standalone="yes"?>
+<!DOCTYPE container>
+<container
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:var="http://www.skyrix.com/od/binding"
+ xmlns:const="http://www.skyrix.com/od/constant"
+ xmlns:rsrc="OGo:url"
+ xmlns:label="OGo:label">
+
+<var:if condition="isSubject">
+ Zugangserlaubniss von <var:string value="currentUserName"/> gelöscht
+</var:if>
+
+<var:if condition="isBody">
+<var:string value="currentUserName"/> erlaubt Ihnen nicht mehr den Zugang zu seinem Order '<var:string value="resourceName"/>'.
+Sie können sich sofort an folgender URL von diesem Order des-abonnieren:
+ <var:string value="httpAdvisoryURL"/>unsubscribe?mail-invitation=YES
+
+Sich können sich auch später immer noch durch die SOGo Webseiten des-abonnieren.</var:if>
+
+</container>
DIV.mailer_plaincontent
{
font-family: monospace, fixed;
- white-space: normal;
+ white-space: pre;
font-size: inherit;
margin: 0px;
padding: 0px;