diff --git a/ChangeLog b/ChangeLog index 4c51a0287..2627ab8f2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2007-08-22 Wolfgang Sourdeau + + * 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 * UI/SOGoElements/SOGoIEConditional.m: new extension module class diff --git a/SoObjects/Mailer/SOGoMailEnglishForward.m b/SoObjects/Mailer/SOGoMailEnglishForward.m new file mode 100644 index 000000000..73e2b50e0 --- /dev/null +++ b/SoObjects/Mailer/SOGoMailEnglishForward.m @@ -0,0 +1,29 @@ +/* SOGoMailEnglishForward.m - this file is part of SOGo + * + * Copyright (C) 2007 Inverse groupe conseil + * + * Author: Wolfgang Sourdeau + * + * 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 "SOGoMailForward.h" + +@interface SOGoMailEnglishForward : SOGoMailForward +@end + +@implementation SOGoMailEnglishForward +@end diff --git a/SoObjects/Mailer/SOGoMailEnglishForward.wo/SOGoMailEnglishForward.html b/SoObjects/Mailer/SOGoMailEnglishForward.wo/SOGoMailEnglishForward.html new file mode 100644 index 000000000..c1b652eb6 --- /dev/null +++ b/SoObjects/Mailer/SOGoMailEnglishForward.wo/SOGoMailEnglishForward.html @@ -0,0 +1,8 @@ +-------- Original Message -------- +Subject: <#subject/> +Date: <#date/> +From: <#from/> +<#hasReplyTo>Reply-To: <#replyTo/><#hasOrganization>Organization: <#organization/>To: <#to/> +<#hasCc>CC: <#cc/><#hasNewsGroups>Newsgroups: <#newsgroups/><#hasReferences>References: <#references/> + +<#messageBody/> diff --git a/SoObjects/Mailer/SOGoMailEnglishForward.wo/SOGoMailEnglishForward.wod b/SoObjects/Mailer/SOGoMailEnglishForward.wo/SOGoMailEnglishForward.wod new file mode 100644 index 000000000..517bc8cc1 --- /dev/null +++ b/SoObjects/Mailer/SOGoMailEnglishForward.wo/SOGoMailEnglishForward.wod @@ -0,0 +1,69 @@ +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; +} diff --git a/SoObjects/Mailer/SOGoMailForward.h b/SoObjects/Mailer/SOGoMailForward.h new file mode 100644 index 000000000..6ad18c018 --- /dev/null +++ b/SoObjects/Mailer/SOGoMailForward.h @@ -0,0 +1,41 @@ +/* SOGoMailForward.h - this file is part of SOGo + * + * Copyright (C) 2007 Inverse groupe conseil + * + * Author: Wolfgang Sourdeau + * + * 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 SOGOMAILFORWARD_H +#define SOGOMAILFORWARD_H + +#import + +@class SOGoMailObject; + +@interface SOGoMailForward : SoComponent +{ + SOGoMailObject *sourceMail; + NSString *field; + NSString *currentValue; +} + +- (void) setForwardedMail: (SOGoMailObject *) newSourceMail; + +@end + +#endif /* SOGOMAILFORWARD_H */ diff --git a/SoObjects/Mailer/SOGoMailForward.m b/SoObjects/Mailer/SOGoMailForward.m new file mode 100644 index 000000000..a09db3736 --- /dev/null +++ b/SoObjects/Mailer/SOGoMailForward.m @@ -0,0 +1,152 @@ +/* SOGoMailForward.m - this file is part of SOGo + * + * Copyright (C) 2007 Inverse groupe conseil + * + * Author: Wolfgang Sourdeau + * + * 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 + +#import +#import + +#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 diff --git a/SoObjects/Mailer/SOGoMailFrenchForward.m b/SoObjects/Mailer/SOGoMailFrenchForward.m new file mode 100644 index 000000000..cb229b0a4 --- /dev/null +++ b/SoObjects/Mailer/SOGoMailFrenchForward.m @@ -0,0 +1,29 @@ +/* SOGoMailFrenchForward.m - this file is part of SOGo + * + * Copyright (C) 2007 Inverse groupe conseil + * + * Author: Wolfgang Sourdeau + * + * 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 "SOGoMailForward.h" + +@interface SOGoMailFrenchForward : SOGoMailForward +@end + +@implementation SOGoMailFrenchForward +@end diff --git a/SoObjects/Mailer/SOGoMailFrenchForward.wo/SOGoMailFrenchForward.html b/SoObjects/Mailer/SOGoMailFrenchForward.wo/SOGoMailFrenchForward.html new file mode 100644 index 000000000..3ae60f74c --- /dev/null +++ b/SoObjects/Mailer/SOGoMailFrenchForward.wo/SOGoMailFrenchForward.html @@ -0,0 +1,8 @@ +-------- Message original -------- +Sujet: <#subject/> +Date: <#date/> +De: <#from/> +<#hasReplyTo>Répondre à: <#replyTo/><#hasOrganization>Organisation: <#organization/>Pour: <#to/> +<#hasCc>Copie: <#cc/><#hasNewsGroups>Forums de discussion: <#newsgroups/><#hasReferences>Références: <#references/> + +<#messageBody/> diff --git a/SoObjects/Mailer/SOGoMailFrenchForward.wo/SOGoMailFrenchForward.wod b/SoObjects/Mailer/SOGoMailFrenchForward.wo/SOGoMailFrenchForward.wod new file mode 100644 index 000000000..517bc8cc1 --- /dev/null +++ b/SoObjects/Mailer/SOGoMailFrenchForward.wo/SOGoMailFrenchForward.wod @@ -0,0 +1,69 @@ +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; +}