mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-07-15 05:14:53 +00:00
(js) Respect SOGoCalendarDefaultReminder in editor
This commit is contained in:
@@ -347,7 +347,21 @@
|
||||
this.repeat.end = 'never';
|
||||
this.$hasCustomRepeat = this.hasCustomRepeat();
|
||||
|
||||
this.$hasAlarm = angular.isDefined(data.alarm);
|
||||
if (this.isNew) {
|
||||
// Set default alarm
|
||||
Component.$Preferences.ready().then(function() {
|
||||
var units = { M: 'MINUTES', H: 'HOURS', D: 'DAYS', W: 'WEEKS' };
|
||||
var match = /-PT?([0-9]+)([MHDW])/.exec(Component.$Preferences.defaults.SOGoCalendarDefaultReminder);
|
||||
if (match) {
|
||||
_this.$hasAlarm = true;
|
||||
_this.alarm.quantity = parseInt(match[1]);
|
||||
_this.alarm.unit = units[match[2]];
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
this.$hasAlarm = angular.isDefined(data.alarm);
|
||||
}
|
||||
|
||||
// Allow the component to be moved to a different calendar
|
||||
this.destinationCalendar = this.pid;
|
||||
|
||||
Reference in New Issue
Block a user