From 3f9ab0d3e0104bca1c26dec615cd9fc8d08e491b Mon Sep 17 00:00:00 2001 From: liumengyi Date: Thu, 25 Apr 2024 15:59:31 +0800 Subject: [PATCH] * Fix bug if the execution doesn't have the products. --- module/execution/control.php | 1 + module/execution/ui/edit.field.php | 2 +- module/execution/zen.php | 5 +++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/module/execution/control.php b/module/execution/control.php index 639a63c05a..b5ceddf3ec 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -1110,6 +1110,7 @@ class execution extends control ->setIF($this->post->status == 'closed' && $oldExecution->status != 'closed', 'closedDate', helper::now()) ->setIF($this->post->status == 'suspended' && $oldExecution->status != 'suspended', 'suspendedDate', helper::today()) ->setIF($oldExecution->type == 'stage', 'project', $oldExecution->project) + ->setDefault('project', $oldExecution->project) ->setDefault('team', $this->post->name) ->setDefault('branch', $this->post->branch) ->setDefault('attribute', $oldExecution->attribute) diff --git a/module/execution/ui/edit.field.php b/module/execution/ui/edit.field.php index fa6e3df253..0a33530a8f 100644 --- a/module/execution/ui/edit.field.php +++ b/module/execution/ui/edit.field.php @@ -35,7 +35,7 @@ if($project) } elseif($project->model == 'agileplus') { - $fields->field('project') + $fields->field('type') ->label($lang->execution->method) ->disabled() ->value(zget($lang->execution->typeList, data('execution.type'))); diff --git a/module/execution/zen.php b/module/execution/zen.php index 761f645c70..8f7e1f5b08 100644 --- a/module/execution/zen.php +++ b/module/execution/zen.php @@ -1796,6 +1796,11 @@ class executionZen extends execution $this->view->plan = $plan; } + if(isset($project->hasProduct) && empty($project->hasProduct)) + { + $product = $this->loadModel('product')->getShadowProductByProject($project->id); + $products = array($product->id => $product->name); + } return $products; }