I am working for a project management system. when i installed tracker on project page its estimated time calculation is wrong. it add ups estimated time of all projected posted in the system. and remaining time is the total time in the task.
I think i found the problem , but need to reviewed and tested , as i am looking at only this function i am not sure whether changing code will affect any other function.
in function time_estimate_nodeapi in time_estimate.module
earlier code was
$project_results = db_query("SELECT * FROM {node} WHERE type = %d", $node->type);
actually it query all node type of project, and looped to make the total time. I changed it to
$project_results = db_query("SELECT * FROM {casetracker_case} WHERE pid = %d", $node->nid);
so the result will have an array of 'tickets' , adding estimated time of all tickets will give total project estimated time. and adding 'all logged time of tickets in that projects gives total logged time
and remaining is displayed as total estimated-logged.
the remaining works fine.
Please review the code.
Sarath
Drupal development services
Comments
Comment #1
drclaw commentedThanks for this! I've tested it out and made the changes. It will be committed very soon...