mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-02-17 07:33:57 +00:00
(js) Respect SOGoCalendarDefaultReminder in editor
This commit is contained in:
@@ -105,6 +105,9 @@
|
||||
case 'M': /* min */
|
||||
unit = @"MINUTES";
|
||||
break;
|
||||
case 'W': /* week */
|
||||
unit = @"WEEKS";
|
||||
break;
|
||||
default:
|
||||
NSLog(@"Cannot process duration unit: '%c'", c);
|
||||
break;
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
|
||||
if (!unitsList)
|
||||
{
|
||||
unitsList = [NSArray arrayWithObjects: @"MINUTES", @"HOURS", @"DAYS", nil];
|
||||
unitsList = [NSArray arrayWithObjects: @"MINUTES", @"HOURS", @"DAYS", @"WEEKS", nil];
|
||||
[unitsList retain];
|
||||
}
|
||||
|
||||
|
||||
@@ -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