mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
Feature - new field 'priority_long'
- The new 'priority_long' field can be shown in custom reports, and will display 'High' rather than the abbreviated 'H'. - Unit tests.
This commit is contained in:
parent
dca4772f33
commit
db707d5e15
4 changed files with 99 additions and 3 deletions
|
@ -218,6 +218,26 @@ int runCustomReport (
|
|||
table.addCell (row++, columnCount, task->get ("priority"));
|
||||
}
|
||||
|
||||
else if (*col == "priority_long")
|
||||
{
|
||||
table.addColumn (columnLabels[*col] != "" ? columnLabels[*col] : "Pri");
|
||||
table.setColumnWidth (columnCount, Table::minimum);
|
||||
table.setColumnJustification (columnCount, Table::left);
|
||||
|
||||
int row = 0;
|
||||
std::string pri;
|
||||
foreach (task, tasks)
|
||||
{
|
||||
pri = task->get ("priority");
|
||||
|
||||
if (pri == "H") pri = "High"; // TODO i18n
|
||||
else if (pri == "M") pri = "Medium"; // TODO i18n
|
||||
else if (pri == "L") pri = "Low"; // TODO i18n
|
||||
|
||||
table.addCell (row++, columnCount, pri);
|
||||
}
|
||||
}
|
||||
|
||||
else if (*col == "entry")
|
||||
{
|
||||
table.addColumn (columnLabels[*col] != "" ? columnLabels[*col] : "Added");
|
||||
|
@ -632,6 +652,7 @@ void validReportColumns (const std::vector <std::string>& columns)
|
|||
*it != "uuid" &&
|
||||
*it != "project" &&
|
||||
*it != "priority" &&
|
||||
*it != "priority_long" &&
|
||||
*it != "entry" &&
|
||||
*it != "entry_time" &&
|
||||
*it != "start" &&
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue