From 2c987bae06ff8934c60ca19bc56a2e4a26c5d7cc Mon Sep 17 00:00:00 2001 From: Ludovic Marcotte Date: Wed, 11 Jul 2012 18:57:27 +0000 Subject: [PATCH] See ChangeLog Monotone-Parent: 975e40192e290b5aa4bc5c5b99a12b299d84fa5a Monotone-Revision: 740654a1f1be6a68843349cf438d5a87445f489e Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2012-07-11T18:57:27 --- ChangeLog | 3 + .../English.lproj/Localizable.strings | 19 ++-- SoObjects/Appointments/SOGoAptMailReceipt.h | 1 - SoObjects/Appointments/SOGoAptMailReceipt.m | 34 +------ .../Appointments/SOGoCalendarComponent.m | 4 +- .../Appointments/SOGoAptMailReceipt.wox | 92 ++++++++++--------- 6 files changed, 65 insertions(+), 88 deletions(-) diff --git a/ChangeLog b/ChangeLog index cb773ecb3..f5169a820 100644 --- a/ChangeLog +++ b/ChangeLog @@ -8,6 +8,9 @@ show the notification options if it's a web calendar or if the active 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 * Dropped old templates (SOGoAptMailDeletionReceipt.wox diff --git a/SoObjects/Appointments/English.lproj/Localizable.strings b/SoObjects/Appointments/English.lproj/Localizable.strings index 6de15e75b..9d73efbc0 100644 --- a/SoObjects/Appointments/English.lproj/Localizable.strings +++ b/SoObjects/Appointments/English.lproj/Localizable.strings @@ -11,18 +11,13 @@ vtodo_class2 = "(Confidential task)"; "Title:" = "Title:"; "Start:" = "Start:"; "End:" = "End:"; - -"Receipt: users invited to a meeting" = "Receipt: users invited to a meeting"; -"You have invited the following attendees(s):" = "You have invited the following attendees(s):"; -"... to attend the following event:" = "... to attend the following event:"; - -"Receipt: invitation updated" = "Receipt: invitation updated"; -"The following attendees(s):" = "The following attendees(s):"; -"... 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:"; +"Location:" = "Location:"; +"Receipt: event was created" = "Receipt: event was created"; +"Receipt: event was deleted" = "Receipt: event was deleted"; +"Receipt: event was updated" = "Receipt: event was updated"; +"The following attendees(s) were notified:" = "The following attendees(s) were notified:"; +"The following attendees(s) were added:" = "The following attendees(s) were added:"; +"The following attendees(s) were removed:" = "The following attendees(s) were removed:"; /* IMIP messages */ "startDate_label" = "Start:"; diff --git a/SoObjects/Appointments/SOGoAptMailReceipt.h b/SoObjects/Appointments/SOGoAptMailReceipt.h index dcc6fea6e..8c4d613f2 100644 --- a/SoObjects/Appointments/SOGoAptMailReceipt.h +++ b/SoObjects/Appointments/SOGoAptMailReceipt.h @@ -40,7 +40,6 @@ NSArray *updatedAttendees; iCalPerson *currentRecipient; SOGoEventOperation operation; - BOOL isSubject; } - (void) setOriginator: (NSString *) newOriginator; diff --git a/SoObjects/Appointments/SOGoAptMailReceipt.m b/SoObjects/Appointments/SOGoAptMailReceipt.m index 0cd5bf379..7998f3739 100644 --- a/SoObjects/Appointments/SOGoAptMailReceipt.m +++ b/SoObjects/Appointments/SOGoAptMailReceipt.m @@ -31,6 +31,7 @@ #import #import +#import #import #import #import @@ -61,7 +62,6 @@ static NSCharacterSet *wsSet = nil; addedAttendees = nil; deletedAttendees = nil; updatedAttendees = nil; - isSubject = NO; } return self; @@ -76,28 +76,6 @@ static NSCharacterSet *wsSet = nil; [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 *body; @@ -105,8 +83,6 @@ static NSCharacterSet *wsSet = nil; if (!values) [self setupValues]; - isSubject = NO; - body = [[self generateResponse] contentAsString]; return [body stringByTrimmingCharactersInSet: wsSet]; @@ -168,19 +144,19 @@ static NSCharacterSet *wsSet = nil; switch (operation) { case EventCreated: - s = @"Receipt: event was created"; + s = [self labelForKey: @"Receipt: event was created" inContext: context]; break; case EventDeleted: - s = @"Receipt: event was deleted"; + s = [self labelForKey: @"Receipt: event was deleted" inContext: context]; break; case EventUpdated: 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 diff --git a/SoObjects/Appointments/SOGoCalendarComponent.m b/SoObjects/Appointments/SOGoCalendarComponent.m index c8aa91219..1385cbe9c 100644 --- a/SoObjects/Appointments/SOGoCalendarComponent.m +++ b/SoObjects/Appointments/SOGoCalendarComponent.m @@ -1048,9 +1048,9 @@ static inline BOOL _occurenceHasID (iCalRepeatableEntityObject *occurence, mailDate = [[NSCalendarDate date] rfc822DateString]; [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: @"text/plain; charset=utf-8" + [headerMap setObject: @"text/html; charset=utf-8" forKey: @"content-type"]; msg = [NGMimeMessage messageWithHeader: headerMap]; diff --git a/UI/Templates/Appointments/SOGoAptMailReceipt.wox b/UI/Templates/Appointments/SOGoAptMailReceipt.wox index 49e7490ed..e3b206817 100644 --- a/UI/Templates/Appointments/SOGoAptMailReceipt.wox +++ b/UI/Templates/Appointments/SOGoAptMailReceipt.wox @@ -1,54 +1,58 @@ - - - + +
+ + +
+ + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
+ + +
+ + +
+ + + + + -
+
+ + + + + + +
+ + + + + + +
+ +