From 0f9faaee762d9fe285fe25b60036818026146709 Mon Sep 17 00:00:00 2001 From: "shiyangyangwork@yahoo.cn" Date: Sun, 1 Jul 2012 08:40:39 +0000 Subject: [PATCH] * fix bugs for report. --- module/report/model.php | 8 +++++++- module/report/view/workload.html.php | 22 +++++++++++++++------- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/module/report/model.php b/module/report/model.php index eb3ea3709a..1ca96ddda2 100644 --- a/module/report/model.php +++ b/module/report/model.php @@ -280,7 +280,13 @@ EOT; foreach($planStories as $planID => $stories) { foreach($stories as $story) $statusList[$story->status][] = $story; - foreach(array_keys($statusList) as $status) $plans[$planID]->status[$status] = count($statusList[$status]); + foreach(array_keys($statusList) as $status) + { + if(isset($plans[$planID])) + { + $plans[$planID]->status[$status] = count($statusList[$status]); + } + } } foreach($plans as $plan) $products[$plan->product]->plans[] = $plan; return $products; diff --git a/module/report/view/workload.html.php b/module/report/view/workload.html.php index a2b20e96f6..80248c6068 100644 --- a/module/report/view/workload.html.php +++ b/module/report/view/workload.html.php @@ -34,7 +34,9 @@ $load):?> count($load['bug']) ? 'task' : 'bug'; + $taskNum = empty($load['task']) ? 0 : count($load['task']); + $bugNum = empty($load['bug']) ? 0 : count($load['bug']); + $max = $taskNum > $bugNum ? 'task' : 'bug'; ?> $val):?> @@ -54,30 +56,36 @@ ?> - + - +