Add a header and/or footer to the vacation message

Fixes #1961
This commit is contained in:
Francis Lachapelle
2016-06-14 14:10:17 -04:00
parent 7f4474f47c
commit 4744170628
13 changed files with 259 additions and 7 deletions
+35
View File
@@ -41,6 +41,7 @@
#import <SOGo/SOGoSystemDefaults.h>
#import <SOGo/SOGoUserFolder.h>
#import <SOGo/SOGoParentFolder.h>
#import <SOGo/SOGoTextTemplateFile.h>
#import <SOGo/WOResourceManager+SOGo.h>
#import <SOGo/SOGoBuild.h>
#import <Mailer/SOGoMailAccount.h>
@@ -1103,6 +1104,40 @@ static NSArray *reminderValues = nil;
return [[user domainDefaults] vacationEnabled];
}
- (NSString *) vacationHeader
{
NSString *path;
path = [[user domainDefaults] vacationHeaderTemplateFile];
return [self _vacationTextForTemplate: path];
}
- (NSString *) vacationFooter
{
NSString *path;
path = [[user domainDefaults] vacationFooterTemplateFile];
return [self _vacationTextForTemplate: path];
}
- (NSString *) _vacationTextForTemplate: (NSString *) templateFilePath
{
NSString *text;
SOGoTextTemplateFile *templateFile;
text = nil;
if (templateFilePath)
{
templateFile = [SOGoTextTemplateFile textTemplateFromFile: templateFilePath];
if (templateFile)
text = [templateFile textForUser: user];
}
return text;
}
// - (void) setSieveFiltersValue: (NSString *) newValue
// {
// sieveFilters = [newValue objectFromJSONString];