From 30d1e22dcad6a92cbbb8fdfe2d725b5c7669765d Mon Sep 17 00:00:00 2001 From: tanghucheng Date: Fri, 3 Dec 2021 13:57:08 +0800 Subject: [PATCH] * Merge programplan into stage. --- module/execution/control.php | 6 ++++-- module/execution/view/all.html.php | 21 +++++++++++---------- module/programplan/control.php | 2 ++ module/programplan/model.php | 1 + module/programplan/view/create.html.php | 12 ++++++++++++ 5 files changed, 30 insertions(+), 12 deletions(-) diff --git a/module/execution/control.php b/module/execution/control.php index c05bf53dc9..8a5a56e4bf 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -3056,11 +3056,13 @@ class execution extends control $from = $this->app->tab; if($from == 'execution') $this->session->set('executionList', $this->app->getURI(true), 'execution'); + if($from == 'project') { $projects = $this->project->getPairsByProgram(); $projectID = $this->project->saveState($projectID, $projects); - $this->view->project = $this->loadModel('project')->getByID($projectID); + $project = $this->loadModel('project')->getByID($projectID); + $this->view->project = $project; $this->project->setMenu($projectID); } @@ -3096,7 +3098,7 @@ class execution extends control $this->view->users = $this->loadModel('user')->getPairs('noletter'); $this->view->status = $status; $this->view->from = $from; - + $this->view->isStage = (isset($project->model) and $project->model == 'waterfall') ? true : false; $this->display(); } diff --git a/module/execution/view/all.html.php b/module/execution/view/all.html.php index eb436c4831..ae3b31efc2 100644 --- a/module/execution/view/all.html.php +++ b/module/execution/view/all.html.php @@ -15,7 +15,7 @@
- product->all;?> + product->allProduct;?>
- type == 'stage'):?> + percent . '%';?> stage->typeList, $execution->attribute, '');?> begin;?> @@ -169,7 +169,7 @@ lang->execution->workHour;?>'>hours->totalLeft . $this->lang->execution->workHourUnit;?> - model == 'scrum'):?> + burns);?>'> " . $this->loadModel('flow')->getFieldValue($extendField, $execution) . "";?> @@ -206,7 +206,7 @@
hours->progress);?>
- type == 'stage'):?> + percent . '%';?> stage->typeList, $child->attribute, '');?> begin;?> @@ -214,7 +214,7 @@ realBegan;?> realEnd;?> - id}", $child, 'list', '', '', 'iframe', true); $class = !empty($child->children) ? 'disabled' : ''; common::printIcon('task', 'create', "executionID={$child->id}", $child, 'list', '', '', $class, false, "data-app='execution'"); @@ -235,14 +235,15 @@ if(common::hasPriv('execution', 'delete', $child)) { common::printIcon('execution', 'delete', "planID=$child->id&confirm=no", $child, 'list', 'trash', 'hiddenwin' , $disabled, '', '', $this->lang->programplan->delete); - }?> + } + ?> lang->execution->workHour;?>'>hours->totalEstimate . ' ' . $this->lang->execution->workHourUnit;?> lang->execution->workHour;?>'>hours->totalConsumed . ' ' . $this->lang->execution->workHourUnit;?> lang->execution->workHour;?>'>hours->totalLeft . ' ' . $this->lang->execution->workHourUnit;?> - model == 'scrum'):?> + burns);?>'> " . $this->loadModel('flow')->getFieldValue($extendField, $child) . "";?> diff --git a/module/programplan/control.php b/module/programplan/control.php index 17c77aacc4..2f0e50b537 100644 --- a/module/programplan/control.php +++ b/module/programplan/control.php @@ -130,7 +130,9 @@ class programplan extends control $this->view->position[] = html::a($this->createLink('programplan', 'browse', "projectID=$projectID"), $project->name); $this->view->position[] = $this->lang->programplan->create; + $this->view->productList = $this->loadModel('product')->getProductPairsByProject($projectID); $this->view->project = $project; + $this->view->productID = $productID; $this->view->stages = empty($planID) ? $this->loadModel('stage')->getStages('id_asc') : array(); $this->view->programPlan = $this->project->getById($planID, 'stage'); $this->view->plans = $this->programplan->getStage($planID ? $planID : $projectID, $this->productID, 'parent'); diff --git a/module/programplan/model.php b/module/programplan/model.php index 2ec418fe6b..9d46210a8b 100644 --- a/module/programplan/model.php +++ b/module/programplan/model.php @@ -57,6 +57,7 @@ class programplanModel extends model $plans = $this->dao->select('t2.*')->from(TABLE_PROJECTPRODUCT)->alias('t1') ->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id') ->where('t2.type')->eq('stage') + ->andWhere('t1.product')->eq($productID) ->beginIF($browseType == 'all')->andWhere('t2.project')->eq($executionID)->fi() ->beginIF($browseType == 'parent')->andWhere('t2.parent')->eq($executionID)->fi() ->beginIF(!$this->app->user->admin)->andWhere('t2.id')->in($this->app->user->view->sprints)->fi() diff --git a/module/programplan/view/create.html.php b/module/programplan/view/create.html.php index 0dc384c14b..98dfed8df9 100644 --- a/module/programplan/view/create.html.php +++ b/module/programplan/view/create.html.php @@ -22,6 +22,18 @@ echo "{$title}"; ?> +
+ + + +