diff --git a/NEWS b/NEWS index 0bc8672d6..c52bce947 100644 --- a/NEWS +++ b/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, project, due date and description sorted by urgency). - 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 list here. @@ -38,7 +39,7 @@ New configuration options in taskwarrior 2.0.0 Newly deprecated features in taskwarrior 2.0.0 - - + - The 'next' configuration variable has been removed. --- diff --git a/doc/man/taskrc.5.in b/doc/man/taskrc.5.in index a44ae1aa3..6500c1908 100644 --- a/doc/man/taskrc.5.in +++ b/doc/man/taskrc.5.in @@ -228,13 +228,6 @@ Controls left and right padding around each row of the report output. Default i .B column.padding=0 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 .B bulk=2 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 .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 -started or completed that is not considered high priority. The "task next" -command lists important tasks, and completing one of those does not generate -this nagging. Default value is: You have higher priority tasks. It is a gentle -reminder that you are contradicting your own priority settings. +started or completed that is not considered high priority. Default value is: +You have higher priority tasks. It is a gentle reminder that you are +contradicting your own priority settings. .TP .B complete.all.projects=yes @@ -1023,7 +1015,7 @@ Lists all tasks matching the specified criteria. .TP .B next -Lists all tasks with upcoming due dates matching the specified criteria. +Lists the most important tasks. .SH "CREDITS & COPYRIGHTS" Taskwarrior was written by P. Beckingham . diff --git a/src/Config.cpp b/src/Config.cpp index 2d84dde18..4eb57d032 100644 --- a/src/Config.cpp +++ b/src/Config.cpp @@ -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" diff --git a/src/command.cpp b/src/command.cpp index 5bc87142b..674b8474c 100644 --- a/src/command.cpp +++ b/src/command.cpp @@ -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 " diff --git a/src/custom.cpp b/src/custom.cpp index 05e36e4bb..5e569461a 100644 --- a/src/custom.cpp +++ b/src/custom.cpp @@ -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"; diff --git a/src/main.h b/src/main.h index 262d3042c..4c4cdf876 100644 --- a/src/main.h +++ b/src/main.h @@ -106,7 +106,6 @@ int handleReportSummary (std::string&); int handleReportCalendar (std::string&); int handleReportStats (std::string&); int handleReportTimesheet (std::string&); -void gatherNextTasks (std::vector &); std::string getFullDescription (Task&, const std::string&); std::string getDueDate (Task&, const std::string&); std::string onProjectChange (Task&, bool scope = true); diff --git a/src/report.cpp b/src/report.cpp index 27f965991..309c82228 100644 --- a/src/report.cpp +++ b/src/report.cpp @@ -1912,193 +1912,6 @@ int handleReportStats (std::string& outs) return rc; } -//////////////////////////////////////////////////////////////////////////////// -void gatherNextTasks (std::vector & tasks) -{ - // For counting tasks by project. - std::map countByProject; - std::map matching; - std::vector filtered; - Date now; - - // How many items per project? Default 2. - int limit = context.config.getInteger ("next"); - - // due:< 1wk, pri:* - std::vector ::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) {