From f2af5e9f8737d7e0603c76ca51f61e215450f9ae Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Fri, 19 May 2017 12:13:01 -0400 Subject: [PATCH] Improve display of tasks status --- NEWS | 2 ++ SoObjects/Appointments/iCalToDo+SOGo.h | 9 +++++- SoObjects/Appointments/iCalToDo+SOGo.m | 28 +++++++++++++++---- UI/Scheduler/UIxCalListingActions.m | 3 ++ UI/Templates/SchedulerUI/UIxCalMainView.wox | 8 ++++-- .../SchedulerUI/UIxTaskViewTemplate.wox | 10 ++++++- .../js/Scheduler/Component.service.js | 2 +- .../scss/views/SchedulerUI.scss | 6 ++++ 8 files changed, 57 insertions(+), 11 deletions(-) diff --git a/NEWS b/NEWS index 161d0a087..47b1f034e 100644 --- a/NEWS +++ b/NEWS @@ -6,6 +6,8 @@ New features Enhancements - [core] now possible to {un}subscribe to folders using sogo-tool + - [web] AngularJS optimizations in Mail module + - [web] improve display of tasks status Bug fixes - [web] respect SOGoLanguage and SOGoSupportedLanguages (#4169) diff --git a/SoObjects/Appointments/iCalToDo+SOGo.h b/SoObjects/Appointments/iCalToDo+SOGo.h index e381686c9..8c09603b7 100644 --- a/SoObjects/Appointments/iCalToDo+SOGo.h +++ b/SoObjects/Appointments/iCalToDo+SOGo.h @@ -1,6 +1,6 @@ /* iCalToDo+SOGo.h - this file is part of SOGo * - * Copyright (C) 2007-2014 Inverse inc. + * Copyright (C) 2007-2017 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 @@ -23,10 +23,17 @@ #import +#define taskStatusCompleted 1 +#define taskStatusInProcess 2 +#define taskStatusCancelled 3 +#define taskStatusNeedsAction 4 + @class NSMutableArray; @interface iCalToDo (SOGoExtensions) ++ (NSString *) statusForCode: (int) statusCode; + @end #endif /* ICALTODO_SOGO_H */ diff --git a/SoObjects/Appointments/iCalToDo+SOGo.m b/SoObjects/Appointments/iCalToDo+SOGo.m index 6c7ae0e23..c3f728acc 100644 --- a/SoObjects/Appointments/iCalToDo+SOGo.m +++ b/SoObjects/Appointments/iCalToDo+SOGo.m @@ -1,6 +1,6 @@ /* iCalToDot+SOGo.m - this file is part of SOGo * - * Copyright (C) 2008-2016 Inverse inc. + * Copyright (C) 2008-2017 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 @@ -43,6 +43,20 @@ @implementation iCalToDo (SOGoExtensions) ++ (NSString *) statusForCode: (int) statusCode +{ + if (statusCode == taskStatusCompleted) + return @"completed"; + else if (statusCode == taskStatusInProcess) + return @"in-process"; + else if (statusCode == taskStatusCancelled) + return @"cancelled"; + else if (statusCode == taskStatusNeedsAction) + return @"needs-action"; + + return @""; +} + - (NSDictionary *) attributesInContext: (WOContext *) context { BOOL isAllDayStartDate, isAllDayDueDate; @@ -305,19 +319,21 @@ if (completed || [status isNotNull]) { - code = 0; /* NEEDS-ACTION */ + code = 0; if (completed || [status isEqualToString: @"COMPLETED"]) - code = 1; + code = taskStatusCompleted; else if ([status isEqualToString: @"IN-PROCESS"]) - code = 2; + code = taskStatusInProcess; else if ([status isEqualToString: @"CANCELLED"]) - code = 3; + code = taskStatusCancelled; + else if ([status isEqualToString: @"NEEDS-ACTION"]) + code = taskStatusNeedsAction; [row setObject: [NSNumber numberWithInt: code] forKey: @"c_status"]; } else { /* confirmed by default */ - [row setObject:[NSNumber numberWithInt:1] forKey: @"c_status"]; + [row setObject: [NSNumber numberWithInt: 0] forKey: @"c_status"]; } [row setObject: [NSNumber numberWithUnsignedInt: accessClass] diff --git a/UI/Scheduler/UIxCalListingActions.m b/UI/Scheduler/UIxCalListingActions.m index 372ebf6aa..51f6ebe15 100644 --- a/UI/Scheduler/UIxCalListingActions.m +++ b/UI/Scheduler/UIxCalListingActions.m @@ -46,6 +46,7 @@ #import #import #import +#import #import #import @@ -1593,6 +1594,8 @@ _computeBlocksPosition (NSArray *blocks) statusFlag = [self _getStatusClassForStatusCode: statusCode andEndDateStamp: endDateStamp]; [filteredTask addObject: statusFlag]; + statusFlag = [iCalToDo statusForCode: statusCode]; + [filteredTask replaceObjectAtIndex: taskStatusIndex withObject: statusFlag]; if (endDateStamp > 0) [filteredTask addObject: [self _formattedDateForSeconds: endDateStamp forAllDay: NO]]; diff --git a/UI/Templates/SchedulerUI/UIxCalMainView.wox b/UI/Templates/SchedulerUI/UIxCalMainView.wox index 5077d4e1a..37d2c4fed 100644 --- a/UI/Templates/SchedulerUI/UIxCalMainView.wox +++ b/UI/Templates/SchedulerUI/UIxCalMainView.wox @@ -634,6 +634,7 @@ ng-class="{ 'sg-list-selectable': list.mode.multiple }">
-
-
{{::task.formatted_enddate}}
+
+
+ check + timelapse + error_outline repeat alarm
diff --git a/UI/Templates/SchedulerUI/UIxTaskViewTemplate.wox b/UI/Templates/SchedulerUI/UIxTaskViewTemplate.wox index 8564fa5ad..eb63bbccd 100644 --- a/UI/Templates/SchedulerUI/UIxTaskViewTemplate.wox +++ b/UI/Templates/SchedulerUI/UIxTaskViewTemplate.wox @@ -79,9 +79,17 @@

{{editor.component.localizedCompletedDate}} {{editor.component.localizedCompletedTime}}

- call_made + timelapse

{{editor.component.percentComplete}} %

+ + close +

+
+ + error_outline +

+
link diff --git a/UI/WebServerResources/js/Scheduler/Component.service.js b/UI/WebServerResources/js/Scheduler/Component.service.js index 5939c81fe..307b50dc3 100644 --- a/UI/WebServerResources/js/Scheduler/Component.service.js +++ b/UI/WebServerResources/js/Scheduler/Component.service.js @@ -698,7 +698,7 @@ */ Component.prototype.enablePercentComplete = function() { return (this.type == 'task' && - this.status != 'not-specified' && + this.percentComplete > 0 && this.status != 'cancelled'); }; diff --git a/UI/WebServerResources/scss/views/SchedulerUI.scss b/UI/WebServerResources/scss/views/SchedulerUI.scss index 58225249f..87574afbb 100644 --- a/UI/WebServerResources/scss/views/SchedulerUI.scss +++ b/UI/WebServerResources/scss/views/SchedulerUI.scss @@ -647,6 +647,12 @@ $quarter_height: 10px; } } +/* Tasks list */ + +.cancelled .sg-md-subhead { + text-decoration: line-through; +} + /* Attendees dialog Editor */ .attendees { max-height: ($list-item-height * 20); // show a maximum of 20 attendees