From 4fe2ddb6832622255a679c978565517d9fbd2eb8 Mon Sep 17 00:00:00 2001 From: zhujinyong Date: Sun, 21 Mar 2021 17:53:43 +0800 Subject: [PATCH] * Fix build of project. --- module/build/control.php | 27 ++++++++------------------- module/story/control.php | 2 +- module/task/control.php | 3 +-- 3 files changed, 10 insertions(+), 22 deletions(-) diff --git a/module/build/control.php b/module/build/control.php index f6a3788628..aa06d03e04 100644 --- a/module/build/control.php +++ b/module/build/control.php @@ -25,16 +25,6 @@ class build extends control $this->loadModel('execution'); $this->loadModel('user'); - if($this->app->openApp == 'project') - { - $model = $this->dao->select('model')->from(TABLE_PROJECT)->where('id')->eq($projectID)->fetch('model'); - $this->lang->project->menu = $this->lang->menu->$model; - commonModel::setAppObjectID('project', $projectID); - - $executions = $this->execution->getPairs($projectID); - $executionID = $executionID == 0 ? key($executions) : $executionID; - } - if(!empty($_POST)) { $executionID = $this->post->execution; @@ -48,18 +38,17 @@ class build extends control $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $this->createLink('build', 'view', "buildID=$buildID"))); } - $execution = $this->execution->getByID($executionID); - if($this->app->openApp == 'execution') + if($this->app->openApp == 'project') { - /* Set session and get execution by id. */ - $this->session->set('buildCreate', $this->app->getURI(true)); + $this->project->setMenu($projectID); - /* Set menu. */ - $executions = $this->execution->getPairs($execution->project); - $this->execution->setMenu($executions, $executionID); - commonModel::setAppObjectID('execution', $executionID); } - + elseif($this->app->openApp == 'execution') + { + $executions = $this->execution->getPairs($projectID); + $executionID = $executionID == 0 ? key($executions) : $executionID; + $this->execution->setMenu($executions, $executionID); + } $productGroups = $this->execution->getProducts($executionID); $productID = $productID ? $productID : key($productGroups); diff --git a/module/story/control.php b/module/story/control.php index 0c237c1c33..833bda8797 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -849,7 +849,7 @@ class story extends control if($from == 'execution') { $executions = $this->loadModel('execution')->getPairs(0, 'all', 'nocode'); - $this->execution->setMenu($execution, $param); + $this->execution->setMenu($executions, $param); } elseif($from == 'project') { diff --git a/module/task/control.php b/module/task/control.php index 08e2592891..6f3b5fd129 100644 --- a/module/task/control.php +++ b/module/task/control.php @@ -39,10 +39,9 @@ class task extends control */ public function create($executionID = 0, $storyID = 0, $moduleID = 0, $taskID = 0, $todoID = 0) { - commonModel::setAppObjectID('execution', $executionID); - $executions = $this->execution->getPairs(); $executionID = $this->execution->saveState($executionID, $executions); + $this->execution->setMenu($executions, $executionID); $this->execution->getLimitedExecution(); $limitedExecutions = !empty($_SESSION['limitedExecutions']) ? $_SESSION['limitedExecutions'] : '';