Enhancement - info on recurring tasks

- Added recurrence information (parent, mask, imask, recur, until)
  to the info report when the task is either a recurring task or a
  synthetic task.
This commit is contained in:
Paul Beckingham 2009-05-05 01:03:07 -04:00
parent 2cc625f631
commit 410a63fe14
3 changed files with 39 additions and 21 deletions

View file

@ -4,6 +4,8 @@
1.7.0 (?) ?
+ Improved the errors when parsing a corrupt or unrecognized pending.data
or completed.data file (thanks to T. Charles Yun).
+ Added details to the "info" report about recurring tasks (thanks to T.
Charles Yun).
------ old releases ------------------------------

View file

@ -116,6 +116,8 @@
<ul>
<li>Improved the errors when parsing a corrupt or unrecognized pending.data
or completed.data file (thanks to T. Charles Yun).
<li>Added details to the "info" report about recurring tasks (thanks to T.
Charles Yun).
</ul>
<p>

View file

@ -299,13 +299,17 @@ std::string handleInfo (TDB& tdb, T& task, Config& conf)
table.addCell (row, 0, "ID");
table.addCell (row, 1, refTask.getId ());
row = table.addRow ();
table.addCell (row, 0, "Status");
table.addCell (row, 1, ( refTask.getStatus () == T::pending ? "Pending"
std::string status = refTask.getStatus () == T::pending ? "Pending"
: refTask.getStatus () == T::completed ? "Completed"
: refTask.getStatus () == T::deleted ? "Deleted"
: refTask.getStatus () == T::recurring ? "Recurring"
: ""));
: "";
if (refTask.getAttribute ("parent") != "")
status += " (Recurring)";
row = table.addRow ();
table.addCell (row, 0, "Status");
table.addCell (row, 1, status);
std::string description = refTask.getDescription ();
std::string when;
@ -336,16 +340,25 @@ std::string handleInfo (TDB& tdb, T& task, Config& conf)
table.addCell (row, 1, refTask.getAttribute ("priority"));
}
if (refTask.getStatus () == T::recurring)
if (refTask.getStatus () == T::recurring ||
refTask.getAttribute ("parent") != "")
{
if (refTask.getAttribute ("recur") != "")
{
row = table.addRow ();
table.addCell (row, 0, "Recurrence");
table.addCell (row, 1, refTask.getAttribute ("recur"));
}
if (refTask.getAttribute ("until") != "")
{
row = table.addRow ();
table.addCell (row, 0, "Recur until");
table.addCell (row, 1, refTask.getAttribute ("until"));
}
if (refTask.getAttribute ("mask") != "")
{
row = table.addRow ();
table.addCell (row, 0, "Mask");
table.addCell (row, 1, refTask.getAttribute ("mask"));
@ -356,6 +369,7 @@ std::string handleInfo (TDB& tdb, T& task, Config& conf)
row = table.addRow ();
table.addCell (row, 0, "Parent task");
table.addCell (row, 1, refTask.getAttribute ("parent"));
}
row = table.addRow ();
table.addCell (row, 0, "Mask Index");