fix(calendar): Fix empty recurence list when creating event from mail

This commit is contained in:
smizrahi
2024-06-03 22:38:58 +02:00
parent 1a47fdb7d6
commit 2756176503
9 changed files with 131 additions and 39 deletions

View File

@@ -37,6 +37,7 @@ SchedulerUI_OBJC_FILES = \
UIxAppointmentEditor.m \
UIxTaskEditor.m \
UIxRecurrenceEditor.m \
UIxRecurrenceListEditor.m \
UIxReminderEditor.m \
UIxOccurenceEditor.m
SchedulerUI_RESOURCE_FILES += \

View File

@@ -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;

View File

@@ -0,0 +1,34 @@
/* UIxRecurrenceListEditor.h - this file is part of SOGo
*
* Copyright (C) 2024 Alinto
*
* Author: Ludovic Marcotte <ludovic@inverse.ca>
*
* 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 */

View File

@@ -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 <Foundation/NSDictionary.h>
#import <Foundation/NSUserDefaults.h> /* for locale string constants */
#import <Common/UIxPageFrame.h>
#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

View File

@@ -133,6 +133,10 @@
protectedBy = "View";
pageName = "UIxRecurrenceEditor";
};
editListRecurrence = {
protectedBy = "View";
pageName = "UIxRecurrenceListEditor";
};
editReminder = {
protectedBy = "View";
pageName = "UIxReminderEditor";

View File

@@ -207,22 +207,7 @@
<!-- repeat -->
<div class="sg-form-section">
<div layout="row" layout-align="start center">
<md-input-container class="md-block md-flex">
<label><var:string label:value="Repeat"/></label>
<md-select
ng-model="editor.component.repeat.frequency"
ng-change="editor.changeFrequency($event)"
ng-disabled="editor.component.occurrenceId">
<md-option ng-value="frequency[0]" ng-repeat="frequency in ::editor.frequencies()" ng-bind-html="frequency[1]"><!-- frequency --></md-option>
</md-select>
</md-input-container>
<md-button type="button" class="sg-icon-button"
label:aria-label="repeat_CUSTOM"
ng-disabled="editor.component.occurrenceId"
ng-show="editor.component.repeat.frequency != 'never'"
ng-click="editor.toggleRecurrenceEditor()">
<md-icon ng-class="{'md-rotate-45': editor.showRecurrenceEditor}">add</md-icon>
</md-button>
<var:component className="UIxRecurrenceListEditor" />
</div>
<div flex-offset="5"
ng-show="editor.showRecurrenceEditor">

View File

@@ -14,7 +14,6 @@
var dayStartHour = <var:string value="dayStartHour"/>;
var currentView = '<var:string value="currentView"/>';
var localeCode = '<var:string value="localeCode" />';
var repeatFrequencies = <var:string value="repeatFrequencies.jsonRepresentation" />;
var centerIsClose = <var:string value="listIsCollapsed.jsonRepresentation" />;
</script>
<var:component className="UIxCalendarSelector" />

View File

@@ -0,0 +1,27 @@
<?xml version='1.0' standalone='yes'?>
<container
xmlns="http://www.w3.org/1999/xhtml"
xmlns:var="http://www.skyrix.com/od/binding"
xmlns:const="http://www.skyrix.com/od/constant"
xmlns:label="OGo:label"
>
<md-input-container class="md-block md-flex">
<label><var:string label:value="Repeat"/></label>
<md-select
ng-model="editor.component.repeat.frequency"
ng-change="editor.changeFrequency($event)"
ng-disabled="editor.component.occurrenceId">
<var:foreach list="repeatFrequenciesKey" item="item">
<md-option var:value="item"><var:string value="itemText"/></md-option>
</var:foreach>
<md-option var:value="custom" ng-if="editor.component.repeat.frequency == 'custom'"><var:string value="repeat_CUSTOM"/></md-option>
</md-select>
</md-input-container>
<md-button type="button" class="sg-icon-button"
label:aria-label="repeat_CUSTOM"
ng-disabled="editor.component.occurrenceId"
ng-show="editor.component.repeat.frequency != 'never'"
ng-click="editor.toggleRecurrenceEditor()">
<md-icon ng-class="{'md-rotate-45': editor.showRecurrenceEditor}">add</md-icon>
</md-button>
</container>

View File

@@ -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;