Enhancement - Custom report limit override

- If a custom report has a specified limit to the number of tasks
  it shows, then that limit may be  overridden by specifying a new
  quantity on the command line.
- Added unit tests to verify expected behavior.
- Updated documentation to reflect new functionality.
- Removed obsolete documentation references to an "oldest" and
  "newest" configuration variable.
This commit is contained in:
Paul Beckingham 2009-05-09 22:32:40 -04:00
parent 72f84b3c3e
commit 1c736a319d
6 changed files with 79 additions and 29 deletions

View file

@ -2521,8 +2521,18 @@ std::string handleCustomReport (
}
}
// Limit the number of rows according to the report definition.
int maximum = conf.get (std::string ("report.") + report + ".limit", (int)0);
// If the custom report has a defined limit, then allow an override, which
// will show up as a single ID sequence.
if (conf.get (std::string ("report.") + report + ".limit", (int)0) != 0)
{
std::vector <int> sequence = task.getAllIds ();
if (sequence.size () == 1)
maximum = sequence[0];
}
std::stringstream out;
if (table.rowCount ())
out << optionalBlankLine (conf)