From fb8793f1d343858e6a828412ee97bbceee956d0e Mon Sep 17 00:00:00 2001 From: songchenxuan Date: Wed, 15 Dec 2021 17:29:31 +0800 Subject: [PATCH 1/3] *Finish task #46099. --- module/execution/view/all.html.php | 8 ++++++++ module/project/model.php | 11 +++++++++++ 2 files changed, 19 insertions(+) diff --git a/module/execution/view/all.html.php b/module/execution/view/all.html.php index f303762896..cfbe35be12 100644 --- a/module/execution/view/all.html.php +++ b/module/execution/view/all.html.php @@ -76,6 +76,9 @@ idAB);?> systemMode == 'new')) ? $lang->execution->execName : $lang->execution->name);?> + systemMode == 'new'):?> + execution->project);?> + execution->owner);?> execution->execStatus : $lang->execution->status);?> execution->progress;?> @@ -126,6 +129,11 @@ + systemMode == 'new'):?> + + parentName;?> + + PM);?> processStatus('execution', $execution);?> diff --git a/module/project/model.php b/module/project/model.php index d1e53ca07a..7e72674e3a 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -1851,6 +1851,17 @@ class projectModel extends model ->fetchAll('id'); } + $parentIDList = array(); + foreach($executions as $execution) if($execution->parent) array_push($parentIDList, $execution->parent); + $parentNameList = $this->dao->select('id, name')->from(TABLE_EXECUTION) + ->where('id')->in($parentIDList) + ->fetchPairs('id', 'name'); + foreach($executions as $execution) + { + $execution->parentName = ''; + if(isset($parentNameList[$execution->parent])) $execution->parentName = $parentNameList[$execution->parent]; + } + $hours = $this->computerProgress($executions); $emptyHour = array('totalEstimate' => 0, 'totalConsumed' => 0, 'totalLeft' => 0, 'progress' => 0); From 63479860a52b86bd8cbc7dee6b5a2deb7d1121ad Mon Sep 17 00:00:00 2001 From: songchenxuan Date: Fri, 17 Dec 2021 13:56:24 +0800 Subject: [PATCH 2/3] *Finish task #46099. --- module/project/model.php | 31 +++++++++++-------------------- 1 file changed, 11 insertions(+), 20 deletions(-) diff --git a/module/project/model.php b/module/project/model.php index 7e72674e3a..3c4f34dd25 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -1824,22 +1824,24 @@ class projectModel extends model ->fetchPairs(); } - $executions = $this->dao->select('*')->from(TABLE_EXECUTION) - ->where('type')->in('sprint,stage') - ->beginIF($projectID != 0)->andWhere('project')->eq($projectID)->fi() - ->beginIF(!empty($myExecutionIDList))->andWhere('id')->in(array_keys($myExecutionIDList))->fi() - ->beginIF($status == 'undone')->andWhere('status')->notIN('done,closed')->fi() - ->beginIF($status != 'all' and $status != 'undone' and $status != 'involved')->andWhere('status')->eq($status)->fi() - ->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->sprints)->fi() - ->andWhere('deleted')->eq('0') + $executions = $this->dao->select('t1.*,t2.name projectName')->from(TABLE_EXECUTION)->alias('t1') + ->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id') + ->where('t1.type')->in('sprint,stage') + ->beginIF($projectID != 0)->andWhere('t1.project')->eq($projectID)->fi() + ->beginIF(!empty($myExecutionIDList))->andWhere('t1.id')->in(array_keys($myExecutionIDList))->fi() + ->beginIF($status == 'undone')->andWhere('t1.status')->notIN('done,closed')->fi() + ->beginIF($status != 'all' and $status != 'undone' and $status != 'involved')->andWhere('t1.status')->eq($status)->fi() + ->beginIF(!$this->app->user->admin)->andWhere('t1.id')->in($this->app->user->view->sprints)->fi() + ->andWhere('t1.deleted')->eq('0') ->orderBy($orderBy) ->page($pager) ->fetchAll('id'); } else { - $executions = $this->dao->select('t2.*')->from(TABLE_PROJECTPRODUCT)->alias('t1') + $executions = $this->dao->select('t2.*,t3.name projectName')->from(TABLE_PROJECTPRODUCT)->alias('t1') ->leftJoin(TABLE_EXECUTION)->alias('t2')->on('t1.project=t2.id') + ->leftJoin(TABLE_PROJECT)->alias('t3')->on('t2.project=t3.id') ->where('t1.product')->eq($productID) ->beginIF($projectID)->andWhere('t2.project')->eq($projectID)->fi() ->beginIF($status == 'undone')->andWhere('t2.status')->notIN('done,closed')->fi() @@ -1851,17 +1853,6 @@ class projectModel extends model ->fetchAll('id'); } - $parentIDList = array(); - foreach($executions as $execution) if($execution->parent) array_push($parentIDList, $execution->parent); - $parentNameList = $this->dao->select('id, name')->from(TABLE_EXECUTION) - ->where('id')->in($parentIDList) - ->fetchPairs('id', 'name'); - foreach($executions as $execution) - { - $execution->parentName = ''; - if(isset($parentNameList[$execution->parent])) $execution->parentName = $parentNameList[$execution->parent]; - } - $hours = $this->computerProgress($executions); $emptyHour = array('totalEstimate' => 0, 'totalConsumed' => 0, 'totalLeft' => 0, 'progress' => 0); From 59bbd18c550612e308c07552e903e7b9446a80bf Mon Sep 17 00:00:00 2001 From: songchenxuan Date: Fri, 17 Dec 2021 13:58:31 +0800 Subject: [PATCH 3/3] *Finish task #46099. --- module/execution/view/all.html.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/module/execution/view/all.html.php b/module/execution/view/all.html.php index cfbe35be12..7ebca2d4bd 100644 --- a/module/execution/view/all.html.php +++ b/module/execution/view/all.html.php @@ -77,7 +77,7 @@ systemMode == 'new')) ? $lang->execution->execName : $lang->execution->name);?> systemMode == 'new'):?> - execution->project);?> + execution->project);?> execution->owner);?> execution->execStatus : $lang->execution->status);?> @@ -130,8 +130,8 @@ systemMode == 'new'):?> - - parentName;?> + + projectName;?> PM);?>