From f6ca946058f16ae32bbde966ff1c850e4979db0f Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Wed, 30 Oct 2019 11:04:59 -0400 Subject: [PATCH] fix(calendar): don't allow RDATE unless already defined Since RDATE are not properly supported in EAS, hide the possibility to specify recurring dates unless the component being edited already contains RDATE(s). --- UI/Scheduler/UIxCalMainView.m | 18 +++++++++++++++++- .../UIxAppointmentEditorTemplate.wox | 4 +--- UI/Templates/SchedulerUI/UIxCalMainView.wox | 1 + .../SchedulerUI/UIxTaskEditorTemplate.wox | 4 +--- .../js/Scheduler/ComponentController.js | 10 ++++++++-- 5 files changed, 28 insertions(+), 9 deletions(-) diff --git a/UI/Scheduler/UIxCalMainView.m b/UI/Scheduler/UIxCalMainView.m index 41eb1715f..e32335253 100644 --- a/UI/Scheduler/UIxCalMainView.m +++ b/UI/Scheduler/UIxCalMainView.m @@ -1,6 +1,6 @@ /* UIxCalMainView.m - this file is part of SOGo * - * Copyright (C) 2006-2018 Inverse inc. + * Copyright (C) 2006-2019 Inverse inc. * * 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 @@ -339,6 +339,22 @@ 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; +} + @end /* Component Viewer, parent class of Appointment Viewer and Task Viewer */ diff --git a/UI/Templates/SchedulerUI/UIxAppointmentEditorTemplate.wox b/UI/Templates/SchedulerUI/UIxAppointmentEditorTemplate.wox index 92c3e36d1..198be5bc4 100644 --- a/UI/Templates/SchedulerUI/UIxAppointmentEditorTemplate.wox +++ b/UI/Templates/SchedulerUI/UIxAppointmentEditorTemplate.wox @@ -199,9 +199,7 @@ ng-model="editor.component.repeat.frequency" ng-change="editor.changeFrequency($event)" ng-disabled="editor.component.occurrenceId"> - - - + {{ frequency[1] }} ; var currentView = ''; var localeCode = ''; + var repeatFrequencies = ; var centerIsClose = ; diff --git a/UI/Templates/SchedulerUI/UIxTaskEditorTemplate.wox b/UI/Templates/SchedulerUI/UIxTaskEditorTemplate.wox index d654aaf57..b8ae35b01 100644 --- a/UI/Templates/SchedulerUI/UIxTaskEditorTemplate.wox +++ b/UI/Templates/SchedulerUI/UIxTaskEditorTemplate.wox @@ -196,9 +196,7 @@ - - - + {{ frequency[1] }}