Bug Fix - #317, timesheet report

- Fixed bug #317 which colored tasks in the 'completed' report according to
  due dates, which are no longer relevant to a completed task (thanks to
  Cory Donnelly).
- Fixed bug that was causing the 'completed' report to sort incorrectly.
This commit is contained in:
Paul Beckingham 2009-11-18 20:29:45 -05:00
parent e319359935
commit 5e905742ad
3 changed files with 15 additions and 4 deletions

View file

@ -9,6 +9,10 @@
was run, and there are no tasks with due dates. was run, and there are no tasks with due dates.
+ Fixed bug #316 which caused the timesheet report to display an oddly sorted + Fixed bug #316 which caused the timesheet report to display an oddly sorted
list. list.
+ Fixed bug #317 which colored tasks in the 'completed' report according to
due dates, which are no longer relevant to a completed task (thanks to
Cory Donnelly).
+ Fixed bug that was causing the 'completed' report to sort incorrectly.
------ old releases ------------------------------ ------ old releases ------------------------------

View file

@ -460,6 +460,7 @@ int runCustomReport (
std::string column = sortColumn->substr (0, sortColumn->length () - 1); std::string column = sortColumn->substr (0, sortColumn->length () - 1);
char direction = (*sortColumn)[sortColumn->length () - 1]; char direction = (*sortColumn)[sortColumn->length () - 1];
// TODO This code should really be using Att::type.
if (column == "id") if (column == "id")
table.sortOn (columnIndex[column], table.sortOn (columnIndex[column],
(direction == '+' ? (direction == '+' ?
@ -473,7 +474,7 @@ int runCustomReport (
Table::descendingPriority)); Table::descendingPriority));
else if (column == "entry" || column == "start" || column == "due" || else if (column == "entry" || column == "start" || column == "due" ||
column == "wait") column == "wait" || column == "until" || column == "end")
table.sortOn (columnIndex[column], table.sortOn (columnIndex[column],
(direction == '+' ? (direction == '+' ?
Table::ascendingDate : Table::ascendingDate :

View file

@ -58,6 +58,8 @@ void autoColorize (Task& task, Color& c)
// Note: fg, bg already contain colors specifically assigned via command. // Note: fg, bg already contain colors specifically assigned via command.
// Note: These rules form a hierarchy - the last rule is King. // Note: These rules form a hierarchy - the last rule is King.
Task::status status = task.getStatus ();
// Colorization of the tagged. // Colorization of the tagged.
if (gsColor["color.tagged"].nontrivial ()) if (gsColor["color.tagged"].nontrivial ())
if (task.getTagCount ()) if (task.getTagCount ())
@ -83,8 +85,10 @@ void autoColorize (Task& task, Color& c)
if (task.get ("priority") == "") if (task.get ("priority") == "")
c.blend (gsColor["color.pri.none"]); c.blend (gsColor["color.pri.none"]);
// Colorization of the active. // Colorization of the active, if not completed/deleted.
if (gsColor["color.active"].nontrivial ()) if (gsColor["color.active"].nontrivial () &&
status != Task::completed &&
status != Task::deleted)
if (task.has ("start")) if (task.has ("start"))
c.blend (gsColor["color.active"]); c.blend (gsColor["color.active"]);
@ -124,7 +128,9 @@ void autoColorize (Task& task, Color& c)
} }
// Colorization of the due and overdue. // Colorization of the due and overdue.
if (task.has ("due")) if (task.has ("due") &&
status != Task::completed &&
status != Task::deleted)
{ {
std::string due = task.get ("due"); std::string due = task.get ("due");
switch (getDueState (due)) switch (getDueState (due))