Next Report

- Removed all traces of the old next report.
- Removed rc.next support.
This commit is contained in:
Paul Beckingham 2011-05-08 19:27:29 -04:00
parent 5da435e70d
commit b4fba5b08d
7 changed files with 13 additions and 209 deletions

View file

@ -77,7 +77,6 @@ std::string Config::defaults =
"indent.report=0 # Indent spaces for whole report\n"
"row.padding=0 # Left and right padding for each row of report\n"
"column.padding=1 # Spaces between each column in a report\n"
"next=2 # How many tasks per project in next report\n"
"bulk=2 # > 2 tasks considered 'a lot', for confirmation\n"
"nag=You have more urgent tasks. # Nag message to keep you honest\n" // TODO
"search.case.sensitive=yes # Setting to no allows case insensitive searches\n"
@ -416,11 +415,11 @@ std::string Config::defaults =
"#report.all.annotations=full\n"
"\n"
"# task next\n"
"report.next.columns=id,project,priority,due,start.active,entry.age,urgency,description\n"
"report.next.description=Lists the most urgent tasks\n"
"report.next.columns=id,project,priority,due,start.active,entry.age,description\n"
"report.next.labels=ID,Project,Pri,Due,Active,Age,Description\n"
"report.next.sort=due+,priority-,start-,project+,description+\n"
"report.next.filter=status:pending limit:page depends.none:\n"
"report.next.filter=status:pending limit:page\n"
"report.next.labels=ID,Project,Pri,Due,A,Age,Urgency,Description\n"
"report.next.sort=urgency-,due+,priority-,start-,project+,description+\n"
"#report.next.dateformat=m/d/Y\n"
"#report.next.annotations=full\n"
"\n"

View file

@ -1109,7 +1109,7 @@ int handleShow (std::string& outs)
"default.priority default.project defaultwidth dependency.indicator due "
"dependency.confirmation dependency.reminder detection locale displayweeknumber "
"export.ical.class echo.command fontunderline gc locking monthsperline "
"nag next journal.time journal.time.start.annotation journal.info "
"nag journal.time journal.time.start.annotation journal.info "
"journal.time.stop.annotation project shadow.command shadow.file "
"shadow.notify weekstart editor edit.verbose import.synonym.id import.synonym.uuid "
"complete.all.projects complete.all.tags search.case.sensitive extensions "

View file

@ -287,10 +287,10 @@ int handleCustomReport (const std::string& report, std::string& outs)
<< tasks.size ()
<< (tasks.size () == 1 ? " task" : " tasks");
if (maxrows && maxrows < view.rows ())
if (maxrows && maxrows < tasks.size ())
out << ", " << maxrows << " shown";
if (maxlines && maxlines < view.rows ())
if (maxlines && maxlines < tasks.size ())
out << ", truncated to " << maxlines - table_header << " lines";
out << "\n";

View file

@ -106,7 +106,6 @@ int handleReportSummary (std::string&);
int handleReportCalendar (std::string&);
int handleReportStats (std::string&);
int handleReportTimesheet (std::string&);
void gatherNextTasks (std::vector <Task>&);
std::string getFullDescription (Task&, const std::string&);
std::string getDueDate (Task&, const std::string&);
std::string onProjectChange (Task&, bool scope = true);

View file

@ -1912,193 +1912,6 @@ int handleReportStats (std::string& outs)
return rc;
}
////////////////////////////////////////////////////////////////////////////////
void gatherNextTasks (std::vector <Task>& tasks)
{
// For counting tasks by project.
std::map <std::string, int> countByProject;
std::map <int, bool> matching;
std::vector <Task> filtered;
Date now;
// How many items per project? Default 2.
int limit = context.config.getInteger ("next");
// due:< 1wk, pri:*
std::vector <Task>::iterator task;
for (task = tasks.begin (); task != tasks.end (); ++task)
{
if (task->has ("due"))
{
Date d (atoi (task->get ("due").c_str ()));
if (d < now + (7 * 24 * 60 * 60)) // if due:< 1wk
{
std::string project = task->get ("project");
if (countByProject[project] < limit && matching.find (task->id) == matching.end ())
{
++countByProject[project];
matching[task->id] = true;
filtered.push_back (*task);
}
}
}
}
// blocking, not blocked
for (task = tasks.begin (); task != tasks.end (); ++task)
{
if (dependencyIsBlocking (*task) &&
! dependencyIsBlocked (*task))
{
std::string project = task->get ("project");
if (countByProject[project] < limit && matching.find (task->id) == matching.end ())
{
++countByProject[project];
matching[task->id] = true;
filtered.push_back (*task);
}
}
}
// due:*, pri:H
for (task = tasks.begin (); task != tasks.end (); ++task)
{
if (task->has ("due"))
{
std::string priority = task->get ("priority");
if (priority == "H")
{
std::string project = task->get ("project");
if (countByProject[project] < limit && matching.find (task->id) == matching.end ())
{
++countByProject[project];
matching[task->id] = true;
filtered.push_back (*task);
}
}
}
}
// pri:H
for (task = tasks.begin (); task != tasks.end (); ++task)
{
std::string priority = task->get ("priority");
if (priority == "H")
{
std::string project = task->get ("project");
if (countByProject[project] < limit && matching.find (task->id) == matching.end ())
{
++countByProject[project];
matching[task->id] = true;
filtered.push_back (*task);
}
}
}
// due:*, pri:M
for (task = tasks.begin (); task != tasks.end (); ++task)
{
if (task->has ("due"))
{
std::string priority = task->get ("priority");
if (priority == "M")
{
std::string project = task->get ("project");
if (countByProject[project] < limit && matching.find (task->id) == matching.end ())
{
++countByProject[project];
matching[task->id] = true;
filtered.push_back (*task);
}
}
}
}
// pri:M
for (task = tasks.begin (); task != tasks.end (); ++task)
{
std::string priority = task->get ("priority");
if (priority == "M")
{
std::string project = task->get ("project");
if (countByProject[project] < limit && matching.find (task->id) == matching.end ())
{
++countByProject[project];
matching[task->id] = true;
filtered.push_back (*task);
}
}
}
// due:*, pri:L
for (task = tasks.begin (); task != tasks.end (); ++task)
{
if (task->has ("due"))
{
std::string priority = task->get ("priority");
if (priority == "L")
{
std::string project = task->get ("project");
if (countByProject[project] < limit && matching.find (task->id) == matching.end ())
{
++countByProject[project];
matching[task->id] = true;
filtered.push_back (*task);
}
}
}
}
// pri:L
for (task = tasks.begin (); task != tasks.end (); ++task)
{
std::string priority = task->get ("priority");
if (priority == "L")
{
std::string project = task->get ("project");
if (countByProject[project] < limit && matching.find (task->id) == matching.end ())
{
++countByProject[project];
matching[task->id] = true;
filtered.push_back (*task);
}
}
}
// due:, pri:
for (task = tasks.begin (); task != tasks.end (); ++task)
{
if (task->has ("due"))
{
std::string priority = task->get ("priority");
if (priority == "")
{
std::string project = task->get ("project");
if (countByProject[project] < limit && matching.find (task->id) == matching.end ())
{
++countByProject[project];
matching[task->id] = true;
filtered.push_back (*task);
}
}
}
}
// Filler.
for (task = tasks.begin (); task != tasks.end (); ++task)
{
std::string project = task->get ("project");
if (countByProject[project] < limit && matching.find (task->id) == matching.end ())
{
++countByProject[project];
matching[task->id] = true;
filtered.push_back (*task);
}
}
tasks = filtered;
}
///////////////////////////////////////////////////////////////////////////////
std::string getFullDescription (Task& task, const std::string& report)
{