[Tickets #8973] Hermes to ignore completed nag tasks.

bugs at horde.org bugs at horde.org
Sat Apr 17 23:06:09 UTC 2010


DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.

Ticket URL: http://bugs.horde.org/ticket/8973
------------------------------------------------------------------------------
  Ticket             | 8973
  Created By         | hall_monty at rastar.merseine.nu
  Summary            | Hermes to ignore completed nag tasks.
  Queue              | Nag
  Version            | 2.3.4
  Type               | Enhancement
  State              | New
  Priority           | 1. Low
  Milestone          |
  Patch              |
  Owners             |
------------------------------------------------------------------------------


hall_monty at rastar.merseine.nu (2010-04-17 19:06) wrote:

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)));
   }
}







More information about the bugs mailing list