* Adjust the summary of the task hours in my module.
This commit is contained in:
@@ -152,6 +152,7 @@
|
||||
</form>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
<?php js::set('tasks', $tasks);?>
|
||||
<script>
|
||||
$(function()
|
||||
{
|
||||
@@ -184,30 +185,12 @@ $(function()
|
||||
}
|
||||
var data = $row.data();
|
||||
taskIdList.push(data.id);
|
||||
|
||||
var status = data.status;
|
||||
if(status === 'wait') checkedWait++;
|
||||
if(status === 'doing') checkedDoing++;
|
||||
|
||||
var canStatistics = false;
|
||||
if(!$row.hasClass('table-children'))
|
||||
{
|
||||
canStatistics = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Fix bug #2579. When only child task is checked then statistics it. */
|
||||
var parentID = 0;
|
||||
var classes = $row.attr('class').split(' ');
|
||||
for(i in classes)
|
||||
{
|
||||
if(classes[i].indexOf('parent-') >= 0) parentID = classes[i].replace('parent-', '');
|
||||
}
|
||||
|
||||
if(parentID && taskIdList.indexOf(parseInt(parentID)) < 0) canStatistics = true;
|
||||
}
|
||||
|
||||
if(canStatistics)
|
||||
var parentID = tasks[$row.data('id')].parent;
|
||||
if(parentID <= 0 || !$('tbody>tr[data-id="' + parentID + '"]').length > 0)
|
||||
{
|
||||
checkedEstimate += Number(data.estimate);
|
||||
checkedConsumed += Number(data.consumed);
|
||||
|
||||
Reference in New Issue
Block a user