From 08a528f85beb9f3e1b8d10ae44c55d15e4937ff7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BB=94=E5=93=A5?= Date: Fri, 20 Oct 2017 16:24:50 +0800 Subject: [PATCH] "fix debug level 2" --- module/project/js/common.js | 2 +- module/project/view/task.html.php | 2 +- module/task/js/common.js | 2 +- module/task/js/create.js | 2 +- module/task/js/edit.js | 2 +- module/task/model.php | 16 ++++++++-------- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/module/project/js/common.js b/module/project/js/common.js index 5f3298ac06..24c3c6b85f 100644 --- a/module/project/js/common.js +++ b/module/project/js/common.js @@ -190,4 +190,4 @@ $('.task-toggle').click(function() obj.removeClass('icon-minus').addClass('icon-plus'); } return false; -}); \ No newline at end of file +}); diff --git a/module/project/view/task.html.php b/module/project/view/task.html.php index f9ce51581f..2f2022c87c 100644 --- a/module/project/view/task.html.php +++ b/module/project/view/task.html.php @@ -70,7 +70,7 @@ js::set('browseType', $browseType); $value) $this->task->printCell($value, $task, $users, $browseType, $branchGroups, $modulePairs);?> - children):?> + children)):?> children as $child):?> $value) $this->task->printCell($value, $child, $users, $browseType, $branchGroups, $modulePairs);?> diff --git a/module/task/js/common.js b/module/task/js/common.js index 9363ddb004..140db4051e 100644 --- a/module/task/js/common.js +++ b/module/task/js/common.js @@ -56,4 +56,4 @@ $('#modalTeam .btn').click(function() $('#teamMember').val(team); $('#estimate').val(time); }) -}) \ No newline at end of file +}) diff --git a/module/task/js/create.js b/module/task/js/create.js index bdb27f8b2f..b9b90827af 100644 --- a/module/task/js/create.js +++ b/module/task/js/create.js @@ -224,4 +224,4 @@ $(".btn[data-toggle='modalTeam']").click(function() { $('#modalTeam').modal('show'); adjustSortBtn(); -}); \ No newline at end of file +}); diff --git a/module/task/js/edit.js b/module/task/js/edit.js index 401c03d80e..72e23de445 100644 --- a/module/task/js/edit.js +++ b/module/task/js/edit.js @@ -88,4 +88,4 @@ $(document).ready(function() $('#teamTr').addClass('hidden'); } }); -}); \ No newline at end of file +}); diff --git a/module/task/model.php b/module/task/model.php index 1dc1000479..e33cbc5b2b 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -1082,7 +1082,7 @@ class taskModel extends model $taskList = array_keys($tasks); $children = $this->dao->select('*')->from(TABLE_TASK)->where('parent')->in($taskList)->orderBy('id_desc')->fetchGroup('parent'); - if($children) foreach($children as $key => $child) $tasks[$key]->children = $child; + if(!empty($children)) foreach($children as $key => $child) $tasks[$key]->children = $child; $teams = $this->dao->select('*')->from(TABLE_TEAM)->where('task')->in($taskList)->fetchGroup('task'); if($teams) foreach($teams as $key => $team) if(!empty($team)) $tasks[$key]->team = $team; @@ -1362,7 +1362,7 @@ class taskModel extends model foreach($tasks as $task) { $task = $this->processTask($task); - if($task->children) foreach($task->children as $child) + if(!empty($task->children)) foreach($task->children as $child) { $task = $this->processTask($child); } @@ -1393,7 +1393,7 @@ class taskModel extends model /* Story changed or not. */ $task->needConfirm = false; - if($task->storyStatus == 'active' and $task->latestStoryVersion > $task->storyVersion) $task->needConfirm = true; + if(!empty($task->storyStatus) and $task->storyStatus == 'active' and $task->latestStoryVersion > $task->storyVersion) $task->needConfirm = true; /* Set product type for task. */ if(isset($task->product)) @@ -1832,17 +1832,17 @@ class taskModel extends model echo ""; break; case 'name': - if(isset($branchGroups[$task->product][$task->branch])) echo "" . $branchGroups[$task->product][$task->branch] . ' '; + if(!empty($task->product) && isset($branchGroups[$task->product][$task->branch])) echo "" . $branchGroups[$task->product][$task->branch] . ' '; if($modulePairs and $task->module) echo "" . $modulePairs[$task->module] . ' '; echo html::a($taskLink, $task->name, null, "style='color: $task->color'"); if($task->fromBug) echo html::a(helper::createLink('bug', 'view', "id=$task->fromBug"), "[BUG#$task->fromBug]", '_blank', "class='bug'"); - if($task->children) echo '    '; + if(!empty($task->children)) echo '    '; break; case 'type': echo $this->lang->task->typeList[$task->type]; break; case 'status': - $storyChanged = ($task->storyStatus == 'active' and $task->latestStoryVersion > $task->storyVersion); + $storyChanged = (!empty($task->storyStatus) and $task->storyStatus == 'active' and $task->latestStoryVersion > $task->storyVersion); $storyChanged ? print("{$this->lang->story->changed} ") : print($this->lang->task->statusList[$task->status]); break; case 'estimate': @@ -1900,7 +1900,7 @@ class taskModel extends model echo $this->lang->task->reasonList[$task->closedReason]; break; case 'story': - if($task->storyID) + if(!empty($task->storyID)) { if(!common::printLink('story', 'view', "storyid=$task->storyID", $task->storyTitle)) print $task->storyTitle; } @@ -1933,7 +1933,7 @@ class taskModel extends model common::printIcon('task', 'finish', "taskID=$task->id", $task, 'list', '', '', 'iframe', true); common::printIcon('task', 'close', "taskID=$task->id", $task, 'list', '', '', 'iframe', true); common::printIcon('task', 'edit',"taskID=$task->id", $task, 'list'); - if(!$task->team or !$task->children) common::printIcon('task', 'batchCreate', "project=$task->project&storyID=$task->story&moduleID=$task->module&taskID=$task->id", $task, 'list','plus','','','','',$this->lang->task->children); + if(empty($task->team) or empty($task->children)) common::printIcon('task', 'batchCreate', "project=$task->project&storyID=$task->story&moduleID=$task->module&taskID=$task->id", $task, 'list','plus','','','','',$this->lang->task->children); break; } echo '';