From 1f45e47e367911f87863860fdb67f40c70050e7a Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Tue, 10 Mar 2009 16:37:35 -0400 Subject: [PATCH] Bug Fix - history/ghistory triggered only by add - Fixed bug whereby if a new month rolls around, and no task is added, no row of data is shown in the history or ghistory reports, even though tasks may have been completed or deleted ni the new month. --- src/report.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/report.cpp b/src/report.cpp index d4e405723..c88633ba0 100644 --- a/src/report.cpp +++ b/src/report.cpp @@ -813,6 +813,7 @@ std::string handleReportHistory (TDB& tdb, T& task, Config& conf) if (task.getStatus () == T::deleted) { epoch = monthlyEpoch (task.getAttribute ("end")); + groups[epoch] = 0; if (deletedGroup.find (epoch) != deletedGroup.end ()) deletedGroup[epoch] = deletedGroup[epoch] + 1; @@ -822,6 +823,7 @@ std::string handleReportHistory (TDB& tdb, T& task, Config& conf) else if (task.getStatus () == T::completed) { epoch = monthlyEpoch (task.getAttribute ("end")); + groups[epoch] = 0; if (completedGroup.find (epoch) != completedGroup.end ()) completedGroup[epoch] = completedGroup[epoch] + 1; @@ -852,6 +854,7 @@ std::string handleReportHistory (TDB& tdb, T& task, Config& conf) if (task.getStatus () == T::deleted) { epoch = monthlyEpoch (task.getAttribute ("end")); + groups[epoch] = 0; if (deletedGroup.find (epoch) != deletedGroup.end ()) deletedGroup[epoch] = deletedGroup[epoch] + 1; @@ -861,6 +864,8 @@ std::string handleReportHistory (TDB& tdb, T& task, Config& conf) else if (task.getStatus () == T::completed) { epoch = monthlyEpoch (task.getAttribute ("end")); + groups[epoch] = 0; + if (completedGroup.find (epoch) != completedGroup.end ()) completedGroup[epoch] = completedGroup[epoch] + 1; else @@ -906,9 +911,9 @@ std::string handleReportHistory (TDB& tdb, T& task, Config& conf) { row = table.addRow (); - totalAdded += addedGroup[i->first]; - totalCompleted += completedGroup[i->first]; - totalDeleted += deletedGroup[i->first]; + totalAdded += addedGroup [i->first]; + totalCompleted += completedGroup [i->first]; + totalDeleted += deletedGroup [i->first]; Date dt (i->first); int m, d, y;