mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-27 00:57:19 +02:00
Next Report
- Removed all traces of the old next report. - Removed rc.next support.
This commit is contained in:
parent
5da435e70d
commit
b4fba5b08d
7 changed files with 13 additions and 209 deletions
3
NEWS
3
NEWS
|
@ -14,6 +14,7 @@ New Features in taskwarrior 2.0.0
|
||||||
- Reports may now be sorted by columns that are not displayed (example: ID,
|
- Reports may now be sorted by columns that are not displayed (example: ID,
|
||||||
project, due date and description sorted by urgency).
|
project, due date and description sorted by urgency).
|
||||||
- Performance enhancements.
|
- Performance enhancements.
|
||||||
|
- New 'next' report, that gauges urgency and reports the most urgent tasks.
|
||||||
|
|
||||||
Please refer to the ChangeLog file for full details. There are too many to
|
Please refer to the ChangeLog file for full details. There are too many to
|
||||||
list here.
|
list here.
|
||||||
|
@ -38,7 +39,7 @@ New configuration options in taskwarrior 2.0.0
|
||||||
|
|
||||||
Newly deprecated features in taskwarrior 2.0.0
|
Newly deprecated features in taskwarrior 2.0.0
|
||||||
|
|
||||||
-
|
- The 'next' configuration variable has been removed.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
|
@ -228,13 +228,6 @@ Controls left and right padding around each row of the report output. Default i
|
||||||
.B column.padding=0
|
.B column.padding=0
|
||||||
Controls padding between columns of the report output. Default is "1".
|
Controls padding between columns of the report output. Default is "1".
|
||||||
|
|
||||||
.TP
|
|
||||||
.B next=2
|
|
||||||
Is a number, defaulting to 2, which is the number of tasks for each project that
|
|
||||||
are shown in the
|
|
||||||
.B task next
|
|
||||||
command.
|
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
.B bulk=2
|
.B bulk=2
|
||||||
Is a number, defaulting to 2. When more than this number of tasks are modified
|
Is a number, defaulting to 2. When more than this number of tasks are modified
|
||||||
|
@ -247,10 +240,9 @@ This is useful for preventing large-scale unintended changes.
|
||||||
.TP
|
.TP
|
||||||
.B nag=You have higher priority tasks.
|
.B nag=You have higher priority tasks.
|
||||||
This may be a string of text, or blank. It is used as a prompt when a task is
|
This may be a string of text, or blank. It is used as a prompt when a task is
|
||||||
started or completed that is not considered high priority. The "task next"
|
started or completed that is not considered high priority. Default value is:
|
||||||
command lists important tasks, and completing one of those does not generate
|
You have higher priority tasks. It is a gentle reminder that you are
|
||||||
this nagging. Default value is: You have higher priority tasks. It is a gentle
|
contradicting your own priority settings.
|
||||||
reminder that you are contradicting your own priority settings.
|
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
.B complete.all.projects=yes
|
.B complete.all.projects=yes
|
||||||
|
@ -1023,7 +1015,7 @@ Lists all tasks matching the specified criteria.
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
.B next
|
.B next
|
||||||
Lists all tasks with upcoming due dates matching the specified criteria.
|
Lists the most important tasks.
|
||||||
|
|
||||||
.SH "CREDITS & COPYRIGHTS"
|
.SH "CREDITS & COPYRIGHTS"
|
||||||
Taskwarrior was written by P. Beckingham <paul@beckingham.net>.
|
Taskwarrior was written by P. Beckingham <paul@beckingham.net>.
|
||||||
|
|
|
@ -77,7 +77,6 @@ std::string Config::defaults =
|
||||||
"indent.report=0 # Indent spaces for whole report\n"
|
"indent.report=0 # Indent spaces for whole report\n"
|
||||||
"row.padding=0 # Left and right padding for each row of 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"
|
"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"
|
"bulk=2 # > 2 tasks considered 'a lot', for confirmation\n"
|
||||||
"nag=You have more urgent tasks. # Nag message to keep you honest\n" // TODO
|
"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"
|
"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"
|
"#report.all.annotations=full\n"
|
||||||
"\n"
|
"\n"
|
||||||
"# task next\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.description=Lists the most urgent tasks\n"
|
||||||
"report.next.columns=id,project,priority,due,start.active,entry.age,description\n"
|
"report.next.filter=status:pending limit:page\n"
|
||||||
"report.next.labels=ID,Project,Pri,Due,Active,Age,Description\n"
|
"report.next.labels=ID,Project,Pri,Due,A,Age,Urgency,Description\n"
|
||||||
"report.next.sort=due+,priority-,start-,project+,description+\n"
|
"report.next.sort=urgency-,due+,priority-,start-,project+,description+\n"
|
||||||
"report.next.filter=status:pending limit:page depends.none:\n"
|
|
||||||
"#report.next.dateformat=m/d/Y\n"
|
"#report.next.dateformat=m/d/Y\n"
|
||||||
"#report.next.annotations=full\n"
|
"#report.next.annotations=full\n"
|
||||||
"\n"
|
"\n"
|
||||||
|
|
|
@ -1109,7 +1109,7 @@ int handleShow (std::string& outs)
|
||||||
"default.priority default.project defaultwidth dependency.indicator due "
|
"default.priority default.project defaultwidth dependency.indicator due "
|
||||||
"dependency.confirmation dependency.reminder detection locale displayweeknumber "
|
"dependency.confirmation dependency.reminder detection locale displayweeknumber "
|
||||||
"export.ical.class echo.command fontunderline gc locking monthsperline "
|
"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 "
|
"journal.time.stop.annotation project shadow.command shadow.file "
|
||||||
"shadow.notify weekstart editor edit.verbose import.synonym.id import.synonym.uuid "
|
"shadow.notify weekstart editor edit.verbose import.synonym.id import.synonym.uuid "
|
||||||
"complete.all.projects complete.all.tags search.case.sensitive extensions "
|
"complete.all.projects complete.all.tags search.case.sensitive extensions "
|
||||||
|
|
|
@ -287,10 +287,10 @@ int handleCustomReport (const std::string& report, std::string& outs)
|
||||||
<< tasks.size ()
|
<< tasks.size ()
|
||||||
<< (tasks.size () == 1 ? " task" : " tasks");
|
<< (tasks.size () == 1 ? " task" : " tasks");
|
||||||
|
|
||||||
if (maxrows && maxrows < view.rows ())
|
if (maxrows && maxrows < tasks.size ())
|
||||||
out << ", " << maxrows << " shown";
|
out << ", " << maxrows << " shown";
|
||||||
|
|
||||||
if (maxlines && maxlines < view.rows ())
|
if (maxlines && maxlines < tasks.size ())
|
||||||
out << ", truncated to " << maxlines - table_header << " lines";
|
out << ", truncated to " << maxlines - table_header << " lines";
|
||||||
|
|
||||||
out << "\n";
|
out << "\n";
|
||||||
|
|
|
@ -106,7 +106,6 @@ int handleReportSummary (std::string&);
|
||||||
int handleReportCalendar (std::string&);
|
int handleReportCalendar (std::string&);
|
||||||
int handleReportStats (std::string&);
|
int handleReportStats (std::string&);
|
||||||
int handleReportTimesheet (std::string&);
|
int handleReportTimesheet (std::string&);
|
||||||
void gatherNextTasks (std::vector <Task>&);
|
|
||||||
std::string getFullDescription (Task&, const std::string&);
|
std::string getFullDescription (Task&, const std::string&);
|
||||||
std::string getDueDate (Task&, const std::string&);
|
std::string getDueDate (Task&, const std::string&);
|
||||||
std::string onProjectChange (Task&, bool scope = true);
|
std::string onProjectChange (Task&, bool scope = true);
|
||||||
|
|
187
src/report.cpp
187
src/report.cpp
|
@ -1912,193 +1912,6 @@ int handleReportStats (std::string& outs)
|
||||||
return rc;
|
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)
|
std::string getFullDescription (Task& task, const std::string& report)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue