From 91e67125f473890279a0ea5248e01a2831b35733 Mon Sep 17 00:00:00 2001 From: liumengyi Date: Tue, 9 Nov 2021 17:10:56 +0800 Subject: [PATCH 1/6] * Finish task#43909. --- module/report/model.php | 28 +++++++++----- module/report/view/workload.html.php | 57 ++++++++++++++++++---------- 2 files changed, 54 insertions(+), 31 deletions(-) diff --git a/module/report/model.php b/module/report/model.php index 8b01517ab1..b18647b2a2 100644 --- a/module/report/model.php +++ b/module/report/model.php @@ -287,8 +287,9 @@ class reportModel extends model if($assign == 'noassign') { - $members = $this->dao->select('t1.account,t2.name,t1.root')->from(TABLE_TEAM)->alias('t1') + $members = $this->dao->select('t1.account,t2.name,t1.root,t3.id as project,t3.name as projectname')->from(TABLE_TEAM)->alias('t1') ->leftJoin(TABLE_EXECUTION)->alias('t2')->on('t2.id = t1.root') + ->leftJoin(TABLE_PROJECT)->alias('t3')->on('t3.id = t2.project') ->where('t2.status')->notin('cancel, closed, done, suspended') ->beginIF($dept)->andWhere('t1.account')->in(array_keys($deptUsers))->fi() ->andWhere('t1.type')->eq('execution') @@ -304,11 +305,14 @@ class reportModel extends model { foreach($executions as $name => $execution) { - $workload[$member]['task'][$name]['count'] = 0; - $workload[$member]['task'][$name]['manhour'] = 0; - $workload[$member]['task'][$name]['executionID'] = $execution->root; - $workload[$member]['total']['count'] = 0; - $workload[$member]['total']['manhour'] = 0; + $workload[$member]['task']['project'][$execution->projectname]['project'] = $execution->projectname; + $workload[$member]['task']['project'][$execution->projectname]['projectID'] = $execution->project; + $workload[$member]['task']['project'][$execution->projectname]['execution'][$name]['name'] = $name; + $workload[$member]['task']['project'][$execution->projectname]['execution'][$name]['executionID'] = $execution->root; + $workload[$member]['task']['project'][$execution->projectname]['execution'][$name]['count'] = 0; + $workload[$member]['task']['project'][$execution->projectname]['execution'][$name]['manhour'] = 0; + $workload[$member]['total']['count'] = 0; + $workload[$member]['total']['manhour'] = 0; } } } @@ -316,8 +320,9 @@ class reportModel extends model return $workload; } - $stmt = $this->dao->select('t1.*, t2.name as executionName')->from(TABLE_TASK)->alias('t1') + $stmt = $this->dao->select('t1.*, t2.name as executionName,t3.name as projectname')->from(TABLE_TASK)->alias('t1') ->leftJoin(TABLE_EXECUTION)->alias('t2')->on('t1.execution = t2.id') + ->leftJoin(TABLE_PROJECT)->alias('t3')->on('t3.id = t2.project') ->where('t1.deleted')->eq(0) ->andWhere('t1.status')->in('wait,pause,doing') ->andWhere('t2.deleted')->eq(0) @@ -374,9 +379,12 @@ class reportModel extends model foreach($userTasks as $task) { if(isset($parents[$task->id])) continue; - $workload[$user]['task'][$task->executionName]['count'] = isset($workload[$user]['task'][$task->executionName]['count']) ? $workload[$user]['task'][$task->executionName]['count'] + 1 : 1; - $workload[$user]['task'][$task->executionName]['manhour'] = isset($workload[$user]['task'][$task->executionName]['manhour']) ? $workload[$user]['task'][$task->executionName]['manhour'] + $task->left : $task->left; - $workload[$user]['task'][$task->executionName]['executionID'] = $task->execution; + $workload[$user]['task']['project'][$task->projectname]['projectID'] = isset($workload[$user]['task']['project'][$task->projectname]['projectID']) ? $workload[$user]['task']['project'][$task->projectname]['projectID'] : $task->project; + $workload[$user]['task']['project'][$task->projectname]['project'] = isset($workload[$user]['task'][$task->projectname]['project']) ? $workload[$user]['task'][$task->projectname]['project'] : $task->projectname; + $workload[$user]['task']['project'][$task->projectname]['execution'][$task->executionName]['count'] = isset($workload[$user]['task']['project'][$task->projectname]['execution'][$task->executionName]['count']) ? $workload[$user]['task']['project'][$task->projectname]['execution'][$task->executionName]['count'] + 1 : 1; + $workload[$user]['task']['project'][$task->projectname]['execution'][$task->executionName]['manhour'] = isset($workload[$user]['task']['project'][$task->projectname]['execution'][$task->executionName]['manhour']) ? $workload[$user]['task']['project'][$task->projectname]['execution'][$task->executionName]['manhour'] + $task->left : $task->left; + $workload[$user]['task']['project'][$task->projectname]['execution'][$task->executionName]['executionID'] = $task->execution; + $workload[$user]['task']['project'][$task->projectname]['execution'][$task->executionName]['name'] = $task->executionName; $workload[$user]['total']['count'] = isset($workload[$user]['total']['count']) ? $workload[$user]['total']['count'] + 1 : 1; $workload[$user]['total']['manhour'] = isset($workload[$user]['total']['manhour']) ? $workload[$user]['total']['manhour'] + $task->left : $task->left; } diff --git a/module/report/view/workload.html.php b/module/report/view/workload.html.php index df2cffe6ce..9b0d12a191 100644 --- a/module/report/view/workload.html.php +++ b/module/report/view/workload.html.php @@ -70,6 +70,7 @@ report->user;?> + report->project ;?> report->execution;?> report->task;?> report->remain;?> @@ -79,28 +80,42 @@ - + $load):?> - - - - - $info):?> - - ';?> - createLink('execution', 'view', "executionID={$info['executionID']}"), $execution);?> - - - - - - - - '; $id ++;?> - - - - + + + + + $info):?> + $execinfo):?> + + + + + $info):?> + + + + + $execinfo):?> + ";?> + + createLink('project', 'view', "projectID={$info['projectID']}"), $info['project']);?> + + createLink('execution', 'view', "executionID={$execinfo['executionID']}"), $execinfo['name']);?> + + + + + + + + "; $idprojectname ++; $idusername ++;?> + + + + + From ed537c141568ae679d44afcbe53215bc48d7b0ff Mon Sep 17 00:00:00 2001 From: liumengyi Date: Tue, 9 Nov 2021 17:10:56 +0800 Subject: [PATCH 2/6] * Finish task#43909. --- module/report/model.php | 28 +++++++++----- module/report/view/workload.html.php | 57 ++++++++++++++++++---------- 2 files changed, 54 insertions(+), 31 deletions(-) diff --git a/module/report/model.php b/module/report/model.php index 8b01517ab1..b18647b2a2 100644 --- a/module/report/model.php +++ b/module/report/model.php @@ -287,8 +287,9 @@ class reportModel extends model if($assign == 'noassign') { - $members = $this->dao->select('t1.account,t2.name,t1.root')->from(TABLE_TEAM)->alias('t1') + $members = $this->dao->select('t1.account,t2.name,t1.root,t3.id as project,t3.name as projectname')->from(TABLE_TEAM)->alias('t1') ->leftJoin(TABLE_EXECUTION)->alias('t2')->on('t2.id = t1.root') + ->leftJoin(TABLE_PROJECT)->alias('t3')->on('t3.id = t2.project') ->where('t2.status')->notin('cancel, closed, done, suspended') ->beginIF($dept)->andWhere('t1.account')->in(array_keys($deptUsers))->fi() ->andWhere('t1.type')->eq('execution') @@ -304,11 +305,14 @@ class reportModel extends model { foreach($executions as $name => $execution) { - $workload[$member]['task'][$name]['count'] = 0; - $workload[$member]['task'][$name]['manhour'] = 0; - $workload[$member]['task'][$name]['executionID'] = $execution->root; - $workload[$member]['total']['count'] = 0; - $workload[$member]['total']['manhour'] = 0; + $workload[$member]['task']['project'][$execution->projectname]['project'] = $execution->projectname; + $workload[$member]['task']['project'][$execution->projectname]['projectID'] = $execution->project; + $workload[$member]['task']['project'][$execution->projectname]['execution'][$name]['name'] = $name; + $workload[$member]['task']['project'][$execution->projectname]['execution'][$name]['executionID'] = $execution->root; + $workload[$member]['task']['project'][$execution->projectname]['execution'][$name]['count'] = 0; + $workload[$member]['task']['project'][$execution->projectname]['execution'][$name]['manhour'] = 0; + $workload[$member]['total']['count'] = 0; + $workload[$member]['total']['manhour'] = 0; } } } @@ -316,8 +320,9 @@ class reportModel extends model return $workload; } - $stmt = $this->dao->select('t1.*, t2.name as executionName')->from(TABLE_TASK)->alias('t1') + $stmt = $this->dao->select('t1.*, t2.name as executionName,t3.name as projectname')->from(TABLE_TASK)->alias('t1') ->leftJoin(TABLE_EXECUTION)->alias('t2')->on('t1.execution = t2.id') + ->leftJoin(TABLE_PROJECT)->alias('t3')->on('t3.id = t2.project') ->where('t1.deleted')->eq(0) ->andWhere('t1.status')->in('wait,pause,doing') ->andWhere('t2.deleted')->eq(0) @@ -374,9 +379,12 @@ class reportModel extends model foreach($userTasks as $task) { if(isset($parents[$task->id])) continue; - $workload[$user]['task'][$task->executionName]['count'] = isset($workload[$user]['task'][$task->executionName]['count']) ? $workload[$user]['task'][$task->executionName]['count'] + 1 : 1; - $workload[$user]['task'][$task->executionName]['manhour'] = isset($workload[$user]['task'][$task->executionName]['manhour']) ? $workload[$user]['task'][$task->executionName]['manhour'] + $task->left : $task->left; - $workload[$user]['task'][$task->executionName]['executionID'] = $task->execution; + $workload[$user]['task']['project'][$task->projectname]['projectID'] = isset($workload[$user]['task']['project'][$task->projectname]['projectID']) ? $workload[$user]['task']['project'][$task->projectname]['projectID'] : $task->project; + $workload[$user]['task']['project'][$task->projectname]['project'] = isset($workload[$user]['task'][$task->projectname]['project']) ? $workload[$user]['task'][$task->projectname]['project'] : $task->projectname; + $workload[$user]['task']['project'][$task->projectname]['execution'][$task->executionName]['count'] = isset($workload[$user]['task']['project'][$task->projectname]['execution'][$task->executionName]['count']) ? $workload[$user]['task']['project'][$task->projectname]['execution'][$task->executionName]['count'] + 1 : 1; + $workload[$user]['task']['project'][$task->projectname]['execution'][$task->executionName]['manhour'] = isset($workload[$user]['task']['project'][$task->projectname]['execution'][$task->executionName]['manhour']) ? $workload[$user]['task']['project'][$task->projectname]['execution'][$task->executionName]['manhour'] + $task->left : $task->left; + $workload[$user]['task']['project'][$task->projectname]['execution'][$task->executionName]['executionID'] = $task->execution; + $workload[$user]['task']['project'][$task->projectname]['execution'][$task->executionName]['name'] = $task->executionName; $workload[$user]['total']['count'] = isset($workload[$user]['total']['count']) ? $workload[$user]['total']['count'] + 1 : 1; $workload[$user]['total']['manhour'] = isset($workload[$user]['total']['manhour']) ? $workload[$user]['total']['manhour'] + $task->left : $task->left; } diff --git a/module/report/view/workload.html.php b/module/report/view/workload.html.php index df2cffe6ce..9b0d12a191 100644 --- a/module/report/view/workload.html.php +++ b/module/report/view/workload.html.php @@ -70,6 +70,7 @@ report->user;?> + report->project ;?> report->execution;?> report->task;?> report->remain;?> @@ -79,28 +80,42 @@ - + $load):?> - - - - - $info):?> - - ';?> - createLink('execution', 'view', "executionID={$info['executionID']}"), $execution);?> - - - - - - - - '; $id ++;?> - - - - + + + + + $info):?> + $execinfo):?> + + + + + $info):?> + + + + + $execinfo):?> + ";?> + + createLink('project', 'view', "projectID={$info['projectID']}"), $info['project']);?> + + createLink('execution', 'view', "executionID={$execinfo['executionID']}"), $execinfo['name']);?> + + + + + + + + "; $idprojectname ++; $idusername ++;?> + + + + + From 7203acb7af17d786f39362153b96781bb794d675 Mon Sep 17 00:00:00 2001 From: liumengyi Date: Tue, 9 Nov 2021 17:23:34 +0800 Subject: [PATCH 3/6] * Finish task#43909. --- module/report/view/workload.html.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/module/report/view/workload.html.php b/module/report/view/workload.html.php index 9b0d12a191..d839a1cb61 100644 --- a/module/report/view/workload.html.php +++ b/module/report/view/workload.html.php @@ -80,11 +80,10 @@ - + $load):?> - $info):?> $execinfo):?> From 6bdf3553d1d04f706f0c1f8c8c9db1fa5d4cf15a Mon Sep 17 00:00:00 2001 From: liumengyi Date: Wed, 10 Nov 2021 09:05:58 +0800 Subject: [PATCH 4/6] * Finish task#43909. --- module/report/model.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/module/report/model.php b/module/report/model.php index b18647b2a2..74c6913565 100644 --- a/module/report/model.php +++ b/module/report/model.php @@ -379,14 +379,14 @@ class reportModel extends model foreach($userTasks as $task) { if(isset($parents[$task->id])) continue; - $workload[$user]['task']['project'][$task->projectname]['projectID'] = isset($workload[$user]['task']['project'][$task->projectname]['projectID']) ? $workload[$user]['task']['project'][$task->projectname]['projectID'] : $task->project; - $workload[$user]['task']['project'][$task->projectname]['project'] = isset($workload[$user]['task'][$task->projectname]['project']) ? $workload[$user]['task'][$task->projectname]['project'] : $task->projectname; - $workload[$user]['task']['project'][$task->projectname]['execution'][$task->executionName]['count'] = isset($workload[$user]['task']['project'][$task->projectname]['execution'][$task->executionName]['count']) ? $workload[$user]['task']['project'][$task->projectname]['execution'][$task->executionName]['count'] + 1 : 1; + $workload[$user]['task']['project'][$task->projectname]['projectID'] = isset($workload[$user]['task']['project'][$task->projectname]['projectID']) ? $workload[$user]['task']['project'][$task->projectname]['projectID'] : $task->project; + $workload[$user]['task']['project'][$task->projectname]['project'] = isset($workload[$user]['task']['project'][$task->projectname]['project']) ? $workload[$user]['task']['project'][$task->projectname]['project'] : $task->projectname; + $workload[$user]['task']['project'][$task->projectname]['execution'][$task->executionName]['count'] = isset($workload[$user]['task']['project'][$task->projectname]['execution'][$task->executionName]['count']) ? $workload[$user]['task']['project'][$task->projectname]['execution'][$task->executionName]['count'] + 1 : 1; $workload[$user]['task']['project'][$task->projectname]['execution'][$task->executionName]['manhour'] = isset($workload[$user]['task']['project'][$task->projectname]['execution'][$task->executionName]['manhour']) ? $workload[$user]['task']['project'][$task->projectname]['execution'][$task->executionName]['manhour'] + $task->left : $task->left; $workload[$user]['task']['project'][$task->projectname]['execution'][$task->executionName]['executionID'] = $task->execution; $workload[$user]['task']['project'][$task->projectname]['execution'][$task->executionName]['name'] = $task->executionName; - $workload[$user]['total']['count'] = isset($workload[$user]['total']['count']) ? $workload[$user]['total']['count'] + 1 : 1; - $workload[$user]['total']['manhour'] = isset($workload[$user]['total']['manhour']) ? $workload[$user]['total']['manhour'] + $task->left : $task->left; + $workload[$user]['total']['count'] = isset($workload[$user]['total']['count']) ? $workload[$user]['total']['count'] + 1 : 1; + $workload[$user]['total']['manhour'] = isset($workload[$user]['total']['manhour']) ? $workload[$user]['total']['manhour'] + $task->left : $task->left; } } } From a76e32591e86b47323cebfa13dbb1944646264be Mon Sep 17 00:00:00 2001 From: liumengyi Date: Wed, 10 Nov 2021 11:30:04 +0800 Subject: [PATCH 5/6] * Finish task #43909. --- module/report/model.php | 37 +++++++++--------- module/report/view/workload.html.php | 58 +++++++++++++--------------- 2 files changed, 45 insertions(+), 50 deletions(-) diff --git a/module/report/model.php b/module/report/model.php index 74c6913565..7f184902f3 100644 --- a/module/report/model.php +++ b/module/report/model.php @@ -296,25 +296,25 @@ class reportModel extends model ->andWhere("t1.account NOT IN(SELECT `assignedTo` FROM " . TABLE_TASK . " WHERE `execution` = t1.`root` AND `status` NOT IN('cancel, closed, done, pause') AND assignedTo != '' GROUP BY assignedTo)") ->fetchGroup('account', 'name'); - $workload = array(); + $workload = array(); if(!empty($members)) { foreach($members as $member => $executions) { + $project = array(); if(!empty($executions)) { foreach($executions as $name => $execution) { - $workload[$member]['task']['project'][$execution->projectname]['project'] = $execution->projectname; - $workload[$member]['task']['project'][$execution->projectname]['projectID'] = $execution->project; - $workload[$member]['task']['project'][$execution->projectname]['execution'][$name]['name'] = $name; - $workload[$member]['task']['project'][$execution->projectname]['execution'][$name]['executionID'] = $execution->root; - $workload[$member]['task']['project'][$execution->projectname]['execution'][$name]['count'] = 0; - $workload[$member]['task']['project'][$execution->projectname]['execution'][$name]['manhour'] = 0; - $workload[$member]['total']['count'] = 0; - $workload[$member]['total']['manhour'] = 0; + $project[$execution->projectname]['projectID'] = $execution->project; + $project[$execution->projectname]['execution'][$name]['executionID'] = $execution->root; + $project[$execution->projectname]['execution'][$name]['count'] = 0; + $project[$execution->projectname]['execution'][$name]['manhour'] = 0; + $workload[$member]['total']['count'] = 0; + $workload[$member]['total']['manhour'] = 0; } } + $workload[$member]['task']['project'] = $project; } } return $workload; @@ -376,20 +376,21 @@ class reportModel extends model { if($user) { + $project = array(); foreach($userTasks as $task) { if(isset($parents[$task->id])) continue; - $workload[$user]['task']['project'][$task->projectname]['projectID'] = isset($workload[$user]['task']['project'][$task->projectname]['projectID']) ? $workload[$user]['task']['project'][$task->projectname]['projectID'] : $task->project; - $workload[$user]['task']['project'][$task->projectname]['project'] = isset($workload[$user]['task']['project'][$task->projectname]['project']) ? $workload[$user]['task']['project'][$task->projectname]['project'] : $task->projectname; - $workload[$user]['task']['project'][$task->projectname]['execution'][$task->executionName]['count'] = isset($workload[$user]['task']['project'][$task->projectname]['execution'][$task->executionName]['count']) ? $workload[$user]['task']['project'][$task->projectname]['execution'][$task->executionName]['count'] + 1 : 1; - $workload[$user]['task']['project'][$task->projectname]['execution'][$task->executionName]['manhour'] = isset($workload[$user]['task']['project'][$task->projectname]['execution'][$task->executionName]['manhour']) ? $workload[$user]['task']['project'][$task->projectname]['execution'][$task->executionName]['manhour'] + $task->left : $task->left; - $workload[$user]['task']['project'][$task->projectname]['execution'][$task->executionName]['executionID'] = $task->execution; - $workload[$user]['task']['project'][$task->projectname]['execution'][$task->executionName]['name'] = $task->executionName; - $workload[$user]['total']['count'] = isset($workload[$user]['total']['count']) ? $workload[$user]['total']['count'] + 1 : 1; - $workload[$user]['total']['manhour'] = isset($workload[$user]['total']['manhour']) ? $workload[$user]['total']['manhour'] + $task->left : $task->left; + + $project[$task->projectname]['projectID'] = isset($project[$task->projectname]['projectID']) ? $project[$task->projectname]['projectID'] : $task->project; + $project[$task->projectname]['execution'][$task->executionName]['executionID'] = isset($project[$task->projectname]['execution'][$task->executionName]['executionID']) ? $project[$task->projectname]['execution'][$task->executionName]['executionID'] : $task->execution; + $project[$task->projectname]['execution'][$task->executionName]['count'] = isset($project[$task->projectname]['execution'][$task->executionName]['count']) ? $project[$task->projectname]['execution'][$task->executionName]['count'] + 1 : 1; + $project[$task->projectname]['execution'][$task->executionName]['manhour'] = isset($project[$task->projectname]['execution'][$task->executionName]['manhour']) ? $project[$task->projectname]['execution'][$task->executionName]['manhour'] + $task->left : $task->left; + $workload[$user]['total']['count'] = isset($workload[$user]['total']['count']) ? $workload[$user]['total']['count'] + 1 : 1; + $workload[$user]['total']['manhour'] = isset($workload[$user]['total']['manhour']) ? $workload[$user]['total']['manhour'] + $task->left : $task->left; } + $workload[$user]['task']['project'] = $project; } - } + } unset($workload['closed']); return $workload; } diff --git a/module/report/view/workload.html.php b/module/report/view/workload.html.php index d839a1cb61..2d01a8c7f6 100644 --- a/module/report/view/workload.html.php +++ b/module/report/view/workload.html.php @@ -82,38 +82,32 @@ $load):?> - - - - $info):?> - $execinfo):?> - - - - - $info):?> - - - - - $execinfo):?> - ";?> - - createLink('project', 'view', "projectID={$info['projectID']}"), $info['project']);?> - - createLink('execution', 'view', "executionID={$execinfo['executionID']}"), $execinfo['name']);?> - - - - - - - - "; $idprojectname ++; $idusername ++;?> - - - - + + + + $info) foreach($info['execution'] as $exec => $execinfo) $countusername ++;?> + + $info):?> + + + $execinfo):?> + ";?> + + createLink('project', 'view', "projectID={$info['projectID']}"), $project);?> + + createLink('execution', 'view', "executionID={$execinfo['executionID']}"), $exec);?> + + + + + + + + "; $idprojectname ++; $idusername ++;?> + + + + From 651af219585a972b58046fd58b03bd6ca21aef76 Mon Sep 17 00:00:00 2001 From: liumengyi Date: Wed, 10 Nov 2021 13:09:09 +0800 Subject: [PATCH 6/6] * Finish task #43909. --- module/report/model.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/module/report/model.php b/module/report/model.php index 7f184902f3..b2952578a1 100644 --- a/module/report/model.php +++ b/module/report/model.php @@ -306,10 +306,11 @@ class reportModel extends model { foreach($executions as $name => $execution) { - $project[$execution->projectname]['projectID'] = $execution->project; + $project[$execution->projectname]['projectID'] = $execution->project; $project[$execution->projectname]['execution'][$name]['executionID'] = $execution->root; $project[$execution->projectname]['execution'][$name]['count'] = 0; $project[$execution->projectname]['execution'][$name]['manhour'] = 0; + $workload[$member]['total']['count'] = 0; $workload[$member]['total']['manhour'] = 0; } @@ -381,12 +382,13 @@ class reportModel extends model { if(isset($parents[$task->id])) continue; - $project[$task->projectname]['projectID'] = isset($project[$task->projectname]['projectID']) ? $project[$task->projectname]['projectID'] : $task->project; + $project[$task->projectname]['projectID'] = isset($project[$task->projectname]['projectID']) ? $project[$task->projectname]['projectID'] : $task->project; $project[$task->projectname]['execution'][$task->executionName]['executionID'] = isset($project[$task->projectname]['execution'][$task->executionName]['executionID']) ? $project[$task->projectname]['execution'][$task->executionName]['executionID'] : $task->execution; $project[$task->projectname]['execution'][$task->executionName]['count'] = isset($project[$task->projectname]['execution'][$task->executionName]['count']) ? $project[$task->projectname]['execution'][$task->executionName]['count'] + 1 : 1; $project[$task->projectname]['execution'][$task->executionName]['manhour'] = isset($project[$task->projectname]['execution'][$task->executionName]['manhour']) ? $project[$task->projectname]['execution'][$task->executionName]['manhour'] + $task->left : $task->left; - $workload[$user]['total']['count'] = isset($workload[$user]['total']['count']) ? $workload[$user]['total']['count'] + 1 : 1; - $workload[$user]['total']['manhour'] = isset($workload[$user]['total']['manhour']) ? $workload[$user]['total']['manhour'] + $task->left : $task->left; + + $workload[$user]['total']['count'] = isset($workload[$user]['total']['count']) ? $workload[$user]['total']['count'] + 1 : 1; + $workload[$user]['total']['manhour'] = isset($workload[$user]['total']['manhour']) ? $workload[$user]['total']['manhour'] + $task->left : $task->left; } $workload[$user]['task']['project'] = $project; }