From f7080930b14c2d5e88198f31f60c7e3f9d1468db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BB=94=E5=93=A5?= Date: Tue, 19 Dec 2017 14:19:33 +0800 Subject: [PATCH 1/6] * Fix Bug#1328 --- module/project/model.php | 1 + module/task/model.php | 9 --------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/module/project/model.php b/module/project/model.php index 23fa69b0c2..8fc4dea38d 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -1921,6 +1921,7 @@ class projectModel extends model * @param string $end * @param string $type * @param string|int $interval + * @param string $format * @access public * @return array */ diff --git a/module/task/model.php b/module/task/model.php index 3775ca9086..81899870e6 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -1245,15 +1245,6 @@ class taskModel extends model ->where('t1.project')->eq((int)$projectID) ->andWhere('t1.parent')->in($taskList) ->andWhere('t1.deleted')->eq(0) - ->beginIF($productID)->andWhere('t2.product')->eq((int)$productID)->fi() - ->beginIF($type == 'undone')->andWhere("(t1.status = 'wait' or t1.status ='doing')")->fi() - ->beginIF($type == 'needconfirm')->andWhere('t2.version > t1.storyVersion')->andWhere("t2.status = 'active'")->fi() - ->beginIF($type == 'assignedtome')->andWhere('t1.assignedTo')->eq($this->app->user->account)->fi() - ->beginIF($type == 'finishedbyme')->andWhere('t1.finishedby')->eq($this->app->user->account)->fi() - ->beginIF($type == 'delayed')->andWhere('t1.deadline')->gt('1970-1-1')->andWhere('t1.deadline')->lt(date(DT_DATE1))->andWhere('t1.status')->in('wait,doing')->fi() - ->beginIF(is_array($type) or strpos(',all,undone,needconfirm,assignedtome,delayed,finishedbyme,myinvolved,', ",$type,") === false)->andWhere('t1.status')->in($type)->fi() - ->beginIF($modules)->andWhere('t1.module')->in($modules)->fi() - ->orderBy('t1.`id`,' . $orderBy) ->fetchAll('id'); if(!empty($children)) From 42e4aec31f27ff0a869f7e3d8824401c0e63d33e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BB=94=E5=93=A5?= Date: Tue, 19 Dec 2017 15:01:10 +0800 Subject: [PATCH 2/6] * Fix Bug --- module/project/model.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/module/project/model.php b/module/project/model.php index 8fc4dea38d..7e527a037a 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -1681,7 +1681,7 @@ class projectModel extends model * * @param int $projectID * @access public - * @return void + * @return array */ public function getBurnDataFlot($projectID = 0) { @@ -1835,7 +1835,7 @@ class projectModel extends model */ public function summary($tasks) { - $taskSum = $statusWait = $statusDone = $statusDoing = $statusClosed = $statusCancel = $statusPause = 0; + $taskSum = $statusWait = $statusDone = $statusDoing = $statusClosed = $statusCancel = $statusPause = 0; $totalEstimate = $totalConsumed = $totalLeft = 0.0; foreach($tasks as $task) @@ -1845,7 +1845,13 @@ class projectModel extends model $totalLeft += (($task->status == 'cancel' or $task->closedReason == 'cancel') ? 0 : $task->left); $statusVar = 'status' . ucfirst($task->status); $$statusVar ++; - if(!empty($task->children)) $taskSum += count($task->children); + if(!empty($task->children)){ + $taskSum += count($task->children); + foreach($task->children as $child) + { + if($child->status == 'wait') $statusWait ++; + } + } $taskSum ++; } From 0de914da5c4e117d41b0f659880b0b89c8ea2655 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BB=94=E5=93=A5?= Date: Tue, 19 Dec 2017 15:33:48 +0800 Subject: [PATCH 3/6] * Fix bug --- module/task/model.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/module/task/model.php b/module/task/model.php index 81899870e6..3775ca9086 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -1245,6 +1245,15 @@ class taskModel extends model ->where('t1.project')->eq((int)$projectID) ->andWhere('t1.parent')->in($taskList) ->andWhere('t1.deleted')->eq(0) + ->beginIF($productID)->andWhere('t2.product')->eq((int)$productID)->fi() + ->beginIF($type == 'undone')->andWhere("(t1.status = 'wait' or t1.status ='doing')")->fi() + ->beginIF($type == 'needconfirm')->andWhere('t2.version > t1.storyVersion')->andWhere("t2.status = 'active'")->fi() + ->beginIF($type == 'assignedtome')->andWhere('t1.assignedTo')->eq($this->app->user->account)->fi() + ->beginIF($type == 'finishedbyme')->andWhere('t1.finishedby')->eq($this->app->user->account)->fi() + ->beginIF($type == 'delayed')->andWhere('t1.deadline')->gt('1970-1-1')->andWhere('t1.deadline')->lt(date(DT_DATE1))->andWhere('t1.status')->in('wait,doing')->fi() + ->beginIF(is_array($type) or strpos(',all,undone,needconfirm,assignedtome,delayed,finishedbyme,myinvolved,', ",$type,") === false)->andWhere('t1.status')->in($type)->fi() + ->beginIF($modules)->andWhere('t1.module')->in($modules)->fi() + ->orderBy('t1.`id`,' . $orderBy) ->fetchAll('id'); if(!empty($children)) From 8cb3927ca5681c77cba64065d8803c372eb9ed24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BB=94=E5=93=A5?= Date: Tue, 19 Dec 2017 15:49:27 +0800 Subject: [PATCH 4/6] * Fix Bug#1329 --- module/project/control.php | 8 +++++ module/project/view/grouptask.html.php | 45 +++++++------------------- module/task/lang/en.php | 1 + module/task/lang/zh-cn.php | 1 + 4 files changed, 21 insertions(+), 34 deletions(-) diff --git a/module/project/control.php b/module/project/control.php index a48d5ff535..46a77050f1 100644 --- a/module/project/control.php +++ b/module/project/control.php @@ -290,6 +290,14 @@ class project extends control { $groupTasks[$task->$groupBy][] = $task; } + if(isset($task->children)) + { + foreach($task->children as $child) + { + $groupTasks[$child->assignedToRealName][] = $child; + } + $task->children = true; + } } /* Process closed data when group by assignedTo. */ if($groupBy == 'assignedTo' and isset($groupTasks['Closed'])) diff --git a/module/project/view/grouptask.html.php b/module/project/view/grouptask.html.php index eec67d5780..699f4a1b63 100644 --- a/module/project/view/grouptask.html.php +++ b/module/project/view/grouptask.html.php @@ -65,7 +65,7 @@ if($groupBy == 'assignedTo' and $groupName == '') $groupName = $this->lang->task->noAssigned; ?> $task) { if(isset($currentFilter) and $currentFilter != 'all') @@ -87,8 +87,6 @@ } } - if(!empty($task->children)) $rowspan += count($task->children); - $groupEstimate += $task->estimate; $groupConsumed += $task->consumed; $groupLeft += ($task->status == 'cancel' ? 0 : $task->left); @@ -99,7 +97,6 @@ if($task->status == 'closed') $groupClosed++; } $groupSum = count($groupTasks); - $rowspan += $groupSum; ?> @@ -107,7 +104,7 @@ createLink('task','view',"taskID=$task->id"); ?> - + " . $groupName, '', "class='expandGroup' data-action='expand' title='$groupName'");?>
assignedTo])) printf($lang->project->memberHours, $users[$task->assignedTo], $members[$task->assignedTo]->totalHours);?> @@ -116,8 +113,15 @@ id;?> - task->priList, $task->pri, $task->pri)?>'>task->priList, $task->pri, $task->pri);?> - team)) echo ''.$lang->task->multipleAB.' ';if(!common::printLink('task', 'view', "task=$task->id", $task->name)) echo $task->name;?> + task->priList), $task->pri, $task->pri)?>'>task->priList), $task->pri, $task->pri);?> + + team)) echo '' . $lang->task->multipleAB . ' '; + if(!empty($task->parent)) echo '' . $lang->task->childrenAB . ' '; + if(isset($task->children) && $task->children == true) echo '' . $lang->task->parentAB . ' '; + if(!common::printLink('task', 'view', "task=$task->id", $task->name)) echo $task->name; + ?> + task->statusList[$task->status];?> '>deadline, 0, 4) > 0) echo $task->deadline;?> >assignedToRealName;?> @@ -132,33 +136,6 @@ project&taskid=$task->id", '', 'list', '', 'hiddenwin');?> - children)):?> - children as $key => $child):?> - - children)) ? ' table-child-bottom' : '';?> - - id;?> - - task->priList, $child->pri, $task->pri)?>'>task->priList, $child->pri, $child->pri);?> - - task->childrenAB;?> id", $child->name)) echo $child->name;?> - task->statusList[$child->status];?> - '>deadline, 0, 4) > 0) echo $child->deadline;?> - >assignedToRealName;?> - finishedBy];?> - estimate;?> - consumed;?> - left;?> - progress . '%';?> - task->typeList[$child->type];?> - - id", '', 'list');?> - project&taskid=$child->id", '', 'list', '', 'hiddenwin');?> - - - - - diff --git a/module/task/lang/en.php b/module/task/lang/en.php index 5d36a32d67..76831bedb2 100644 --- a/module/task/lang/en.php +++ b/module/task/lang/en.php @@ -103,6 +103,7 @@ $lang->task->transferTo = 'Transfer To'; $lang->task->children = 'Child'; $lang->task->childrenAB = 'Child'; $lang->task->parent = 'Parent Task'; +$lang->task->parentAB = 'Parent Task'; $lang->task->lblPri = 'P'; $lang->task->lblHour = '(h)'; $lang->task->deniedNotice = 'This task can only be started by the first user in the team.'; diff --git a/module/task/lang/zh-cn.php b/module/task/lang/zh-cn.php index 3104dd8dd4..035a1f0e06 100644 --- a/module/task/lang/zh-cn.php +++ b/module/task/lang/zh-cn.php @@ -103,6 +103,7 @@ $lang->task->transferTo = '转交给'; $lang->task->children = '子任务'; $lang->task->childrenAB = '子'; $lang->task->parent = '父任务'; +$lang->task->parentAB = '父'; $lang->task->lblPri = 'P'; $lang->task->lblHour = '(h)'; $lang->task->deniedNotice = '此任务只允许由团队第一人开始。'; From 4830880ebea3fb2a292ddb0792f996ba434b1697 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BB=94=E5=93=A5?= Date: Tue, 19 Dec 2017 17:02:38 +0800 Subject: [PATCH 5/6] * Fix tips. --- module/project/model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/project/model.php b/module/project/model.php index 7e527a037a..a38c042772 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -564,7 +564,7 @@ class projectModel extends model * * @param int $projectID * @access public - * @return void + * @return array */ public function close($projectID) { From 20e63398a3104c9dc59e4185c65b0aeac1c26205 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BB=94=E5=93=A5?= Date: Tue, 19 Dec 2017 17:18:47 +0800 Subject: [PATCH 6/6] * Fix bug#1335 --- module/product/view/build.html.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/product/view/build.html.php b/module/product/view/build.html.php index 6cf442c0de..a07931ddf0 100755 --- a/module/product/view/build.html.php +++ b/module/product/view/build.html.php @@ -35,8 +35,8 @@ id;?> createLink('build', 'view', "build=$build->id"), $build->name);?> - scmPath, 'http') === 0 ? printf(html::a($build->scmPath)) : printf($build->scmPath);?> - filePath, 'http') === 0 ? printf(html::a($build->filePath)) : printf($build->filePath);?> + scmPath, 'http') === true ? html::a($build->scmPath) : $build->scmPath;?> + filePath, 'http') === true ? html::a($build->filePath) : $build->filePath;?> date?> builder]?>