diff --git a/UI/Scheduler/GNUmakefile b/UI/Scheduler/GNUmakefile index b169d0521..7490e1d40 100644 --- a/UI/Scheduler/GNUmakefile +++ b/UI/Scheduler/GNUmakefile @@ -37,6 +37,7 @@ SchedulerUI_OBJC_FILES = \ UIxAppointmentEditor.m \ UIxTaskEditor.m \ UIxRecurrenceEditor.m \ + UIxRecurrenceListEditor.m \ UIxReminderEditor.m \ UIxOccurenceEditor.m SchedulerUI_RESOURCE_FILES += \ diff --git a/UI/Scheduler/UIxCalMainView.m b/UI/Scheduler/UIxCalMainView.m index 5616ecf71..e59a72572 100644 --- a/UI/Scheduler/UIxCalMainView.m +++ b/UI/Scheduler/UIxCalMainView.m @@ -346,22 +346,6 @@ return (view ? view : @"weekview"); } -- (NSArray *) repeatFrequencies -{ - NSArray *repeatFrequencies; - - repeatFrequencies = [NSArray arrayWithObjects: - [NSArray arrayWithObjects: @"never", [self labelForKey: @"repeat_NEVER"], nil], - [NSArray arrayWithObjects: @"daily",[self labelForKey: @"repeat_DAILY"], nil], - [NSArray arrayWithObjects: @"weekly",[self labelForKey: @"repeat_WEEKLY"], nil], - [NSArray arrayWithObjects: @"monthly",[self labelForKey: @"repeat_MONTHLY"], nil], - [NSArray arrayWithObjects: @"yearly", [self labelForKey: @"repeat_YEARLY"], nil], - [NSArray arrayWithObjects: @"custom", [self labelForKey: @"repeat_CUSTOM"], nil], - nil]; - - return repeatFrequencies; -} - - (BOOL) isCalendarSharingEnabled { BOOL result; SOGoSystemDefaults *sd; diff --git a/UI/Scheduler/UIxRecurrenceListEditor.h b/UI/Scheduler/UIxRecurrenceListEditor.h new file mode 100644 index 000000000..2e65ec721 --- /dev/null +++ b/UI/Scheduler/UIxRecurrenceListEditor.h @@ -0,0 +1,34 @@ +/* UIxRecurrenceListEditor.h - this file is part of SOGo + * + * Copyright (C) 2024 Alinto + * + * Author: Ludovic Marcotte + * + * This file is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This file is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef UIXRECURRENCELISTEDITOR_H +#define UIXRECURRENCELISTEDITOR_H + +@interface UIxRecurrenceListEditor : UIxComponent +{ + NSString *item; +} + + +@end + +#endif /* UIXRECURRENCEEDITOR_H */ diff --git a/UI/Scheduler/UIxRecurrenceListEditor.m b/UI/Scheduler/UIxRecurrenceListEditor.m new file mode 100644 index 000000000..20280be6b --- /dev/null +++ b/UI/Scheduler/UIxRecurrenceListEditor.m @@ -0,0 +1,64 @@ +/* UIxRecurrenceListEditor.m - this file is part of SOGo + * + * Copyright (C) 2024 Alinto + * + * This file is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This file is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#import +#import /* for locale string constants */ + +#import + +#import "UIxRecurrenceListEditor.h" + +@implementation UIxRecurrenceListEditor + +- (NSArray *) repeatFrequenciesKey +{ + NSArray *repeatFrequenciesKey; + + repeatFrequenciesKey = [NSArray arrayWithObjects: + @"never", + @"daily", + @"weekly", + @"monthly", + @"yearly", + // Custom is in the UIxRecurrenceListEditor.wox file + nil]; + + return repeatFrequenciesKey; +} +- (void) setItem: (NSString *) theItem +{ + item = theItem; +} + +- (NSString *) item +{ + return item; +} + +- (NSString *) itemText +{ + NSString *text; + + text = [self labelForKey: [NSString stringWithFormat: @"repeat_%@", [item uppercaseString]]]; + + return text; +} + +@end diff --git a/UI/Scheduler/product.plist b/UI/Scheduler/product.plist index 526197ef4..a80d89718 100644 --- a/UI/Scheduler/product.plist +++ b/UI/Scheduler/product.plist @@ -133,6 +133,10 @@ protectedBy = "View"; pageName = "UIxRecurrenceEditor"; }; + editListRecurrence = { + protectedBy = "View"; + pageName = "UIxRecurrenceListEditor"; + }; editReminder = { protectedBy = "View"; pageName = "UIxReminderEditor"; diff --git a/UI/Templates/SchedulerUI/UIxAppointmentEditorTemplate.wox b/UI/Templates/SchedulerUI/UIxAppointmentEditorTemplate.wox index 4399748c1..3b1990390 100644 --- a/UI/Templates/SchedulerUI/UIxAppointmentEditorTemplate.wox +++ b/UI/Templates/SchedulerUI/UIxAppointmentEditorTemplate.wox @@ -207,22 +207,7 @@
- - - - - - - - add - +
diff --git a/UI/Templates/SchedulerUI/UIxCalMainView.wox b/UI/Templates/SchedulerUI/UIxCalMainView.wox index 5ee242661..670855663 100644 --- a/UI/Templates/SchedulerUI/UIxCalMainView.wox +++ b/UI/Templates/SchedulerUI/UIxCalMainView.wox @@ -14,7 +14,6 @@ var dayStartHour = ; var currentView = ''; var localeCode = ''; - var repeatFrequencies = ; var centerIsClose = ; diff --git a/UI/Templates/SchedulerUI/UIxRecurrenceListEditor.wox b/UI/Templates/SchedulerUI/UIxRecurrenceListEditor.wox new file mode 100644 index 000000000..86d3e3e49 --- /dev/null +++ b/UI/Templates/SchedulerUI/UIxRecurrenceListEditor.wox @@ -0,0 +1,27 @@ + + + + + + + + + + + + + add + + diff --git a/UI/WebServerResources/js/Scheduler/ComponentController.js b/UI/WebServerResources/js/Scheduler/ComponentController.js index 6071511ae..aabd4dc96 100644 --- a/UI/WebServerResources/js/Scheduler/ComponentController.js +++ b/UI/WebServerResources/js/Scheduler/ComponentController.js @@ -328,12 +328,6 @@ this.component.repeat.month.type == 'bymonthday'; }; - this.frequencies = function () { - return _.filter($window.repeatFrequencies, function (frequency) { - return frequency[0] != 'custom' || vm.component.repeat.frequency == 'custom'; - }); - }; - this.changeFrequency = function () { if (this.component.repeat.frequency == 'custom') this.showRecurrenceEditor = true;