See ChangeLog

Monotone-Parent: 975e40192e290b5aa4bc5c5b99a12b299d84fa5a
Monotone-Revision: 740654a1f1be6a68843349cf438d5a87445f489e

Monotone-Author: ludovic@Sophos.ca
Monotone-Date: 2012-07-11T18:57:27
maint-2.0.2
Ludovic Marcotte 2012-07-11 18:57:27 +00:00
parent 6556c92c87
commit 2c987bae06
6 changed files with 65 additions and 88 deletions

View File

@ -8,6 +8,9 @@
show the notification options if it's a web calendar or if the active show the notification options if it's a web calendar or if the active
user isn't the owner of the calendar. user isn't the owner of the calendar.
* Added strings to translate and cleaned up the template to send
HTML mails instead of text/plain.
2012-07-09 Ludovic Marcotte <lmarcotte@inverse.ca> 2012-07-09 Ludovic Marcotte <lmarcotte@inverse.ca>
* Dropped old templates (SOGoAptMailDeletionReceipt.wox * Dropped old templates (SOGoAptMailDeletionReceipt.wox

View File

@ -11,18 +11,13 @@ vtodo_class2 = "(Confidential task)";
"Title:" = "Title:"; "Title:" = "Title:";
"Start:" = "Start:"; "Start:" = "Start:";
"End:" = "End:"; "End:" = "End:";
"Location:" = "Location:";
"Receipt: users invited to a meeting" = "Receipt: users invited to a meeting"; "Receipt: event was created" = "Receipt: event was created";
"You have invited the following attendees(s):" = "You have invited the following attendees(s):"; "Receipt: event was deleted" = "Receipt: event was deleted";
"... to attend the following event:" = "... to attend the following event:"; "Receipt: event was updated" = "Receipt: event was updated";
"The following attendees(s) were notified:" = "The following attendees(s) were notified:";
"Receipt: invitation updated" = "Receipt: invitation updated"; "The following attendees(s) were added:" = "The following attendees(s) were added:";
"The following attendees(s):" = "The following attendees(s):"; "The following attendees(s) were removed:" = "The following attendees(s) were removed:";
"... have been notified of the changes to the following event:" = "... have been notified of the changes to the following event:";
"Receipt: attendees removed from an event" = "Receipt: attendees removed from an event";
"You have removed the following attendees(s):" = "You have removed the following attendees(s):";
"... from the following event:" = "... from the following event:";
/* IMIP messages */ /* IMIP messages */
"startDate_label" = "Start:"; "startDate_label" = "Start:";

View File

@ -40,7 +40,6 @@
NSArray *updatedAttendees; NSArray *updatedAttendees;
iCalPerson *currentRecipient; iCalPerson *currentRecipient;
SOGoEventOperation operation; SOGoEventOperation operation;
BOOL isSubject;
} }
- (void) setOriginator: (NSString *) newOriginator; - (void) setOriginator: (NSString *) newOriginator;

View File

@ -31,6 +31,7 @@
#import <NGCards/iCalEvent.h> #import <NGCards/iCalEvent.h>
#import <NGCards/iCalPerson.h> #import <NGCards/iCalPerson.h>
#import <SOGo/NSObject+Utilities.h>
#import <SOGo/NSString+Utilities.h> #import <SOGo/NSString+Utilities.h>
#import <SOGo/SOGoUserManager.h> #import <SOGo/SOGoUserManager.h>
#import <SOGo/SOGoDateFormatter.h> #import <SOGo/SOGoDateFormatter.h>
@ -61,7 +62,6 @@ static NSCharacterSet *wsSet = nil;
addedAttendees = nil; addedAttendees = nil;
deletedAttendees = nil; deletedAttendees = nil;
updatedAttendees = nil; updatedAttendees = nil;
isSubject = NO;
} }
return self; return self;
@ -76,28 +76,6 @@ static NSCharacterSet *wsSet = nil;
[super dealloc]; [super dealloc];
} }
- (NSString *) getSubject
{
NSString *subject;
if (!values)
[self setupValues];
isSubject = YES;
subject = [[[self generateResponse] contentAsString]
stringByTrimmingCharactersInSet: wsSet];
if (!subject)
{
[self errorWithFormat:@"Failed to properly generate subject! Please check "
@"template for component '%@'!",
[self name]];
subject = @"ERROR: missing subject!";
}
return [subject asQPSubjectString: @"utf-8"];
}
- (NSString *) getBody - (NSString *) getBody
{ {
NSString *body; NSString *body;
@ -105,8 +83,6 @@ static NSCharacterSet *wsSet = nil;
if (!values) if (!values)
[self setupValues]; [self setupValues];
isSubject = NO;
body = [[self generateResponse] contentAsString]; body = [[self generateResponse] contentAsString];
return [body stringByTrimmingCharactersInSet: wsSet]; return [body stringByTrimmingCharactersInSet: wsSet];
@ -168,19 +144,19 @@ static NSCharacterSet *wsSet = nil;
switch (operation) switch (operation)
{ {
case EventCreated: case EventCreated:
s = @"Receipt: event was created"; s = [self labelForKey: @"Receipt: event was created" inContext: context];
break; break;
case EventDeleted: case EventDeleted:
s = @"Receipt: event was deleted"; s = [self labelForKey: @"Receipt: event was deleted" inContext: context];
break; break;
case EventUpdated: case EventUpdated:
default: default:
s = @"Receipt: event was updated"; s = [self labelForKey: @"Receipt: event was updated" inContext: context];
} }
return s; return [[s stringByTrimmingCharactersInSet: wsSet] asQPSubjectString: @"utf-8"];
} }
- (NSString *) _formattedUserDate: (NSCalendarDate *) date - (NSString *) _formattedUserDate: (NSCalendarDate *) date

View File

@ -1048,9 +1048,9 @@ static inline BOOL _occurenceHasID (iCalRepeatableEntityObject *occurence,
mailDate = [[NSCalendarDate date] rfc822DateString]; mailDate = [[NSCalendarDate date] rfc822DateString];
[headerMap setObject: mailDate forKey: @"date"]; [headerMap setObject: mailDate forKey: @"date"];
[headerMap setObject: [page getSubject] forKey: @"subject"]; [headerMap setObject: [page subject] forKey: @"subject"];
[headerMap setObject: @"1.0" forKey: @"MIME-Version"]; [headerMap setObject: @"1.0" forKey: @"MIME-Version"];
[headerMap setObject: @"text/plain; charset=utf-8" [headerMap setObject: @"text/html; charset=utf-8"
forKey: @"content-type"]; forKey: @"content-type"];
msg = [NGMimeMessage messageWithHeader: headerMap]; msg = [NGMimeMessage messageWithHeader: headerMap];

View File

@ -1,54 +1,58 @@
<?xml version="1.0" standalone="yes"?> <?xml version="1.0" standalone="yes"?>
<!DOCTYPE container> <!DOCTYPE container>
<container <html
xmlns="http://www.w3.org/1999/xhtml" xmlns="http://www.w3.org/1999/xhtml"
xmlns:var="http://www.skyrix.com/od/binding" xmlns:var="http://www.skyrix.com/od/binding"
xmlns:const="http://www.skyrix.com/od/constant" xmlns:const="http://www.skyrix.com/od/constant"
xmlns:rsrc="OGo:url" xmlns:rsrc="OGo:url"
xmlns:label="OGo:label"> xmlns:label="OGo:label">
<var:if condition="isSubject"> <var:string label:value="Event details:" const:escapeHTML="NO"/>
<var:string value="subject" <br/>
const:escapeHTML="NO"/>
<var:string label:value="Title:" const:escapeHTML="NO"/> <var:string
value="apt.summary" const:escapeHTML="NO"/>
<br/>
<var:if condition="apt.location.length">
<var:string label:value="Location:" const:escapeHTML="NO"/> <var:string
value="apt.location" const:escapeHTML="NO"/>
</var:if> </var:if>
<br/>
<var:if condition="isSubject" const:negate="YES">
<var:string label:value="Event details:" const:escapeHTML="NO"/> <var:string label:value="Start:" const:escapeHTML="NO"/> <var:string
value="aptStartDate" const:escapeHTML="NO"/>
<var:string label:value="Title:" const:escapeHTML="NO"/> <var:string <br/>
value="apt.summary" const:escapeHTML="NO"/>
<var:if condition="apt.location.length"> <var:string label:value="End:" const:escapeHTML="NO"/> <var:string
<var:string label:value="Location:" const:escapeHTML="NO"/> <var:string value="aptEndDate" const:escapeHTML="NO"/>
value="apt.location" const:escapeHTML="NO"/> <br/>
</var:if>
<var:string label:value="Start:" const:escapeHTML="NO"/> <var:string <var:if condition="updatedAttendees.count">
value="aptStartDate" const:escapeHTML="NO"/> <var:string label:value="The following attendees(s) were notified:"
<var:string label:value="End:" const:escapeHTML="NO"/> <var:string const:escapeHTML="NO"/>
value="aptEndDate" const:escapeHTML="NO"/> <var:foreach list="updatedAttendees" item="currentRecipient">
<var:string value="currentRecipient.mailAddress" const:escapeHTML="NO"
<var:if condition="updatedAttendees.count"> /></var:foreach>
<var:string label:value="The following attendees(s) were notified:"
const:escapeHTML="NO"/>
<var:foreach list="updatedAttendees" item="currentRecipient">
<var:string value="currentRecipient.mailAddress" const:escapeHTML="NO"
/></var:foreach>
</var:if>
<var:if condition="addedAttendees.count">
<var:string label:value="The following attendees(s) were added:"
const:escapeHTML="NO"/>
<var:foreach list="addedAttendees" item="currentRecipient">
<var:string value="currentRecipient.mailAddress" const:escapeHTML="NO"
/></var:foreach>
</var:if>
<var:if condition="deletedAttendees.count">
<var:string label:value="The following attendees(s) were removed:"
const:escapeHTML="NO"/>
<var:foreach list="deletedAttendees" item="currentRecipient">
<var:string value="currentRecipient.mailAddress" const:escapeHTML="NO"
/></var:foreach>
</var:if>
</var:if> </var:if>
</container> <br/>
<var:if condition="addedAttendees.count">
<var:string label:value="The following attendees(s) were added:"
const:escapeHTML="NO"/>
<var:foreach list="addedAttendees" item="currentRecipient">
<var:string value="currentRecipient.mailAddress" const:escapeHTML="NO"
/></var:foreach>
</var:if>
<br/>
<var:if condition="deletedAttendees.count">
<var:string label:value="The following attendees(s) were removed:"
const:escapeHTML="NO"/>
<var:foreach list="deletedAttendees" item="currentRecipient">
<var:string value="currentRecipient.mailAddress" const:escapeHTML="NO"
/></var:foreach>
</var:if>
<br/>
</html>