mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-05-23 12:25:23 +00:00
@@ -3,6 +3,7 @@
|
||||
|
||||
Enhancements
|
||||
- [core] added handling of BYSETPOS for BYDAY in recurrence rules
|
||||
- [web] added sort by start date for tasks (#3840)
|
||||
|
||||
Bug fixes
|
||||
- [web] fixed JavaScript exception when SOGo is launched from an external link (#3900)
|
||||
|
||||
@@ -54,21 +54,22 @@
|
||||
#define taskCalendarNameIndex 2
|
||||
#define taskStatusIndex 3
|
||||
#define taskTitleIndex 4
|
||||
#define taskEndDateIndex 5
|
||||
#define taskClassificationIndex 6
|
||||
#define taskLocationIndex 7
|
||||
#define taskCategoryIndex 8
|
||||
#define taskViewableIndex 9
|
||||
#define taskEditableIndex 10
|
||||
#define taskErasableIndex 11
|
||||
#define taskPriorityIndex 12
|
||||
#define taskOwnerIndex 13
|
||||
#define taskIsCycleIndex 14
|
||||
#define taskNextAlarmIndex 15
|
||||
#define taskRecurrenceIdIndex 16
|
||||
#define taskIsExceptionIndex 17
|
||||
#define taskDescriptionIndex 18
|
||||
#define taskStatusFlagIndex 19
|
||||
#define taskStartDateIndex 5
|
||||
#define taskEndDateIndex 6
|
||||
#define taskClassificationIndex 7
|
||||
#define taskLocationIndex 8
|
||||
#define taskCategoryIndex 9
|
||||
#define taskViewableIndex 10
|
||||
#define taskEditableIndex 11
|
||||
#define taskErasableIndex 12
|
||||
#define taskPriorityIndex 13
|
||||
#define taskOwnerIndex 14
|
||||
#define taskIsCycleIndex 15
|
||||
#define taskNextAlarmIndex 16
|
||||
#define taskRecurrenceIdIndex 17
|
||||
#define taskIsExceptionIndex 18
|
||||
#define taskDescriptionIndex 19
|
||||
#define taskStatusFlagIndex 20
|
||||
|
||||
@interface NSArray (SOGoEventComparison)
|
||||
|
||||
@@ -80,7 +81,8 @@
|
||||
- (NSComparisonResult) compareTasksAscending: (NSArray *) otherTask;
|
||||
- (NSComparisonResult) compareTasksPriorityAscending: (NSArray *) otherTask;
|
||||
- (NSComparisonResult) compareTasksTitleAscending: (NSArray *) otherTask;
|
||||
- (NSComparisonResult) compareTasksEndAscending: (NSArray *) otherTask;
|
||||
- (NSComparisonResult) compareTasksStartDateAscending: (NSArray *) otherTask;
|
||||
- (NSComparisonResult) compareTasksEndDateAscending: (NSArray *) otherTask;
|
||||
- (NSComparisonResult) compareTasksLocationAscending: (NSArray *) otherTask;
|
||||
- (NSComparisonResult) compareTasksCategoryAscending: (NSArray *) otherTask;
|
||||
- (NSComparisonResult) compareTasksCalendarNameAscending: (NSArray *) otherTask;
|
||||
|
||||
@@ -182,7 +182,41 @@
|
||||
return [selfTitle caseInsensitiveCompare: otherTitle];
|
||||
}
|
||||
|
||||
- (NSComparisonResult) compareTasksEndAscending: (NSArray *) otherTask
|
||||
- (NSComparisonResult) compareTasksStartDateAscending: (NSArray *) otherTask
|
||||
{
|
||||
NSComparisonResult result;
|
||||
unsigned int selfTime, otherTime;
|
||||
|
||||
// Start date
|
||||
selfTime = [[self objectAtIndex: taskStartDateIndex] intValue];
|
||||
otherTime = [[otherTask objectAtIndex: taskStartDateIndex] intValue];
|
||||
if (selfTime && !otherTime)
|
||||
result = NSOrderedAscending;
|
||||
else if (!selfTime && otherTime)
|
||||
result = NSOrderedDescending;
|
||||
else
|
||||
{
|
||||
if (selfTime > otherTime)
|
||||
result = NSOrderedDescending;
|
||||
else if (selfTime < otherTime)
|
||||
result = NSOrderedAscending;
|
||||
else
|
||||
{
|
||||
// Calendar ID
|
||||
result = [[self objectAtIndex: taskFolderIndex]
|
||||
compare: [otherTask objectAtIndex: taskFolderIndex]];
|
||||
if (result == NSOrderedSame)
|
||||
// Task name
|
||||
result = [[self objectAtIndex: taskTitleIndex]
|
||||
compare: [otherTask objectAtIndex: taskTitleIndex]
|
||||
options: NSCaseInsensitiveSearch];
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
- (NSComparisonResult) compareTasksEndDateAscending: (NSArray *) otherTask
|
||||
{
|
||||
NSComparisonResult result;
|
||||
unsigned int selfTime, otherTime;
|
||||
|
||||
@@ -90,7 +90,7 @@ static NSArray *tasksFields = nil;
|
||||
{
|
||||
tasksFields = [NSArray arrayWithObjects: @"c_name", @"c_folder",
|
||||
@"calendarName",
|
||||
@"c_status", @"c_title", @"c_enddate",
|
||||
@"c_status", @"c_title", @"c_startdate", @"c_enddate",
|
||||
@"c_classification", @"c_location", @"c_category",
|
||||
@"viewable", @"editable", @"erasable",
|
||||
@"c_priority", @"c_owner",
|
||||
@@ -1595,7 +1595,6 @@ _computeBlocksPosition (NSArray *blocks)
|
||||
forAllDay: NO]];
|
||||
else
|
||||
[filteredTask addObject: [NSNull null]];
|
||||
|
||||
if (([tasksView isEqualToString:@"view_today"] ||
|
||||
[tasksView isEqualToString:@"view_next7"] ||
|
||||
[tasksView isEqualToString:@"view_next14"] ||
|
||||
@@ -1621,8 +1620,10 @@ _computeBlocksPosition (NSArray *blocks)
|
||||
[filteredTasks sortUsingSelector: @selector (compareTasksTitleAscending:)];
|
||||
else if ([sort isEqualToString: @"priority"])
|
||||
[filteredTasks sortUsingSelector: @selector (compareTasksPriorityAscending:)];
|
||||
else if ([sort isEqualToString: @"start"])
|
||||
[filteredTasks sortUsingSelector: @selector (compareTasksStartDateAscending:)];
|
||||
else if ([sort isEqualToString: @"end"])
|
||||
[filteredTasks sortUsingSelector: @selector (compareTasksEndAscending:)];
|
||||
[filteredTasks sortUsingSelector: @selector (compareTasksEndDateAscending:)];
|
||||
else if ([sort isEqualToString: @"location"])
|
||||
[filteredTasks sortUsingSelector: @selector (compareTasksLocationAscending:)];
|
||||
else if ([sort isEqualToString: @"category"])
|
||||
|
||||
@@ -466,7 +466,7 @@
|
||||
<!-- selected --></md-icon> <var:string label:value="Calendar"/>
|
||||
</md-button>
|
||||
</md-menu-item>
|
||||
<md-menu-item ng-if="list.componentType == 'events'">
|
||||
<md-menu-item>
|
||||
<md-button ng-click="list.sort('start')">
|
||||
<md-icon ng-class="{ 'icon-check': list.sortedBy('start') }">
|
||||
<!-- selected --></md-icon> <var:string label:value="Start"/>
|
||||
|
||||
Reference in New Issue
Block a user