View Full Version : Durration to Hours Worked
exothermic
03-11-04, 04:50 AM
On the project view page, how can I get the listing of the tasks to show Hours Worked instead of Durration. I'm guessing that is an easier change than just added Hours worked to the list, but that would work also.
Thanks
Miles
caseydk
03-11-04, 11:53 PM
If you look at the screen to display individual tasks, the query is there... it's a summation of the entries from the tasklog table for each task.
This is a relatively simple query but may introduce some overhead unless the "task_hours_worked" on the "tasks" table starts getting used. At this point, I don't believe it is as all of my entries are zero.
exothermic
05-11-04, 05:10 AM
I know where the query is, and what it looks like. My problem is just implimenting it into the duration colum of the project view.
caseydk
05-11-04, 06:16 AM
I think you should add it right next to the existing duration column... if something is scheduled to take 10 hours and 9 hours have passed, but the task is only 10% complete, that is worth knowing.
exothermic
11-11-04, 01:32 AM
Your really missing my question. I'm not asking the best location to place the information, or how to actucally get the information.
The question is: How to place the information in the location that I choose? I can follow most of the code but I get lost when it jumps into the function that sorts the rows, and then displays the information.
What line should I be looking at to insert my new code? I'm not really picky the location of the columb. I was just going for a straight replace since that way I don't have to modify the existing table structure, and don't really use durration.
If someone could hold my hand on this one a little that would be great
Thanks
caseydk
11-11-04, 11:00 PM
Go to the tasklogs table for the hours.
Then edit the given "view" page to add the query and the display.
exothermic
15-11-04, 05:07 PM
Ok I'm really not getting this. I'm speaking in reference to line 328 in /modules/tasks/tasks.php there is the table head tag for Duration. I want to do three things.
1.) Replace the text "Duration" with "Time Workd"
2.) Find and replace the sql statement for the duration columb and change it to a time worked select.
I know how to do 1 I just need to know how to do #2. Where is the sql statement that is filling that table below the <th> section?
Where are the other <td> tags coming from for the columbs under the headers?
exothermic
15-11-04, 07:23 PM
in tasks.php on lines 61+ I modified the $sql to the following
$select = "
tasks.task_id, task_parent, task_name, task_start_date, task_end_date,
task_priority, task_percent_complete, ROUND(SUM(task_log_hours),2) as task_duration, task_duration_type, task_project,
task_description, task_owner, user_username, task_milestone
";
$from = "tasks";
$join = "LEFT JOIN projects ON project_id = task_project";
$join .= " LEFT JOIN users as usernames ON task_owner = usernames.user_id";
$join .=" LEFT JOIN task_log ON task_log_task= tasks.task_id";
$where = $project_id ? "\ntask_project = $project_id" : 'project_active != 0';
$where .=" GROUP BY task_log_task";
it gets close but only lists one or two tasks in the table now instead of the whole list. What am I missing?
thanks Miles
caseydk
16-11-04, 01:28 AM
Now you are only pulling tasks which have task log entries. Therefore, you will not see tasks which have not been started.
Change that query back to what it was. Then go down towards 216 and use the task_id that you have from the first query and get the summation of all the task logs for that task.
exothermic
16-11-04, 06:03 AM
Ok it is all working now. I think I could even figure out how to drop in a new columb. dynamic tasks aren't displaying their hours properly, but that will just require a little logic dropped in.
Thanks for the help
zsolarewicz
21-08-08, 12:40 AM
Hi,
Since you have fought that subject-pls be so kind and help just a little:
Ok it is all working now. I think I could even figure out how to drop in a new columb. dynamic tasks aren't displaying their hours properly, but that will just require a little logic dropped in.
Thanks for the help
What makes total worked hours:
1.progress on a task
2.% of indyvidual human resource
3.none of above
I just only want to get Total Worked Hours (to be paid to me), hours worked by a few 'human resources', differently % engaged on various tasks.
vBulletin® v3.6.4, Copyright ©2000-2013, Jelsoft Enterprises Ltd.