6.0.0-alpha12
6/11/25

[#8973] Hermes to ignore completed nag tasks.
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

History
05/27/2010 08:41:38 PM Jan Schneider Comment #5 Reply to this comment
Agreed, both that we need to handle this consistently, and that we 
need a better way to deal with cost objects. That should be separate 
request though.
05/27/2010 08:26:17 PM Ben Klang Comment #4 Reply to this comment
It's the expected behavior, Hermes should show all tasks, not only completed.
This is different, however, from Whups' behavior.  In Hermes, only 
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.
04/18/2010 02:31:43 PM hall_monty (at) rastar (dot) merseine (dot) nu Comment #3 Reply to this comment
In the code comment, it said implementing $criteria  was a "todo 
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.
It's the expected behavior, Hermes should show all tasks, not only completed.
04/18/2010 12:15:22 PM Jan Schneider Comment #2
State ⇒ Rejected
Reply to this comment
It's the expected behavior, Hermes should show all tasks, not only completed.
04/17/2010 11:06:09 PM hall_monty (at) rastar (dot) merseine (dot) nu Comment #1
Priority ⇒ 1. Low
Patch ⇒ No
Milestone ⇒
Queue ⇒ Nag
Summary ⇒ Hermes to ignore completed nag tasks.
Type ⇒ Enhancement
State ⇒ New
Reply to this comment
I'm trying to get hermes to ignore completed tasks in nag.  Hermes, 
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)));
   }
}

Saved Queries