From 243316723fc42e38aef933c677391f35b3105f22 Mon Sep 17 00:00:00 2001 From: Yagami Date: Wed, 8 Feb 2023 08:33:58 +0800 Subject: [PATCH] * Remove unused code. --- module/execution/model.php | 27 --------------------------- module/task/control.php | 4 ++-- 2 files changed, 2 insertions(+), 29 deletions(-) diff --git a/module/execution/model.php b/module/execution/model.php index a1d47fe906..d4b91ec336 100755 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -1720,33 +1720,6 @@ class executionModel extends model ->beginIF($limit)->limit($limit)->fi() ->fetchAll('id'); - if(isset($project->model) and $project->model == 'waterfall') - { - $allExecutions = $this->dao->select('id,name,parent')->from(TABLE_EXECUTION) - ->where('type')->eq('stage') - ->andWhere('deleted')->eq('0') - ->beginIf($projectID)->andWhere('project')->eq($projectID)->fi() - ->fetchAll('id'); - - $parents = array(); - foreach($allExecutions as $id => $execution) $parents[$execution->parent] = $execution->parent; - - foreach($executions as $id => $execution) - { - if(isset($parents[$execution->id])) - { - unset($executions[$id]); - continue; - } - - $executionName = ''; - $paths = array_slice(explode(',', trim($execution->path, ',')), 1); - foreach($paths as $path) $executionName .= '/' . $allExecutions[$path]->name; - - if($executionName) $execution->name = ltrim($executionName, '/'); - } - } - $projects = array(); if(empty($projectID)) { diff --git a/module/task/control.php b/module/task/control.php index 465ba77563..c5dc2d13e3 100755 --- a/module/task/control.php +++ b/module/task/control.php @@ -300,7 +300,7 @@ class task extends control if(!empty($projectID)) { - $executions = $this->execution->getByProject($projectID, 'all', 0, true); + $executions = $this->execution->getPairs($projectID, 'all', 'leaf'); $executionKey = 0; $executionModifyList = $this->execution->getByIdList(array_keys($executions)); @@ -625,7 +625,7 @@ class task extends control if(isset($this->view->members['closed']) or $this->view->task->status == 'closed') $this->view->members['closed'] = 'Closed'; $executions = array(); - if(!empty($task->project)) $executions = $this->execution->getByProject($task->project, 'all', 0, true); + if(!empty($task->project)) $executions = $this->execution->getPairs($task->project, 'all', 'leaf'); $this->view->title = $this->lang->task->edit . 'TASK' . $this->lang->colon . $this->view->task->name; $this->view->position[] = $this->lang->task->common;