mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-04-23 05:49:31 +00:00
Added web elements to set an auto-reply message and forward address in the preferences window.
Monotone-Parent: 3862a22ce756fbd4c559e0d9a9a211821d9c597b Monotone-Revision: baa7bc0bc74871932c7f4e4d759f25a216d0c939 Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2009-10-09T20:30:42 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -6,6 +6,9 @@
|
||||
"General" = "General";
|
||||
"Calendar Options" = "Calendar Options";
|
||||
"Mail Options" = "Mail Options";
|
||||
"Signature" = "Signature";
|
||||
"Vacation" = "Vacation";
|
||||
"Forward" = "Forward";
|
||||
"Identities" = "Identities";
|
||||
"Password" = "Password";
|
||||
"Categories" = "Categories";
|
||||
@@ -14,11 +17,21 @@
|
||||
"Add" = "Add";
|
||||
"Delete" = "Delete";
|
||||
|
||||
/* ooo */
|
||||
"I'm currently in the office" = "I'm currently in the office";
|
||||
"I'm currently out of the office" = "I'm currently out of the office";
|
||||
"AutoReply only once to each sender with the following text :"
|
||||
= "AutoReply only once to each sender with the following text :";
|
||||
/* vacation (auto-reply) */
|
||||
"Enable vacation auto reply" = "Enable vacation auto reply";
|
||||
"Auto reply message :" = "Auto reply message :";
|
||||
"Email addresses (separated by commas) :" = "Email addresses (separated by commas) :";
|
||||
"Days between responses :" = "Days between responses :";
|
||||
"Do not send responses to mailing lists" = "Do not send responses to mailing lists";
|
||||
"Please specify your message and your email addresses for which you want to enable auto reply."
|
||||
= "Please specify your message and your email addresses for which you want to enable auto reply.";
|
||||
|
||||
/* forward messages */
|
||||
"Forward incoming messages" = "Forward incoming messages";
|
||||
"Forward to address :" = "Forward to address :";
|
||||
"Keep a copy" = "Keep a copy";
|
||||
"Please specify an address to which you want to forward your messages."
|
||||
= "Please specify an address to which you want to forward your messages.";
|
||||
|
||||
/* d & t */
|
||||
"Current Time Zone :" = "Current Time Zone :";
|
||||
@@ -108,7 +121,6 @@
|
||||
/* Identities */
|
||||
"Default identity:" = "Default identity:";
|
||||
"Manage identities..." = "Manage identities...";
|
||||
"Signature" = "Signature";
|
||||
"replyplacement_above" = "Start my reply above the quote";
|
||||
"replyplacement_below" = "Start my reply below the quote";
|
||||
"And place my signature" = "And place my signature";
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
"General" = "Général";
|
||||
"Calendar Options" = "Calendrier";
|
||||
"Mail Options" = "Courrier";
|
||||
"Vacation" = "Absence prolongée";
|
||||
"Forward" = "Transfert";
|
||||
"Identities" = "Identités";
|
||||
"Password" = "Mot de passe";
|
||||
"Categories" = "Catégories";
|
||||
@@ -14,11 +16,21 @@
|
||||
"Add" = "Ajouter";
|
||||
"Delete" = "Supprimer";
|
||||
|
||||
/* ooo */
|
||||
"I'm currently in the office" = "Je suis présent";
|
||||
"I'm currently out of the office" = "Je suis absent";
|
||||
"AutoReply only once to each sender with the following text :"
|
||||
= "Répondre automatiquement avec le texte suivant, une seule fois par expéditeur :";
|
||||
/* vacation (auto-reply) */
|
||||
"Enable vacation auto reply" = "Enable vacation auto reply";
|
||||
"Auto reply message :" = "Auto reply message :";
|
||||
"Email addresses (separated by commas) :" = "Email addresses (separated by commas) :";
|
||||
"Days between responses :" = "Days between responses :";
|
||||
"Do not send responses to mailing lists" = "Do not send responses to mailing lists";
|
||||
"Please specify your message and your email addresses for which you want to enable auto reply."
|
||||
= "Veuillez définir un message et vos adresses pour lesquelles pour désirez activer une réponse automatique.";
|
||||
|
||||
/* forward messages */
|
||||
"Forward incoming messages" = "Forward incoming messages";
|
||||
"Forward to address :" = "Forward to address :";
|
||||
"Keep a copy" = "Keep a copy";
|
||||
"Please specify an address to which you want to forward your messages."
|
||||
= "Veuillez définir une adresse à laquelle vous désirez transférer automatiquement vos nouveaux messages.";
|
||||
|
||||
/* d & t */
|
||||
"Current Time Zone :" = "Fuseau horaire en cours :";
|
||||
@@ -26,6 +38,8 @@
|
||||
"Long Date Format :" = "Style de date longue :";
|
||||
"Time Format :" = "Style de l'heure :";
|
||||
|
||||
"default" = "Défaut";
|
||||
|
||||
"shortDateFmt_0" = "%d-%b-%y";
|
||||
|
||||
"shortDateFmt_1" = "%d-%m-%y";
|
||||
|
||||
@@ -38,7 +38,8 @@
|
||||
NSUserDefaults *userDefaults;
|
||||
NSCalendarDate *today;
|
||||
NSMutableArray *hours;
|
||||
NSArray *daysOfWeek;
|
||||
NSArray *daysOfWeek, *daysBetweenResponsesList;
|
||||
NSMutableDictionary *vacationOptions, *forwardOptions;
|
||||
BOOL hasChanged, composeMessageTypeHasChanged;
|
||||
}
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#import <Foundation/NSTimeZone.h>
|
||||
#import <Foundation/NSUserDefaults.h>
|
||||
#import <Foundation/NSPropertyList.h>
|
||||
#import <Foundation/NSValue.h>
|
||||
|
||||
#import <NGObjWeb/WOContext.h>
|
||||
#import <NGObjWeb/WORequest.h>
|
||||
@@ -48,6 +49,8 @@ static BOOL defaultsRead = NO;
|
||||
static BOOL shouldDisplayPasswordChange = NO;
|
||||
static BOOL shouldDisplayAdditionalPreferences = NO;
|
||||
static BOOL defaultShowSubscribedFoldersOnly = NO;
|
||||
static BOOL vacationEnabled = NO;
|
||||
static BOOL forwardEnabled = NO;
|
||||
|
||||
@implementation UIxPreferences
|
||||
|
||||
@@ -64,6 +67,10 @@ static BOOL defaultShowSubscribedFoldersOnly = NO;
|
||||
= [ud boolForKey: @"SOGoUIxAdditionalPreferences"];
|
||||
defaultShowSubscribedFoldersOnly
|
||||
= [ud boolForKey: @"SOGoMailShowSubscribedFoldersOnly"];
|
||||
vacationEnabled
|
||||
= [ud boolForKey: @"SOGoVacationEnabled"];
|
||||
forwardEnabled
|
||||
= [ud boolForKey: @"SOGoForwardEnabled"];
|
||||
defaultsRead = YES;
|
||||
}
|
||||
}
|
||||
@@ -88,6 +95,25 @@ static BOOL defaultShowSubscribedFoldersOnly = NO;
|
||||
[locale objectForKey: NSWeekDayNameArray]);
|
||||
hasChanged = NO;
|
||||
composeMessageTypeHasChanged = NO;
|
||||
|
||||
if (vacationEnabled)
|
||||
{
|
||||
vacationOptions = [userDefaults objectForKey: @"Vacation"];
|
||||
if (!vacationOptions)
|
||||
{
|
||||
vacationOptions = [NSMutableDictionary dictionary];
|
||||
[userDefaults setObject: vacationOptions forKey: @"Vacation"];
|
||||
}
|
||||
}
|
||||
if (forwardEnabled)
|
||||
{
|
||||
forwardOptions = [userDefaults objectForKey: @"Forward"];
|
||||
if (!forwardOptions)
|
||||
{
|
||||
forwardOptions = [NSMutableDictionary dictionary];
|
||||
[userDefaults setObject: forwardOptions forKey: @"Forward"];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return self;
|
||||
@@ -125,31 +151,6 @@ static BOOL defaultShowSubscribedFoldersOnly = NO;
|
||||
return item;
|
||||
}
|
||||
|
||||
- (NSString *) inTheOffice
|
||||
{
|
||||
NSString *inTheOffice;
|
||||
|
||||
inTheOffice = [userDefaults objectForKey: @"InTheOffice"];
|
||||
|
||||
return ((!inTheOffice || [inTheOffice boolValue])
|
||||
? @"YES" : @"NO");
|
||||
}
|
||||
|
||||
- (void) setInTheOffice: (NSString *) newValue
|
||||
{
|
||||
[userDefaults setObject: newValue forKey: @"InTheOffice"];
|
||||
}
|
||||
|
||||
- (void) setAutoReplyText: (NSString *) newAutoReplyText
|
||||
{
|
||||
[userDefaults setObject: newAutoReplyText forKey: @"AutoReplyText"];
|
||||
}
|
||||
|
||||
- (NSString *) autoReplyText
|
||||
{
|
||||
return [userDefaults objectForKey: @"AutoReplyText"];
|
||||
}
|
||||
|
||||
- (NSArray *) timeZonesList
|
||||
{
|
||||
return [[NSTimeZone knownTimeZoneNames]
|
||||
@@ -504,10 +505,7 @@ static BOOL defaultShowSubscribedFoldersOnly = NO;
|
||||
/* Mailer */
|
||||
- (void) setShowSubscribedFoldersOnly: (BOOL) showSubscribedFoldersOnly
|
||||
{
|
||||
if (showSubscribedFoldersOnly)
|
||||
[userDefaults setBool: YES forKey: @"showSubscribedFoldersOnly"];
|
||||
else
|
||||
[userDefaults setBool: NO forKey: @"showSubscribedFoldersOnly"];
|
||||
[userDefaults setBool: showSubscribedFoldersOnly forKey: @"showSubscribedFoldersOnly"]; // should be capitalized ..
|
||||
}
|
||||
|
||||
- (BOOL) showSubscribedFoldersOnly
|
||||
@@ -696,12 +694,168 @@ static BOOL defaultShowSubscribedFoldersOnly = NO;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
- (void) setUserSignaturePlacement: (NSString *) newSignaturePlacement
|
||||
{
|
||||
[userDefaults setObject: newSignaturePlacement forKey: @"SignaturePlacement"];
|
||||
}
|
||||
|
||||
/* mail autoreply (vacation) */
|
||||
|
||||
- (BOOL) isVacationEnabled
|
||||
{
|
||||
return vacationEnabled;
|
||||
}
|
||||
|
||||
- (void) setEnableVacation: (BOOL) enableVacation
|
||||
{
|
||||
[vacationOptions setObject: [NSNumber numberWithBool: enableVacation]
|
||||
forKey: @"enabled"];
|
||||
}
|
||||
|
||||
- (BOOL) enableVacation
|
||||
{
|
||||
return [[vacationOptions objectForKey: @"enabled"] boolValue];
|
||||
}
|
||||
|
||||
- (void) setAutoReplyText: (NSString *) theText
|
||||
{
|
||||
[vacationOptions setObject: theText
|
||||
forKey: @"autoReplyText"];
|
||||
}
|
||||
|
||||
- (NSString *) autoReplyText
|
||||
{
|
||||
return [vacationOptions objectForKey: @"autoReplyText"];
|
||||
}
|
||||
|
||||
- (void) setAutoReplyEmailAddresses: (NSString *) theAddresses
|
||||
{
|
||||
NSArray *addresses;
|
||||
|
||||
addresses = [[theAddresses componentsSeparatedByString: @","] trimmedComponents];
|
||||
|
||||
[vacationOptions setObject: addresses
|
||||
forKey: @"autoReplyEmailAddresses"];
|
||||
}
|
||||
|
||||
- (NSString *) autoReplyEmailAddresses
|
||||
{
|
||||
NSArray *addressesList;
|
||||
NSMutableArray *newAddressesList;
|
||||
NSString *address;
|
||||
unsigned int i;
|
||||
|
||||
addressesList = [vacationOptions objectForKey: @"autoReplyEmailAddresses"];
|
||||
if (!addressesList)
|
||||
{
|
||||
newAddressesList = [NSMutableArray new];
|
||||
[newAddressesList autorelease];
|
||||
addressesList = [NSMutableArray arrayWithArray: [user allEmails]];
|
||||
for (i = 0; i < [addressesList count]; i++)
|
||||
{
|
||||
address = [addressesList objectAtIndex: i];
|
||||
if (![newAddressesList containsObject: address])
|
||||
[newAddressesList addObject: address];
|
||||
}
|
||||
addressesList = newAddressesList;
|
||||
}
|
||||
|
||||
return [addressesList componentsJoinedByString: @", "];
|
||||
}
|
||||
|
||||
- (NSArray *) daysBetweenResponsesList
|
||||
{
|
||||
static NSArray* daysBetweenResponses = nil;
|
||||
|
||||
if (!daysBetweenResponses)
|
||||
{
|
||||
daysBetweenResponses = [NSArray arrayWithObjects: @"1", @"2", @"3", @"5", @"7", @"14", @"21", @"30", nil];
|
||||
[daysBetweenResponses retain];
|
||||
}
|
||||
|
||||
return daysBetweenResponses;
|
||||
}
|
||||
|
||||
- (void) setDaysBetweenResponses: (NSNumber *) theDays
|
||||
{
|
||||
[vacationOptions setObject: theDays
|
||||
forKey: @"daysBetweenResponse"];
|
||||
}
|
||||
|
||||
- (NSString *) daysBetweenResponses
|
||||
{
|
||||
NSString *days;
|
||||
|
||||
days = [vacationOptions objectForKey: @"daysBetweenResponse"];
|
||||
if (!days)
|
||||
days = @"7"; // defaults to 7 days
|
||||
|
||||
return days;
|
||||
}
|
||||
|
||||
- (void) setIgnoreLists: (BOOL) ignoreLists
|
||||
{
|
||||
[vacationOptions setObject: [NSNumber numberWithBool: ignoreLists]
|
||||
forKey: @"ignoreLists"];
|
||||
}
|
||||
|
||||
- (BOOL) ignoreLists
|
||||
{
|
||||
NSNumber *obj;
|
||||
BOOL ignore;
|
||||
|
||||
obj = [vacationOptions objectForKey: @"ignoreLists"];
|
||||
|
||||
if (obj == nil)
|
||||
ignore = YES; // defaults to true
|
||||
else
|
||||
ignore = [obj boolValue];
|
||||
|
||||
return ignore;
|
||||
}
|
||||
|
||||
/* mail forward */
|
||||
|
||||
- (BOOL) isForwardEnabled
|
||||
{
|
||||
return forwardEnabled;
|
||||
}
|
||||
|
||||
- (void) setEnableForward: (BOOL) enableForward
|
||||
{
|
||||
[forwardOptions setObject: [NSNumber numberWithBool: enableForward]
|
||||
forKey: @"enabled"];
|
||||
}
|
||||
|
||||
- (BOOL) enableForward
|
||||
{
|
||||
return [[forwardOptions objectForKey: @"enabled"] boolValue];
|
||||
}
|
||||
|
||||
- (void) setForwardAddress: (NSString *) forwardAddress
|
||||
{
|
||||
[forwardOptions setObject: forwardAddress
|
||||
forKey: @"forwardAddress"];
|
||||
}
|
||||
|
||||
- (NSString *) forwardAddress
|
||||
{
|
||||
return [forwardOptions objectForKey: @"forwardAddress"];
|
||||
}
|
||||
|
||||
- (void) setForwardKeepCopy: (BOOL) keepCopy
|
||||
{
|
||||
[forwardOptions setObject: [NSNumber numberWithBool: keepCopy]
|
||||
forKey: @"keepCopy"];
|
||||
}
|
||||
|
||||
- (BOOL) forwardKeepCopy
|
||||
{
|
||||
return [[forwardOptions objectForKey: @"keepCopy"] boolValue];
|
||||
}
|
||||
|
||||
/* main */
|
||||
|
||||
- (NSArray *) availableModules
|
||||
{
|
||||
NSMutableArray *rc, *modules;
|
||||
|
||||
@@ -26,6 +26,10 @@
|
||||
label:value="Mail Options"/></li>
|
||||
<li target="identitiesView"><var:string
|
||||
label:value="Signature"/></li>
|
||||
<var:if condition="isVacationEnabled"><li target="vacationView"><var:string
|
||||
label:value="Vacation"/></li></var:if>
|
||||
<var:if condition="isForwardEnabled"><li target="forwardView"><var:string
|
||||
label:value="Forward"/></li></var:if>
|
||||
</var:if>
|
||||
<var:if condition="shouldDisplayAdditionalPreferences">
|
||||
<li target="additionalView"><var:string label:value="Additional Parameters"/></li>
|
||||
@@ -35,16 +39,16 @@
|
||||
<!-- </var:if> -->
|
||||
</ul>
|
||||
<div id="generalView" class="tab">
|
||||
<label><var:string label:value="Language :"/>
|
||||
<var:popup list="languages" item="item"
|
||||
const:id="language"
|
||||
string="languageText"
|
||||
selection="language"
|
||||
label:noSelectionString="choose" /></label><br/>
|
||||
<label><var:string label:value="Language :"/>
|
||||
<var:popup list="languages" item="item"
|
||||
const:id="language"
|
||||
string="languageText"
|
||||
selection="language"
|
||||
label:noSelectionString="choose" /></label><br/>
|
||||
<label><var:string label:value="Current Time Zone :"/>
|
||||
<var:popup list="timeZonesList" item="item"
|
||||
const:id="timezone"
|
||||
string="item" selection="userTimeZone" /></label><br/>
|
||||
<var:popup list="timeZonesList" item="item"
|
||||
const:id="timezone"
|
||||
string="item" selection="userTimeZone" /></label><br/>
|
||||
<br/>
|
||||
<div id="dateTimeFormat">
|
||||
<label><var:string label:value="Short Date Format :"/>
|
||||
@@ -166,19 +170,6 @@
|
||||
const:id="composeMessagesType"
|
||||
string="itemComposeMessagesText"
|
||||
selection="userComposeMessagesType"/>
|
||||
<!-- <label><input
|
||||
const:name="inTheOffice" type="radio" const:value="YES"
|
||||
var:selection="inTheOffice"/>
|
||||
<var:string label:value="I'm currently in the office"/></label><br/>
|
||||
<label><input
|
||||
const:name="inTheOffice" type="radio" const:value="NO"
|
||||
var:selection="inTheOffice"/>
|
||||
<var:string label:value="I'm currently out of the office"/></label><br/>
|
||||
<br/>
|
||||
<div id="outOfOfficeMessage">
|
||||
<label><var:string label:value="AutoReply only once to each sender with the following text :"/><br/>
|
||||
<textarea const:name="autoReplyText" var:value="autoReplyText"/>
|
||||
</label> -->
|
||||
</div>
|
||||
<div id="identitiesView" class="tab">
|
||||
<!--<var:multiselection const:id="identitiesList" item="item"
|
||||
@@ -188,6 +179,67 @@
|
||||
<textarea const:id="signature" const:name="signature"
|
||||
var:value="signature" />
|
||||
</div>
|
||||
<var:if condition="isVacationEnabled">
|
||||
<div id="vacationView" class="tab">
|
||||
<label><input type="checkbox"
|
||||
const:name="enableVacation"
|
||||
const:id="enableVacation"
|
||||
var:checked="enableVacation" />
|
||||
<var:string label:value="Enable vacation auto reply"/></label>
|
||||
<div id="vacation">
|
||||
|
||||
<label><var:string label:value="Auto reply message :"/><br/>
|
||||
<textarea const:name="autoReplyText"
|
||||
const:id="autoReplyText"
|
||||
var:value="autoReplyText"/>
|
||||
</label><br/>
|
||||
|
||||
<label><var:string label:value="Email addresses (separated by commas) :"/><br/>
|
||||
<textarea const:name="autoReplyEmailAddresses"
|
||||
const:id="autoReplyEmailAddresses"
|
||||
var:value="autoReplyEmailAddresses" />
|
||||
</label><br/>
|
||||
|
||||
<label><var:string label:value="Days between responses :"/>
|
||||
<var:popup list="daysBetweenResponsesList" item="item"
|
||||
const:id="daysBetweenResponsesList"
|
||||
string="item"
|
||||
selection="daysBetweenResponses" /></label><br/>
|
||||
|
||||
<label><input type="checkbox"
|
||||
const:name="ignoreLists"
|
||||
const:id="ignoreLists"
|
||||
var:checked="ignoreLists" />
|
||||
<var:string label:value="Do not send responses to mailing lists" /></label><br/>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</var:if>
|
||||
<var:if condition="isForwardEnabled">
|
||||
<div id="forwardView" class="tab">
|
||||
<label><input type="checkbox"
|
||||
const:name="enableForward"
|
||||
const:id="enableForward"
|
||||
var:checked="enableForward" />
|
||||
<var:string label:value="Forward incoming messages"/></label><br/>
|
||||
|
||||
<div id="forward">
|
||||
<label><var:string label:value="Forward to address :"/>
|
||||
<input type="text"
|
||||
const:id="forwardAddress"
|
||||
const:name="forwardAddress"
|
||||
var:value="forwardAddress"
|
||||
size="30" /></label><br/>
|
||||
|
||||
<label><input type="checkbox"
|
||||
const:name="forwardKeepCopy"
|
||||
const:id="forwardKeepCopy"
|
||||
var:checked="forwardKeepCopy" />
|
||||
<var:string label:value="Keep a copy" /></label><br/>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</var:if>
|
||||
</var:if>
|
||||
<var:if condition="shouldDisplayAdditionalPreferences"
|
||||
><div id="additionalView" class="tab">
|
||||
|
||||
@@ -19,7 +19,8 @@ DIV#passwordView
|
||||
{ padding-top: 3em;
|
||||
padding-right: 10em; }
|
||||
|
||||
DIV#identitiesView
|
||||
DIV#identitiesView,
|
||||
DIV#vacationView
|
||||
{ padding: 5px 5px 5px 0px;
|
||||
overflow: hidden; }
|
||||
|
||||
@@ -65,3 +66,14 @@ DIV#windowButtons
|
||||
line-height: 2em;
|
||||
vertical-align: middle;
|
||||
text-align: right; }
|
||||
|
||||
#vacation, #forward
|
||||
{ padding-left: 2.5em; }
|
||||
#vacation label
|
||||
{ margin-left: 0; }
|
||||
#vacation TEXTAREA
|
||||
{ width: 100%; }
|
||||
#vacation TEXTAREA#autoReplyText
|
||||
{ height: 100px; }
|
||||
#vacation TEXTAREA#autoReplyEmailAddresses
|
||||
{ height: 50px; }
|
||||
@@ -22,6 +22,21 @@ function savePreferences(sender) {
|
||||
}
|
||||
}
|
||||
|
||||
if ($("enableVacation") && $("enableVacation").checked) {
|
||||
if ($("autoReplyText").value.strip().length == 0
|
||||
|| $("autoReplyEmailAddresses").value.strip().length == 0) {
|
||||
alert(getLabel("Please specify your message and your email addresses for which you want to enable auto reply."));
|
||||
sendForm = false;
|
||||
}
|
||||
}
|
||||
|
||||
if ($("enableForward") && $("enableForward").checked) {
|
||||
if ($("forwardAddress").value.strip().length == 0) {
|
||||
alert(getLabel("Please specify an address to which you want to forward your messages."));
|
||||
sendForm = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (sendForm)
|
||||
$("mainForm").submit();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user