mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-05-23 12:25:23 +00:00
Honor the domain defaults when creating an event
Initialize the editor with the value of SOGoAppointmentSendEMailNotifications from the domain defaults. Fixes #3729
This commit is contained in:
@@ -475,14 +475,6 @@
|
||||
this.delta = 60;
|
||||
angular.extend(this, data);
|
||||
|
||||
Component.$Preferences.ready().then(function() {
|
||||
var type = (_this.type == 'appointment')? 'Events' : 'Tasks';
|
||||
|
||||
// Set default values from user's defaults
|
||||
_this.classification = _this.classification ||
|
||||
Component.$Preferences.defaults['SOGoCalendar' + type + 'DefaultClassification'].toLowerCase();
|
||||
});
|
||||
|
||||
if (this.component == 'vevent')
|
||||
this.type = 'appointment';
|
||||
else if (this.component == 'vtodo')
|
||||
@@ -564,8 +556,14 @@
|
||||
this.$hasCustomRepeat = this.hasCustomRepeat();
|
||||
|
||||
if (this.isNew) {
|
||||
// Set default alarm
|
||||
// Set default values
|
||||
Component.$Preferences.ready().then(function() {
|
||||
var type = (_this.type == 'appointment')? 'Events' : 'Tasks';
|
||||
|
||||
// Set default classification
|
||||
_this.classification = Component.$Preferences.defaults['SOGoCalendar' + type + 'DefaultClassification'].toLowerCase();
|
||||
|
||||
// Set default alarm
|
||||
var units = { M: 'MINUTES', H: 'HOURS', D: 'DAYS', W: 'WEEKS' };
|
||||
var match = /-PT?([0-9]+)([MHDW])/.exec(Component.$Preferences.defaults.SOGoCalendarDefaultReminder);
|
||||
if (match) {
|
||||
@@ -573,6 +571,9 @@
|
||||
_this.alarm.quantity = parseInt(match[1]);
|
||||
_this.alarm.unit = units[match[2]];
|
||||
}
|
||||
|
||||
// Set notitifications
|
||||
_this.sendAppointmentNotifications = Component.$Preferences.defaults.SOGoAppointmentSendEMailNotifications;
|
||||
});
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user