Summary | Hermes to ignore completed nag tasks. |
Queue | Nag |
Queue Version | 2.3.4 |
Type | Enhancement |
State | Rejected |
Priority | 1. Low |
Owners | |
Requester | hall_monty (at) rastar (dot) merseine (dot) nu |
Created | 04/17/2010 (5534 days ago) |
Due | |
Updated | 05/27/2010 (5494 days ago) |
Assigned | |
Resolved | 04/18/2010 (5533 days ago) |
Milestone | |
Patch | No |
need a better way to deal with cost objects. That should be separate
request though.
tickets in one of the "open" states are shown. This has its own
practical problems because 1) you can't track time to closed tickets
and 2) When reviewing time on closed tickets the UI shows strange
things.
However I agree with the reporter that having such a large drop-down
is unmanageable. I think we need to find a third solution.
item". It doesn't seem like current behavior is what is ultimately
wanted. Otherwise calling functions would be passing null criteria -
or just strip out the arg altogether. 50-60 tasks in a drop down box
is extremely annoying.
I think I will stick with my fix.
State ⇒ Rejected
Priority ⇒ 1. Low
Patch ⇒ No
Milestone ⇒
Queue ⇒ Nag
Summary ⇒ Hermes to ignore completed nag tasks.
Type ⇒ Enhancement
State ⇒ New
does in fact make a request for incomplete tasks via
hermes/lib/Forms/Time.php:
$criteria = array('user' => Auth::getAuth(), 'active' => true)
However in the nag/lib/api.php, the list tasks, ignores the criteria
(per the code comment)
Making the following changes appear to work:
while ($task = $tasks->each()) {
if ($criteria['active'] == $task->completed)
continue;
However, I have no idea what side effects I just introduced. :(
Monty
====== nag/api.php======
/**
* Lists active tasks as cost objects.
* * @todo Implement $criteria parameter.
*
* @param array $criteria Filter attributes
*/
function _nag_listCostObjects($criteria)
{
require_once dirname(__FILE__) . '/base.php';
$tasks = Nag::listTasks(null, null, null, null, 1);
$result = array();
$tasks->reset();
while ($task = $tasks->each()) {
$result[$task->id] = array('id' => $task->id,
'active' => !$task->completed,
'name' => $task->name);
if (!empty($task->estimate)) {
$result[$task->id]['estimate'] = $task->estimate;
}
}
if (count($result) == 0) {
return array();
} else {
return array(array('category' => _("Tasks"),
'objects' => array_values($result)));
}
}