Anonymous Login
2019-12-06 10:50 PST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0000522v4.0 Release (Planning)Taskspublic2016-12-29 10:16
Reporterpresocratics 
Assigned Tocaseydk 
PrioritynormalSeverityfeatureReproducibilityalways
StatusacknowledgedResolutionfixed 
Product Version 
Target Version4.0Fixed in Version4.0 
Summary0000522: Add 'Worked' column to task
DescriptionAdd a column to the task list that shows the amount of time worked next to the 'Duration' column.

New column name: 'Worked'
Change 'Duration' column to 'Estimated' (eliminates the ambiguity of the word 'Duration')
Additional InformationThis is my first patch. Let me know if it needs anything.
Known Issue: The new table cell does not change color with the rest of the row.
TagsNo tags attached.
Attached Files
  • diff file icon workedcolumn.diff (6,881 bytes) 1969-12-31 16:00 -
    Index: modules/tasks/tasks.class.php
    ===================================================================
    --- modules/tasks/tasks.class.php	(revision 47)
    +++ modules/tasks/tasks.class.php	(revision 48)
    @@ -2472,6 +2472,7 @@
     		$s .= w2PtoolTip('edit task', 'click to edit this task') . '<a href="?m=tasks&a=addedit&task_id=' . $arr['task_id'] . '">' . w2PshowImage('icons/pencil.gif', 12, 12) . '</a>' . w2PendTip();
     	}
     	$s .= '</td>';
    +	
     	// pinned
     	$pin_prefix = $arr['task_pinned'] ? '' : 'un';
     	$s .= ('<td align="center"><a href="?m=tasks&pin=' . ($arr['task_pinned'] ? 0 : 1) . '&task_id=' . $arr['task_id'] . '">' . w2PtoolTip('Pin', 'pin/unpin task') . '<img src="' . w2PfindImage('icons/' . $pin_prefix . 'pin.gif') . '" border="0" />' . w2PendTip() . '</a></td>');
    @@ -2507,6 +2508,7 @@
     	if ($arr['task_description']) {
     		$s .= w2PtoolTip('Task Description', $arr['task_description'], true);
     	}
    +	
     	$open_link = '<a href="javascript: void(0);"><img onclick="expand_collapse(\'project_' . $arr['task_project'] . '_level>' . $level . '<task_' . $arr['task_id'] . '_\', \'tblProjects\',\'\',' . ($level + 1) . ');" id="project_' . $arr['task_project'] . '_level>' . $level . '<task_' . $arr['task_id'] . '__collapse" src="' . w2PfindImage('icons/collapse.gif') . '" border="0" align="center" ' . (!$expanded ? 'style="display:none"' : '') . ' /><img onclick="expand_collapse(\'project_' . $arr['task_project'] . '_level>' . $level . '<task_' . $arr['task_id'] . '_\', \'tblProjects\',\'\',' . ($level + 1) . ');" id="project_' . $arr['task_project'] . '_level>' . $level . '<task_' . $arr['task_id'] . '__expand" src="' . w2PfindImage('icons/expand.gif') . '" border="0" align="center" ' . ($expanded ? 'style="display:none"' : '') . ' /></a>';
     	if ($arr['task_nr_of_children']) {
     		$is_parent = true;
    @@ -2530,6 +2532,7 @@
     	if ($arr['task_description']) {
     		$s .= w2PendTip();
     	}
    +	
     	if ($today_view) { // Show the project name
     		$s .= ('<td width="50%"><a href="./index.php?m=projects&a=view&project_id=' . $arr['task_project'] . '">' . '<span style="padding:2px;background-color:#' . $arr['project_color_identifier'] . ';color:' . bestColor($arr['project_color_identifier']) . '">' . $arr['project_name'] . '</span>' . '</a></td>');
     	}
    @@ -2563,7 +2566,11 @@
     		$s .= '<td align="center">-</td>';
     	}
     	// duration or milestone
    -	$s .= ('<td nowrap="nowrap" align="center" style="' . $style . '">' . ($start_date ? $start_date->format($fdf) : '-') . '</td>' . '<td align="right" nowrap="nowrap" style="' . $style . '">' . $arr['task_duration'] . ' ' . mb_substr($AppUI->_($durnTypes[$arr['task_duration_type']]), 0, 1) . '</td>' . '<td nowrap="nowrap" align="center" style="' . $style . '">' . ($end_date ? $end_date->format($fdf) : '-') . '</td>');
    +	
    +	$s .= ('<td nowrap="nowrap" align="center" style="' . $style . '">' . ($start_date ? $start_date->format($fdf) : '-') . '</td>' 
    +	   . "<td>".$arr['task_hours_worked']."</td>"
    +	   . '<td align="right" nowrap="nowrap" style="' . $style . '">' . $arr['task_duration'] . ' ' . mb_substr($AppUI->_($durnTypes[$arr['task_duration_type']]), 0, 1) . '</td>' . '<td nowrap="nowrap" align="center" style="' . $style . '">' . ($end_date ? $end_date->format($fdf) : '-') . '</td>');
    +	
     	if ($today_view) {
     		$s .= ('<td nowrap="nowrap" align="center" style="' . $style . '">' . $arr['task_due_in'] . '</td>');
     	} elseif ($history_active) {
    Index: modules/tasks/todo_tasks_sub.php
    ===================================================================
    --- modules/tasks/todo_tasks_sub.php	(revision 47)
    +++ modules/tasks/todo_tasks_sub.php	(revision 48)
    @@ -82,7 +82,8 @@
     	<th width="15" align="center"><?php sort_by_item_title('P', 'task_priority', SORT_NUMERIC, '&a=todo'); ?></th>
     	<th colspan="2"><?php sort_by_item_title('Task / Project', 'task_name', SORT_STRING, '&a=todo'); ?></th>
     	<th nowrap="nowrap"><?php sort_by_item_title('Start Date', 'task_start_date', SORT_NUMERIC, '&a=todo'); ?></th>
    -	<th nowrap="nowrap"><?php sort_by_item_title('Duration', 'task_duration', SORT_NUMERIC, '&a=todo'); ?></th>
    +	<th nowrap="nowrap">Worked<?php //sort_by_item_title('Estimated', 'task_duration', SORT_NUMERIC, '&a=todo'); ?></th>
    +	<th nowrap="nowrap"><?php sort_by_item_title('Estimated', 'task_duration', SORT_NUMERIC, '&a=todo'); ?></th>
     	<th nowrap="nowrap"><?php sort_by_item_title('Finish Date', 'task_end_date', SORT_NUMERIC, '&a=todo'); ?></th>
     	<th nowrap="nowrap"><?php sort_by_item_title('Due In', 'task_due_in', SORT_NUMERIC, '&a=todo'); ?></th>
     	<?php if (w2PgetConfig('direct_edit_assignment')) { ?><th width="0">&nbsp;</th><?php } ?>
    Index: modules/tasks/tasks.php
    ===================================================================
    --- modules/tasks/tasks.php	(revision 47)
    +++ modules/tasks/tasks.php	(revision 48)
    @@ -132,6 +132,7 @@
     $q->addQuery('task_priority, task_percent_complete');
     $q->addQuery('task_duration, task_duration_type');
     $q->addQuery('task_project');
    +$q->addQuery('task_hours_worked');
     $q->addQuery('task_description, task_owner, task_status');
     $q->addQuery('usernames.user_username, usernames.user_id');
     $q->addQuery('assignees.user_username as assignee_username');
    @@ -466,7 +467,8 @@
     		<th nowrap="nowrap"><?php sort_by_item_title('Task Owner', 'user_username', SORT_STRING); ?></th>
     		<th nowrap="nowrap"><?php echo $AppUI->_('Assigned Users') ?></th>
     		<th nowrap="nowrap"><?php sort_by_item_title('Start Date', 'task_start_date', SORT_NUMERIC); ?></th>
    -		<th nowrap="nowrap"><?php sort_by_item_title('Duration', 'task_duration', SORT_NUMERIC); ?>&nbsp;&nbsp;</th>
    +		<th nowrap="nowrap">Worked <?php //sort_by_item_title('Worked', 'task_start_date', SORT_NUMERIC); ?></th>
    +		<th nowrap="nowrap"><?php sort_by_item_title('Estimated', 'task_duration', SORT_NUMERIC); ?>&nbsp;&nbsp;</th>
     		<th nowrap="nowrap"><?php sort_by_item_title('Finish Date', 'task_end_date', SORT_NUMERIC); ?></th>
     		<?php 
     			if (!empty($mods['history']) && !getDenyRead('history')) { 
    @@ -515,7 +517,8 @@
     					   <?php echo $open_link; ?>
     					  </td>
     					  <td colspan="<?php echo $w2Pconfig['direct_edit_assignment'] ? $cols - 4 : $cols - 1; ?>">
    -						  <table width="100%" border="0">
    +						 
    +					  	<table width="100%" border="0">
     							  <tr>
     									<!-- patch 2.12.04 display company name next to project name -->
     									<td nowrap="nowrap" style="border: outset #eeeeee 1px;background-color:#<?php echo $p['project_color_identifier']; ?>">
    @@ -593,6 +596,10 @@
     					$parent_tasks = array();
     					reset($p);
     					//1st pass) parent tasks and its children
    +	//echo "<pre>";
    +//	print_r($p['tasks']);
    +	//echo "</pre>"; exit;
    +	
     					foreach ($p['tasks'] as $i => $t1) {
     						if (($t1['task_parent'] == $t1['task_id']) && !$task_id) {
     							//Here we are NOT on a task view context, like the tasks module list or the project view tasks list.
    
    diff file icon workedcolumn.diff (6,881 bytes) 1969-12-31 16:00 +

-Relationships
has duplicate 0000879closedcaseydk Pending Requests Include "time spent" in Project Task Overview 
related to 0000061closedcaseydk v2.3 Release (Closed) Customize List Screens 
child of 0001351acknowledgedcaseydk v4.0 Release (Planning) Customizing Task columns does not work properly 
+Relationships

-Notes

~0001193

caseydk (administrator)

This should be even easier under 2.0+ as we have the "task_hours_worked" field on the Tasks table and we're working to make the fields more flexible on the list screens.

~0001576

caseydk (administrator)

Reviewing this one, I don't think we actually want 'task_hours_worked' in this scenario. The Task List screen is supposed to show the estimate time something will take, not how much time it has taken so far.

Regardless the text change makes a lot of sense.

~0001700

caseydk (administrator)

This one will be easier one the flexicolumns (beginning implementation in v2.3) are expanded to the Tasks module.

~0003557

caseydk (administrator)

Resolved on master development as of here:
https://github.com/web2project/web2project/commit/c650cc4a4baf649634dde7421444838b1aadd7b7

~0003821

caseydk (administrator)


I'm changing this issue to acknowledged.

While it's resolved in the v4.0 development branch. That is going to be reviewed commit by commit and merged into a new development branch over the next couple months.
+Notes

-Issue History
Date Modified Username Field Change
2010-07-28 13:13 presocratics New Issue
2010-07-28 13:13 presocratics File Added: workedcolumn.diff
2010-07-29 23:21 caseydk Project v1.3 Release (Closed) => Pending Requests
2010-08-12 22:16 caseydk Note Added: 0001193
2010-08-12 22:17 caseydk Status new => assigned
2010-08-12 22:17 caseydk Assigned To => caseydk
2010-12-28 21:11 caseydk Relationship added child of 0000061
2011-01-21 23:46 caseydk Note Added: 0001576
2011-02-24 01:10 caseydk Project Pending Requests => v2.4 Release (Closed)
2011-02-28 20:24 caseydk Note Added: 0001700
2011-03-08 22:16 caseydk Relationship replaced related to 0000061
2011-06-25 23:49 caseydk Project v2.4 Release (Closed) => Pending Requests
2014-01-01 17:07 caseydk Project Pending Requests => v3.2 Release
2014-01-21 17:58 caseydk Target Version => 3.2
2014-01-25 00:45 caseydk Category General => Tasks
2014-02-14 20:26 caseydk Relationship added child of 0001351
2014-03-13 12:43 caseydk Project v3.2 Release => Pending Requests
2014-03-13 12:43 caseydk Category Tasks => General
2014-04-05 17:23 caseydk Category General => Tasks
2014-04-05 17:23 caseydk Product Version 1.3 =>
2014-04-05 17:23 caseydk Target Version 3.2 =>
2014-05-21 02:10 caseydk Relationship added has duplicate 0000879
2014-08-01 21:42 caseydk Project Pending Requests => v4.0 Release (Planning)
2014-08-01 21:44 caseydk Note Added: 0003557
2014-08-01 21:44 caseydk Status assigned => resolved
2014-08-01 21:44 caseydk Fixed in Version => 4.0
2014-08-01 21:44 caseydk Resolution open => fixed
2014-10-12 12:50 caseydk Target Version => 4.0
2016-12-29 10:16 caseydk Status resolved => acknowledged
2016-12-29 10:16 caseydk Note Added: 0003821
+Issue History