From 5ec0d569a940f251d48ae6837fd98afb2901269d Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Tue, 24 Mar 2009 23:15:55 -0400 Subject: [PATCH] Enhancement - annotations - Added annotated description to the active, overdue and next reports. --- src/report.cpp | 42 +++++++++++++++++++++++++++++++++++++++--- 1 file changed, 39 insertions(+), 3 deletions(-) diff --git a/src/report.cpp b/src/report.cpp index 76c5c75f4..00d74ffd1 100644 --- a/src/report.cpp +++ b/src/report.cpp @@ -736,7 +736,19 @@ std::string handleReportNext (TDB& tdb, T& task, Config& conf) table.addCell (row, 3, due); table.addCell (row, 4, active); table.addCell (row, 5, age); - table.addCell (row, 6, refTask.getDescription ()); + + std::string description = refTask.getDescription (); + std::string when; + std::map annotations; + refTask.getAnnotations (annotations); + foreach (anno, annotations) + { + Date dt (anno->first); + when = dt.toString (conf.get ("dateformat", "m/d/Y")); + description += "\n" + when + " " + anno->second; + } + + table.addCell (row, 6, description); if (conf.get ("color", true) || conf.get (std::string ("_forcecolor"), false)) { @@ -1542,7 +1554,19 @@ std::string handleReportActive (TDB& tdb, T& task, Config& conf) table.addCell (row, 1, refTask.getAttribute ("project")); table.addCell (row, 2, refTask.getAttribute ("priority")); table.addCell (row, 3, due); - table.addCell (row, 4, refTask.getDescription ()); + + std::string description = refTask.getDescription (); + std::string when; + std::map annotations; + refTask.getAnnotations (annotations); + foreach (anno, annotations) + { + Date dt (anno->first); + when = dt.toString (conf.get ("dateformat", "m/d/Y")); + description += "\n" + when + " " + anno->second; + } + + table.addCell (row, 4, description); if (conf.get ("color", true) || conf.get (std::string ("_forcecolor"), false)) { @@ -1656,7 +1680,19 @@ std::string handleReportOverdue (TDB& tdb, T& task, Config& conf) table.addCell (row, 1, refTask.getAttribute ("project")); table.addCell (row, 2, refTask.getAttribute ("priority")); table.addCell (row, 3, due); - table.addCell (row, 4, refTask.getDescription ()); + + std::string description = refTask.getDescription (); + std::string when; + std::map annotations; + refTask.getAnnotations (annotations); + foreach (anno, annotations) + { + Date dt (anno->first); + when = dt.toString (conf.get ("dateformat", "m/d/Y")); + description += "\n" + when + " " + anno->second; + } + + table.addCell (row, 4, description); if (conf.get ("color", true) || conf.get (std::string ("_forcecolor"), false)) {