mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-04-12 00:38:51 +00:00
(feat) now possible to set vacation message start date (fixes #3679)
This commit is contained in:
@@ -858,6 +858,18 @@
|
||||
</md-checkbox>
|
||||
</div>
|
||||
|
||||
<div layout="row">
|
||||
<md-checkbox
|
||||
ng-model="app.preferences.defaults.Vacation.startDateEnabled"
|
||||
ng-true-value="1"
|
||||
ng-false-value="0">
|
||||
<var:string label:value="Enable auto reply on" />
|
||||
</md-checkbox>
|
||||
<md-datepicker
|
||||
ng-disabled="app.preferences.defaults.Vacation.startDateEnabled == 0"
|
||||
ng-model="app.preferences.defaults.Vacation.startDate"><!-- datepicker --></md-datepicker>
|
||||
</div>
|
||||
|
||||
<div layout="row">
|
||||
<md-checkbox
|
||||
ng-model="app.preferences.defaults.Vacation.endDateEnabled"
|
||||
|
||||
@@ -39,6 +39,12 @@
|
||||
// We also convert our date objects into real date, otherwise we'll have strings
|
||||
// or undefined values and the md-datepicker does NOT like this.
|
||||
if (data.Vacation) {
|
||||
if (data.Vacation.startDate)
|
||||
data.Vacation.startDate = new Date(parseInt(data.Vacation.startDate) * 1000);
|
||||
else {
|
||||
data.Vacation.startDateEnabled = 0;
|
||||
data.Vacation.startDate = new Date();
|
||||
}
|
||||
if (data.Vacation.endDate)
|
||||
data.Vacation.endDate = new Date(parseInt(data.Vacation.endDate) * 1000);
|
||||
else {
|
||||
@@ -59,6 +65,11 @@
|
||||
if (angular.isUndefined(data.Vacation.daysBetweenResponse))
|
||||
data.Vacation.daysBetweenResponse = 7;
|
||||
|
||||
if (angular.isUndefined(data.Vacation.startDate)) {
|
||||
data.Vacation.startDateEnabled = 0;
|
||||
data.Vacation.startDate = new Date();
|
||||
}
|
||||
|
||||
if (angular.isUndefined(data.Vacation.endDate)) {
|
||||
data.Vacation.endDateEnabled = 0;
|
||||
data.Vacation.endDate = new Date();
|
||||
@@ -218,6 +229,10 @@
|
||||
delete preferences.defaults.SOGoMailComposeFontSizeEnabled;
|
||||
|
||||
if (preferences.defaults.Vacation) {
|
||||
if (preferences.defaults.Vacation.startDateEnabled)
|
||||
preferences.defaults.Vacation.startDate = preferences.defaults.Vacation.startDate.getTime()/1000;
|
||||
else
|
||||
preferences.defaults.Vacation.startDate = 0;
|
||||
if (preferences.defaults.Vacation.endDateEnabled)
|
||||
preferences.defaults.Vacation.endDate = preferences.defaults.Vacation.endDate.getTime()/1000;
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user