From 049ae60320d87743dce19dfddf3fb71c01b99519 Mon Sep 17 00:00:00 2001 From: songchenxuan Date: Tue, 23 Nov 2021 17:30:37 +0800 Subject: [PATCH 1/6] * Fix bug #16642. --- module/testtask/control.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/module/testtask/control.php b/module/testtask/control.php index 98b1864063..d3e03b3244 100644 --- a/module/testtask/control.php +++ b/module/testtask/control.php @@ -766,7 +766,8 @@ class testtask extends control $productID = $productID ? $productID : key($this->products); $projectID = $this->lang->navGroup->testtask == 'qa' ? 0 : $this->session->project; $executions = empty($productID) ? array() : $this->product->getExecutionPairsByProduct($productID, 0, 'id_desc', $projectID); - $builds = empty($productID) ? array() : $this->loadModel('build')->getProductBuildPairs($productID, 0, 'notrunk', true); + $executionID = $task->execution; + $builds = empty($productID) ? array() : $this->loadModel('build')->getExecutionBuildPairs($executionID, $productID, 'all', 'noempty,notrunk'); $testreports = $this->testtask->getTestReportPairsByBuild($task->build); $this->view->task = $task; From 35bdfa93760fdca5737c952c0e7d61bdb5871fec Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Tue, 23 Nov 2021 17:32:40 +0800 Subject: [PATCH 2/6] * Fix bug#16565. --- module/my/view/story.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/my/view/story.html.php b/module/my/view/story.html.php index 912373715c..15b028fb24 100644 --- a/module/my/view/story.html.php +++ b/module/my/view/story.html.php @@ -142,7 +142,7 @@ if($canBeChanged) { $vars = "story={$child->id}"; - common::printIcon('story', 'change', $vars, $child, 'list', 'alter'); + common::printIcon('story', 'change', $vars, $child, 'list', 'alter', '', 'iframe', true); common::printIcon('story', 'review', $vars, $child, 'list', 'search'); common::printIcon('story', 'close', $vars, $child, 'list', '', '', 'iframe', true); common::printIcon('story', 'edit', $vars, $child, 'list', '', '', 'iframe', true, "data-width='95%'"); From d8d277842b188edf5a864a2d3654342779991763 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Tue, 23 Nov 2021 17:38:43 +0800 Subject: [PATCH 3/6] * Fix bug #16549. --- module/testcase/control.php | 2 +- module/tree/model.php | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/module/testcase/control.php b/module/testcase/control.php index 157c5e8451..a609f61a80 100644 --- a/module/testcase/control.php +++ b/module/testcase/control.php @@ -182,7 +182,7 @@ class testcase extends control } else { - $moduleTree = $this->tree->getTreeMenu($productID, $viewType = 'case', $startModuleID = 0, array('treeModel', 'createCaseLink'), array('projectID' => $projectID, 'productID' => $productID), $branch); + $moduleTree = $this->tree->getTreeMenu($productID, 'case', 0, array('treeModel', 'createCaseLink'), array('projectID' => $projectID, 'productID' => $productID), $projectID ? 0 : $branch); } $product = $this->product->getById($productID); diff --git a/module/tree/model.php b/module/tree/model.php index 578f344282..424e40938f 100644 --- a/module/tree/model.php +++ b/module/tree/model.php @@ -373,7 +373,8 @@ class treeModel extends model if($type == 'line') $rootID = 0; $this->loadModel('branch'); - $branches = array($branch => ''); + $projectID = zget($extra, 'projectID', 0); + $branches = array($branch => ''); if($branch) { $branchName = $this->branch->getById($branch); @@ -389,7 +390,6 @@ class treeModel extends model } elseif(($type == 'story' and $this->app->rawModule == 'projectstory') or ($type == 'case' and $this->app->tab == 'project')) { - $projectID = zget($extra, 'projectID', 0); if($product->type != 'normal' and $projectID) { $projectBranches = $this->dao->select('branch')->from(TABLE_PROJECTPRODUCT) @@ -397,6 +397,7 @@ class treeModel extends model ->andWhere('product')->eq($product->id) ->fetchPairs(); + $branches = array(); if(isset($projectBranches[BRANCH_MAIN])) $branches = array(BRANCH_MAIN => $this->lang->branch->main); $branches += $this->dao->select('id, name')->from(TABLE_BRANCH) ->where('id')->in($projectBranches) From 16873a81541be7554a5ab13a7705fb9fad8ed1f4 Mon Sep 17 00:00:00 2001 From: zhengrunyu Date: Tue, 23 Nov 2021 17:48:51 +0800 Subject: [PATCH 4/6] *Finish task #16619. --- module/testcase/model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/testcase/model.php b/module/testcase/model.php index c8e4a53949..7b20d5e3cf 100644 --- a/module/testcase/model.php +++ b/module/testcase/model.php @@ -1472,7 +1472,7 @@ class testcaseModel extends model } else { - $this->config->testcase->search['fields']['branch'] = $this->lang->product->branch; + $this->config->testcase->search['fields']['branch'] = $this->lang->product->branch = sprintf($this->lang->product->branch, $this->lang->product->branchName['branch']); $this->config->testcase->search['params']['branch']['values'] = array('' => '', '0' => $this->lang->branch->main) + $this->loadModel('branch')->getPairs($productID, 'noempty') + array('all' => $this->lang->branch->all); } if(!$this->config->testcase->needReview) unset($this->config->testcase->search['params']['status']['values']['wait']); From 2b3df26fd87ec589bb2d6edda5bc69303e559690 Mon Sep 17 00:00:00 2001 From: zhouxin Date: Tue, 23 Nov 2021 18:47:56 +0800 Subject: [PATCH 5/6] Fix bug 16564. --- module/execution/model.php | 2 +- module/product/model.php | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/module/execution/model.php b/module/execution/model.php index 8ac3800d22..6ed6978fc7 100644 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -654,7 +654,7 @@ class executionModel extends model ->checkIF($execution->begin != '', 'begin', 'date') ->checkIF($execution->end != '', 'end', 'date') ->checkIF($execution->end != '', 'end', 'gt', $execution->begin) - ->checkIF(!empty($execution->name), 'name', 'unique', "id != $executionID and type in ('sprint','stage') and `project` = $projectID") + ->checkIF((!empty($execution->name) and $this->config->systemMode == 'new'), 'name', 'unique', "id != $executionID and type in ('sprint','stage') and `project` = $projectID") ->checkIF(!empty($execution->code), 'code', 'unique', "id != $executionID and type in ('sprint','stage')") ->where('id')->eq($executionID) ->limit(1) diff --git a/module/product/model.php b/module/product/model.php index d05425ec08..78ce9e5b2b 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -593,10 +593,10 @@ class productModel extends model } $product = $this->loadModel('file')->processImgURL($product, $this->config->product->editor->create['id'], $this->post->uid); - $productProgram = isset($product->program) ? $product->program : ''; + $programID = isset($product->program) ? $product->program : ''; $this->dao->insert(TABLE_PRODUCT)->data($product)->autoCheck() ->batchCheck($this->config->product->create->requiredFields, 'notempty') - ->checkIF((!empty($product->name) and $this->config->systemMode == 'new'), 'name', 'unique', "`program` = $productProgram") + ->checkIF((!empty($product->name) and $this->config->systemMode == 'new'), 'name', 'unique', "`program` = $programID") ->checkIF(!empty($product->code), 'code', 'unique') ->exec(); @@ -721,13 +721,13 @@ class productModel extends model foreach($products as $productID => $product) { $oldProduct = $oldProducts[$productID]; - $programID = !isset($product->program) ? $oldProduct->program : (empty($product->program) ? 0 : $product->program); + if($this->config->systemMode == 'new') $programID = !isset($product->program) ? $oldProduct->program : (empty($product->program) ? 0 : $product->program); $this->dao->update(TABLE_PRODUCT) ->data($product) ->autoCheck() ->batchCheck($this->config->product->edit->requiredFields , 'notempty') - ->checkIF(!empty($product->name), 'name', 'unique', "id != $productID and `program` = $programID") + ->checkIF((!empty($product->name) and $this->config->systemMode == 'new'), 'name', 'unique', "id != $productID and `program` = $programID") ->where('id')->eq($productID) ->exec(); if(dao::isError()) die(js::error('product#' . $productID . dao::getError(true))); From 15867e4fd30487df3ccdadc3050d3ce1571548ef Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Tue, 23 Nov 2021 19:03:20 +0800 Subject: [PATCH 6/6] * Fix bug#16638. --- module/testcase/model.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/module/testcase/model.php b/module/testcase/model.php index 7b20d5e3cf..e4d51d810c 100644 --- a/module/testcase/model.php +++ b/module/testcase/model.php @@ -1472,7 +1472,8 @@ class testcaseModel extends model } else { - $this->config->testcase->search['fields']['branch'] = $this->lang->product->branch = sprintf($this->lang->product->branch, $this->lang->product->branchName['branch']); + $productInfo = $this->loadModel('product')->getByID($productID); + $this->config->testcase->search['fields']['branch'] = sprintf($this->lang->product->branch, $this->lang->product->branchName[$productInfo->type]); $this->config->testcase->search['params']['branch']['values'] = array('' => '', '0' => $this->lang->branch->main) + $this->loadModel('branch')->getPairs($productID, 'noempty') + array('all' => $this->lang->branch->all); } if(!$this->config->testcase->needReview) unset($this->config->testcase->search['params']['status']['values']['wait']);