From a69d10d9dbfe01a2c04d5f42e24a5dc1d934422b Mon Sep 17 00:00:00 2001 From: sunjun Date: Fri, 10 Jun 2022 06:36:12 +0000 Subject: [PATCH 01/20] sprint_194 add project in batchcreate view --- module/bug/config.php | 11 +++++-- module/bug/control.php | 2 ++ module/bug/css/create.css | 6 ++-- module/bug/js/batchcreate.js | 18 +++++++--- module/bug/js/common.js | 49 ++++++++++++++++++++++++++-- module/bug/model.php | 4 +++ module/bug/view/batchcreate.html.php | 15 +++++++++ module/product/control.php | 33 +++++++++++++++++++ 8 files changed, 126 insertions(+), 12 deletions(-) diff --git a/module/bug/config.php b/module/bug/config.php index 3ed3977fb8..680b102b1e 100644 --- a/module/bug/config.php +++ b/module/bug/config.php @@ -40,12 +40,19 @@ $config->bug->list->exportFields = 'id, product, branch, module, project, execut if($config->systemMode == 'classic') $config->bug->list->exportFields = str_replace(' project,', '', $config->bug->list->exportFields); $config->bug->list->customCreateFields = 'execution,noticefeedbackBy,story,task,pri,severity,os,browser,deadline,mailto,keywords'; -$config->bug->list->customBatchCreateFields = 'execution,steps,type,pri,deadline,severity,os,browser,keywords'; $config->bug->list->customBatchEditFields = 'type,severity,pri,productplan,assignedTo,deadline,resolvedBy,resolution,os,browser,keywords'; +if($config->systemMode == 'new') +{ + $config->bug->list->customBatchCreateFields = 'project,execution,steps,type,pri,deadline,severity,os,browser,keywords'; +} +else +{ + $config->bug->list->customBatchCreateFields = 'execution,steps,type,pri,deadline,severity,os,browser,keywords'; +} $config->bug->custom = new stdclass(); $config->bug->custom->createFields = $config->bug->list->customCreateFields; -$config->bug->custom->batchCreateFields = 'execution,deadline,steps,type,severity,os,browser,%s'; +$config->bug->custom->batchCreateFields = 'project,execution,deadline,steps,type,severity,os,browser,%s'; $config->bug->custom->batchEditFields = 'type,severity,pri,assignedTo,deadline,status,resolvedBy,resolution'; $config->bug->editor = new stdclass(); diff --git a/module/bug/control.php b/module/bug/control.php index cd99ed60d7..0cf5e84a89 100755 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -822,6 +822,8 @@ class bug extends control $this->view->stories = $stories; $this->view->builds = $builds; $this->view->users = $this->user->getPairs('devfirst|noclosed'); + $this->view->projects = array('' => '') + $this->product->getProjectPairsByProduct($productID, $branch ? "0,$branch" : 0, 'id_desc', $projectID); + $this->view->projectID = $projectID; $this->view->executions = array('' => '') + $this->product->getExecutionPairsByProduct($productID, $branch ? "0,$branch" : 0, 'id_desc', $projectID); $this->view->executionID = $executionID; $this->view->moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'bug', $startModuleID = 0, $branch === 'all' ? 0 : $branch); diff --git a/module/bug/css/create.css b/module/bug/css/create.css index 1cfd6a6b57..be008fac02 100644 --- a/module/bug/css/create.css +++ b/module/bug/css/create.css @@ -47,5 +47,7 @@ html[lang='en'] #deadlineTd .input-group-addon {padding: 5px 18px;} #branch_chosen {min-width: 90px;} #notifyEmailTd .input-group-addon, #deadlineTd .input-group-addon {border-radius: 2px 0px 2px 0px !important;} -#feedback.input-group + #notifyEmailLabel {position: relative; width: 50%; left: 48%} -#executionLabel {position: relative; width: 50%; left: 48%} +#feedback.input-group + #notifyEmailLabel {position: relative; width: 50%; left: 48%;} +#executionLabel {display: inline; position: relative; width: 50%; left: 37%;} +#projectLabel {display: inline;} +#openedBuildLabel {display: inline; position: relative; width: 50%; left: 14%;} diff --git a/module/bug/js/batchcreate.js b/module/bug/js/batchcreate.js index c5cb2073a8..ca5552b022 100644 --- a/module/bug/js/batchcreate.js +++ b/module/bug/js/batchcreate.js @@ -60,17 +60,25 @@ function setLane(regionID, num) } /** - * Load execution builds + * Load execution builds. * - * @param int $productID - * @param int $executionID - * @param int $index + * @param int $productID + * @param int $executionID + * @param int $index * @access public * @return void */ function loadExecutionBuilds(productID, executionID, index) { - branch = $('#branches' + index).val(); + var branch = $('#branches' + index).val(); + if(executionID == 'ditto') + { + for(var i = index - 1; i > 0, executionID == 'ditto'; i--) + { + executionID = $('#executions' + i).val(); + } + } + if(executionID != 0) { link = createLink('build', 'ajaxGetExecutionBuilds', 'executionID=' + executionID + '&productID=' + productID + "&varName=openedBuilds&build=&branch=" + branch + "&index=" + index); diff --git a/module/bug/js/common.js b/module/bug/js/common.js index 96211eea0f..755f02ffee 100644 --- a/module/bug/js/common.js +++ b/module/bug/js/common.js @@ -339,6 +339,39 @@ function loadProductExecutions(productID, projectID = 0) projectID != 0 ? loadProjectBuilds(projectID) : loadProductBuilds(productID); } +/** + * Load executions of product and project. + * + * @param int $productID + * @param int $projectID + * @param int $num + * @access public + * @return void + */ +function loadProductExecutionsByProject(productID, projectID = 0, num = 0) +{ + var branch = $('#branches' + num).val(); + if(typeof(branch) == 'undefined') branch = 0; + + if(projectID == 'ditto') + { + for(var i = num - 1; i > 0, projectID == 'ditto'; i--) + { + projectID = $('#projects' + i).val(); + } + } + + var link = createLink('product', 'ajaxGetExecutionsByProject', 'productID=' + productID + '&projectID=' + projectID + '&branch=' + branch + '&number=' + num); + $.get(link, function(executions) + { + if(!executions) executions = ''; + $('#executions' + num).replaceWith(executions); + $("#executions" + num + "_chosen").remove(); + $("#executions" + num).next('.picker').remove(); + $("#executions" + num).chosen(); + }); +} + /** * Load product plans. * @@ -761,7 +794,7 @@ function notice() function setBranchRelated(branchID, productID, num) { var currentModuleID = config.currentMethod == 'batchedit' ? $('#modules' + num).val() : 0; - moduleLink = createLink('tree', 'ajaxGetModules', 'productID=' + productID + '&viewType=bug&branch=' + branchID + '&num=' + num + '¤tModuleID=' + currentModuleID); + var moduleLink = createLink('tree', 'ajaxGetModules', 'productID=' + productID + '&viewType=bug&branch=' + branchID + '&num=' + num + '¤tModuleID=' + currentModuleID); $.get(moduleLink, function(modules) { if(!modules) modules = ''; @@ -771,7 +804,17 @@ function setBranchRelated(branchID, productID, num) $("#modules" + num).chosen(); }); - executionLink = createLink('product', 'ajaxGetExecutions', 'productID=' + productID + '&projectID=0&branch=' + branchID + '&num=' + num); + var projectLink = createLink('product', 'ajaxGetProjectsByBranch', 'productID=' + productID + '&branch=' + branchID + '&num=' + num); + $.get(projectLink, function(projects) + { + if(!projects) projects = ''; + $('#projects' + num).replaceWith(projects); + $("#projects" + num + "_chosen").remove(); + $("#projects" + num).next('.picker').remove(); + $("#projects" + num).chosen(); + }); + + var executionLink = createLink('product', 'ajaxGetExecutions', 'productID=' + productID + '&projectID=0&branch=' + branchID + '&num=' + num); $.get(executionLink, function(executions) { if(!executions) executions = ''; @@ -781,7 +824,7 @@ function setBranchRelated(branchID, productID, num) $("#executions" + num).chosen(); }); - buildLink = createLink('build', 'ajaxGetProductBuilds', 'productID=' + productID + "&varName=openedBuilds&build=&branch=" + branchID + "&index=" + num); + var buildLink = createLink('build', 'ajaxGetProductBuilds', 'productID=' + productID + "&varName=openedBuilds&build=&branch=" + branchID + "&index=" + num); /* If the branch of the current row is inconsistent with the one below, clear the module and execution of the nex row. */ if(config.currentMethod == 'batchcreate') diff --git a/module/bug/model.php b/module/bug/model.php index 5e4d93c7cc..ba87ebef4e 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -159,6 +159,7 @@ class bugModel extends model while($module = $stmt->fetch()) $moduleOwners[$module->id] = $module->owner; $module = 0; + $project = 0; $execution = 0; $type = ''; $pri = 0; @@ -167,6 +168,7 @@ class bugModel extends model foreach($data->title as $i => $title) { if($data->modules[$i] != 'ditto') $module = (int)$data->modules[$i]; + if($data->projects[$i] != 'ditto') $project = (int)$data->projects[$i]; if($data->executions[$i] != 'ditto') $execution = (int)$data->executions[$i]; if($data->types[$i] != 'ditto') $type = $data->types[$i]; if($data->pris[$i] != 'ditto') $pri = $data->pris[$i]; @@ -174,6 +176,7 @@ class bugModel extends model if($data->browsers[$i] != 'ditto') $browser = $data->browsers[$i]; $data->modules[$i] = (int)$module; + $data->projects[$i] = (int)$project; $data->executions[$i] = (int)$execution; $data->types[$i] = $type; $data->pris[$i] = $pri; @@ -196,6 +199,7 @@ class bugModel extends model $bug->product = (int)$productID; $bug->branch = isset($data->branches) ? (int)$data->branches[$i] : 0; $bug->module = (int)$data->modules[$i]; + $bug->project = (int)$data->projects[$i]; $bug->execution = (int)$data->executions[$i]; $bug->openedBuild = implode(',', $data->openedBuilds[$i]); $bug->color = $data->color[$i]; diff --git a/module/bug/view/batchcreate.html.php b/module/bug/view/batchcreate.html.php index c8972d9c1b..91c02ab591 100755 --- a/module/bug/view/batchcreate.html.php +++ b/module/bug/view/batchcreate.html.php @@ -55,6 +55,9 @@ js::set('requiredFields', $config->bug->create->requiredFields); idAB;?> '> product->branch;?> '> bug->module;?> + systemMode == 'new'):?> + '>model) and $project->model == 'kanban') ? $lang->bug->kanban : $lang->bug->project;?> + '>model) and $project->model == 'kanban') ? $lang->bug->kanban : $lang->bug->execution;?> bug->openedBuild;?> bug->title;?> @@ -83,6 +86,7 @@ js::set('requiredFields', $config->bug->create->requiredFields); $lang->bug->ditto); + $projects += array('ditto' => $lang->bug->ditto); $executions += array('ditto' => $lang->bug->ditto); $lang->bug->typeList += array('ditto' => $lang->bug->ditto); $lang->bug->priList += array('ditto' => $lang->bug->ditto); @@ -94,6 +98,7 @@ js::set('requiredFields', $config->bug->create->requiredFields); $fileName):?> bug->create->requiredFields); ' style='overflow:visible'> + systemMode == 'new'):?> + ' style='overflow:visible'> + ' style='overflow:visible'> @@ -144,6 +152,7 @@ js::set('requiredFields', $config->bug->create->requiredFields); bug->batchCreate; $i++):?> bug->create->requiredFields); ' style='overflow:visible'> + systemMode == 'new'):?> + ' style='overflow:visible'> + ' style='overflow:visible'> @@ -207,6 +219,9 @@ js::set('requiredFields', $config->bug->create->requiredFields); %s ' style='overflow:visible'> + systemMode == 'new'):?> + ' style='overflow:visible'> + ' style='overflow:visible'> diff --git a/module/product/control.php b/module/product/control.php index 2d3a6291a9..7557e4e480 100644 --- a/module/product/control.php +++ b/module/product/control.php @@ -963,6 +963,23 @@ class product extends control return print(html::select('project', $projects, $projectID, "class='form-control' onchange='loadProductExecutions({$productID}, this.value)'")); } + /** + * AJAX: get projects of a product in html select. + * + * @param int $productID + * @param int $branch + * @param int $number + * @access public + * @return void + */ + public function ajaxGetProjectsByBranch($productID, $branch = 0, $number = 0) + { + $projects = array('' => ''); + $projects += $this->product->getProjectPairsByProduct($productID, $branch); + + return print(html::select('projects' . "[$number]", array('' => '') + $projects, 0, "class='form-control' onchange='loadProductExecutionsByProject($productID, this.value, $number)'")); + } + /** * AJAX: get executions of a product in html select. * @@ -999,6 +1016,22 @@ class product extends control } } + /** + * AJAX: get executions of a product in html select. + * + * @param int $productID + * @param int $projectID + * @param int $branch + * @param int $number + * @access public + * @return void + */ + public function ajaxGetExecutionsByProject($productID, $projectID = 0, $branch = 0, $number = 0) + { + $executions = $this->product->getExecutionPairsByProduct($productID, $branch, 'id_desc', $projectID, ''); + return print(html::select('executions' . "[$number]", array('' => '') + $executions, 0, "class='form-control' onchange='loadExecutionBuilds($productID, this.value, $number)'")); + } + /** * AJAX: get plans of a product in html select. * From bf5679021678ac66583bcbe4ebfa1ddc457ba91f Mon Sep 17 00:00:00 2001 From: mayue Date: Fri, 10 Jun 2022 16:06:10 +0800 Subject: [PATCH 02/20] * Fix bug #22928. --- module/product/lang/en.php | 1 + module/product/lang/zh-cn.php | 1 + module/product/model.php | 13 ++++++++++++- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/module/product/lang/en.php b/module/product/lang/en.php index a20aa334df..575e5890e2 100644 --- a/module/product/lang/en.php +++ b/module/product/lang/en.php @@ -89,6 +89,7 @@ $lang->product->programChangeTip = "The projects linked with this {$lang->pr $lang->product->notChangeProgramTip = "The {$lang->SRCommon} of {$lang->productCommon} has been linked to the following projects, please cancel the link before proceeding"; $lang->product->confirmChangeProgram = "The projects linked with this {$lang->productCommon}: %s is also linked with other products, whether to transfer projects to the modified program set."; $lang->product->changeProgramError = "The {$lang->SRCommon} of this {$lang->productCommon} has been linked to the project, please unlink it before proceeding"; +$lang->product->changeLineError = "Products already exist under the product line, so the program within them cannot be modified."; $lang->product->programEmpty = 'Program should not be empty!'; $lang->product->nameIsDuplicate = "『%s』 product line already exists, please reset!"; $lang->product->nameIsDuplicated = "Product Line『%s』 exists. Go to Admin->System->Data->Recycle Bin to restore it, if you are sure it is deleted."; diff --git a/module/product/lang/zh-cn.php b/module/product/lang/zh-cn.php index 999d1f828b..4a04d8ca97 100644 --- a/module/product/lang/zh-cn.php +++ b/module/product/lang/zh-cn.php @@ -89,6 +89,7 @@ $lang->product->programChangeTip = "如下项目只关联了该{$lang->produ $lang->product->notChangeProgramTip = "该{$lang->productCommon}的{$lang->SRCommon}已经关联到如下项目,请取消关联后再操作"; $lang->product->confirmChangeProgram = "如下项目既关联了该{$lang->productCommon}又关联了其他{$lang->productCommon},请确认是否继续关联该{$lang->productCommon},勾选后将取消与其他{$lang->productCommon}的关联关系,同时转移至新项目集下。"; $lang->product->changeProgramError = "该{$lang->productCommon}的{$lang->SRCommon}已经关联到项目,请取消关联后再操作"; +$lang->product->changeLineError = "产品线下已有产品,不可修改所属项目集"; $lang->product->programEmpty = '项目集不能为空'; $lang->product->nameIsDuplicate = "『%s』产品线已经存在,请重新设置!"; $lang->product->nameIsDuplicated = "产品线已经有『%s』这条记录了。如果您确定该记录已删除,请到后台-系统-数据-回收站还原。"; diff --git a/module/product/model.php b/module/product/model.php index c7835acc3e..b5d0db4e2f 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -913,7 +913,18 @@ class productModel extends model */ public function manageLine() { - $data = fixer::input('post')->get(); + $oldLines = $this->getLines(); + $data = fixer::input('post')->get(); + + /* When there are products under the line, the program cannot be modified */ + foreach($oldLines as $oldLine) + { + $oldLineID = 'id' . $oldLine->id; if($data->modules[$oldLineID] != $oldLine->name or $data->programs[$oldLineID] != $oldLine->root) + { + $product = $this->dao->select('*')->from(TABLE_PRODUCT)->where('line')->eq($oldLine->id)->fetchAll('id'); + if(!empty($product)) return print(js::error($this->lang->product->changeLineError) . js::locate('parent')); + } + } $line = new stdClass(); $line->type = 'line'; From 9b760367611a2e718f6a89f8d5c6caa08536be99 Mon Sep 17 00:00:00 2001 From: mayue Date: Fri, 10 Jun 2022 16:17:58 +0800 Subject: [PATCH 03/20] * Optimize code. --- module/product/model.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/module/product/model.php b/module/product/model.php index b5d0db4e2f..19bb2de5c5 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -919,7 +919,8 @@ class productModel extends model /* When there are products under the line, the program cannot be modified */ foreach($oldLines as $oldLine) { - $oldLineID = 'id' . $oldLine->id; if($data->modules[$oldLineID] != $oldLine->name or $data->programs[$oldLineID] != $oldLine->root) + $oldLineID = 'id' . $oldLine->id; + if($data->modules[$oldLineID] != $oldLine->name or $data->programs[$oldLineID] != $oldLine->root) { $product = $this->dao->select('*')->from(TABLE_PRODUCT)->where('line')->eq($oldLine->id)->fetchAll('id'); if(!empty($product)) return print(js::error($this->lang->product->changeLineError) . js::locate('parent')); From d72eda83d97f2fc9c83ea4d6ebafea0ee7472b10 Mon Sep 17 00:00:00 2001 From: mayue Date: Fri, 10 Jun 2022 16:20:40 +0800 Subject: [PATCH 04/20] * Optimize code. --- module/product/model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/product/model.php b/module/product/model.php index 19bb2de5c5..8d3a163457 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -920,7 +920,7 @@ class productModel extends model foreach($oldLines as $oldLine) { $oldLineID = 'id' . $oldLine->id; - if($data->modules[$oldLineID] != $oldLine->name or $data->programs[$oldLineID] != $oldLine->root) + if($data->programs[$oldLineID] != $oldLine->root) { $product = $this->dao->select('*')->from(TABLE_PRODUCT)->where('line')->eq($oldLine->id)->fetchAll('id'); if(!empty($product)) return print(js::error($this->lang->product->changeLineError) . js::locate('parent')); From f798c853a78e378bb69a036b3105e0c5fae928d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=8B=E8=BE=B0=E8=BD=A9?= Date: Fri, 10 Jun 2022 16:22:46 +0800 Subject: [PATCH 05/20] * Fix api bug. --- api/v1/entries/feedbackclose.php | 2 ++ api/v1/entries/feedbacks.php | 4 ++-- api/v1/entries/project.php | 2 +- module/common/model.php | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/api/v1/entries/feedbackclose.php b/api/v1/entries/feedbackclose.php index 65f0f49554..045d9dedc4 100644 --- a/api/v1/entries/feedbackclose.php +++ b/api/v1/entries/feedbackclose.php @@ -25,6 +25,8 @@ class feedbackCloseEntry extends Entry $fields = 'closedReason,comment'; $this->batchSetPost($fields); + if(empty($_POST)) $this->setPost('status', 'closed'); + $control = $this->loadController('feedback', 'close'); $control->close($feedbackID); diff --git a/api/v1/entries/feedbacks.php b/api/v1/entries/feedbacks.php index af4d515801..f71059aa27 100644 --- a/api/v1/entries/feedbacks.php +++ b/api/v1/entries/feedbacks.php @@ -22,7 +22,7 @@ class feedbacksEntry extends entry if(strpos(strtolower($this->param('fields')), 'moduleandproduct') !== false) return $this->getModuleAndProduct(); $control = $this->loadController('feedback', 'admin'); - $control->admin($this->param('status', 'unclosed'), 0, $this->param('orderBy', 'id_desc'), 0, $this->param('limit', 20), $this->param('page', 1)); + $control->admin($this->param('solution', 'unclosed'), 0, $this->param('orderBy', 'id_desc'), 0, $this->param('limit', 20), $this->param('page', 1)); $data = $this->getData(); if(!$data or !isset($data->status)) return $this->sendError(400, 'error'); @@ -34,7 +34,7 @@ class feedbacksEntry extends entry $result = array(); foreach($feedbacks as $feedback) { - $result[] = $this->format($feedback, 'openedBy:user,openedDate:time,reviewedBy:user,reviewedDate:time,processedBy:user,processedDate:time,closedBy:user,closedDate:time,editedBy:user,editedDate:time,mailto:userList,deleted:bool'); + $result[] = $this->format($feedback, 'openedBy:user,openedDate:time,reviewedBy:user,reviewedDate:time,processedBy:user,processedDate:time,closedBy:user,closedDate:time,editedBy:user,editedDate:time,assignedTo:user,mailto:userList,deleted:bool'); } $data = array(); diff --git a/api/v1/entries/project.php b/api/v1/entries/project.php index 6665b28b5e..309c0b7384 100644 --- a/api/v1/entries/project.php +++ b/api/v1/entries/project.php @@ -102,7 +102,7 @@ class projectEntry extends entry $linkedProducts = $this->loadModel('product')->getProducts($projectID); /* Set $_POST variables. */ - $fields = 'name,begin,end,acl,parent,desc,PM,whitelist'; + $fields = 'name,code,begin,end,acl,parent,desc,PM,whitelist,model'; $this->batchSetPost($fields, $oldProject); $products = array(); diff --git a/module/common/model.php b/module/common/model.php index 5f392554d1..54a3c34a61 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -1920,7 +1920,7 @@ EOD; if(strtolower($key) == 'closeddate' && $value == '') continue; if(strtolower($key) == 'actualcloseddate' && $value == '') continue; - if(array_key_exists($key, $old) and $value != stripslashes($old->$key)) + if(isset($old->$key) and $value != stripslashes($old->$key)) { $diff = ''; if(substr_count($value, "\n") > 1 or From d3018dd97887f67a58b4bb1b365d1e7fd7e87d66 Mon Sep 17 00:00:00 2001 From: mayue Date: Fri, 10 Jun 2022 17:25:14 +0800 Subject: [PATCH 06/20] * Optimize code. --- module/product/model.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/product/model.php b/module/product/model.php index 8d3a163457..89742f3dd8 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -922,8 +922,8 @@ class productModel extends model $oldLineID = 'id' . $oldLine->id; if($data->programs[$oldLineID] != $oldLine->root) { - $product = $this->dao->select('*')->from(TABLE_PRODUCT)->where('line')->eq($oldLine->id)->fetchAll('id'); - if(!empty($product)) return print(js::error($this->lang->product->changeLineError) . js::locate('parent')); + $product = $this->dao->select('*')->from(TABLE_PRODUCT)->where('line')->eq($oldLine->id)->fetch(); + if(!empty($product)) return print(js::error($this->lang->product->changeLineError)); } } From a48a3614aad9a606ca45da4ffc194bf6391d2c35 Mon Sep 17 00:00:00 2001 From: liumengyi Date: Mon, 13 Jun 2022 08:08:30 +0800 Subject: [PATCH 07/20] * Fix bug #23581. --- module/search/view/buildform.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/search/view/buildform.html.php b/module/search/view/buildform.html.php index 97d9ecfe56..52a144bfee 100644 --- a/module/search/view/buildform.html.php +++ b/module/search/view/buildform.html.php @@ -526,7 +526,7 @@ $(function() { if(!$searchForm.find('#value' + i).hasClass('picker-select')) $searchForm.find('#value' + i).val('').trigger('chosen:updated'); if($searchForm.find('#value' + i).hasClass('picker-select')) $searchForm.find('#value' + i).data('zui.picker').setValue(''); - $searchForm.find('#value' + i).val('').attr('placeholder',''); + $searchForm.find('#value' + i + '.date').val('').attr('placeholder',''); } }; From c8bf2f2e67bd751e3578754aecfbc1927cc6a147 Mon Sep 17 00:00:00 2001 From: sunjun Date: Mon, 13 Jun 2022 00:17:47 +0000 Subject: [PATCH 08/20] fixbug_sunjun_23572 --- module/my/view/requirement.html.php | 2 +- module/my/view/story.html.php | 2 +- module/my/view/testcase.html.php | 2 +- module/product/config.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/module/my/view/requirement.html.php b/module/my/view/requirement.html.php index cc96a946a2..f264e968f9 100644 --- a/module/my/view/requirement.html.php +++ b/module/my/view/requirement.html.php @@ -31,7 +31,7 @@ echo html::a(inlink($app->rawMethod, "mode=requirement&type=reviewBy¶m=$param&orderBy=$orderBy&recTotal=$recTotal&recPerPage=$recPerPage&pagerID=$pageID"), "{$lang->my->storyMenu->reviewByMe}" . ($type == 'reviewBy' ? $recTotalLabel : ''), '', "class='btn btn-link" . ($type == 'reviewBy' ? ' btn-active-text' : '') . "'"); } ?> - loadModel('search');echo $lang->search->common;?> + loadModel('search');echo $lang->search->common;?>
diff --git a/module/my/view/story.html.php b/module/my/view/story.html.php index 89c1514a19..738f5ad1d2 100644 --- a/module/my/view/story.html.php +++ b/module/my/view/story.html.php @@ -31,7 +31,7 @@ echo html::a(inlink($app->rawMethod, "mode=story&type=reviewBy¶m=$param&orderBy=$orderBy&recTotal=$recTotal&recPerPage=$recPerPage&pagerID=$pageID"), "{$lang->my->storyMenu->reviewByMe}" . ($type == 'reviewBy' ? $recTotalLabel : ''), '', "class='btn btn-link" . ($type == 'reviewBy' ? ' btn-active-text' : '') . "'"); } ?> - loadModel('search');echo $lang->search->common;?> + loadModel('search');echo $lang->search->common;?>
diff --git a/module/my/view/testcase.html.php b/module/my/view/testcase.html.php index 598a23f3ad..2d87456686 100644 --- a/module/my/view/testcase.html.php +++ b/module/my/view/testcase.html.php @@ -28,7 +28,7 @@ echo html::a(inlink($app->rawMethod, "mode=$mode&type=assigntome"), "{$lang->my->assignedToMe}" . ($type == 'assigntome' ? $recTotalLabel : ''), '', "class='btn btn-link" . ($type == 'assigntome' ? ' btn-active-text' : '') . "'"); } ?> - loadModel('search');echo $lang->search->common;?> + loadModel('search');echo $lang->search->common;?>
diff --git a/module/product/config.php b/module/product/config.php index 484c3337fb..789f16d593 100644 --- a/module/product/config.php +++ b/module/product/config.php @@ -69,7 +69,7 @@ $config->product->search['params']['estimate'] = array('operator' => '=', $config->product->search['params']['source'] = array('operator' => '=', 'control' => 'select', 'values' => $lang->story->sourceList); $config->product->search['params']['sourceNote'] = array('operator' => 'include', 'control' => 'input', 'values' => ''); $config->product->search['params']['fromBug'] = array('operator' => '=', 'control' => 'input', 'values' => ''); -$config->product->search['params']['category'] = array('operator' => '=', 'control' => 'select', 'values' => $lang->story->categoryList); +$config->product->search['params']['category'] = array('operator' => '=', 'control' => 'select', 'values' => array('' => '') + $lang->story->categoryList); $config->product->search['params']['openedBy'] = array('operator' => '=', 'control' => 'select', 'values' => 'users'); $config->product->search['params']['reviewedBy'] = array('operator' => 'include', 'control' => 'select', 'values' => 'users'); From 68b8268391a6e74a272fca49a4202cb201155c94 Mon Sep 17 00:00:00 2001 From: zhouxin Date: Mon, 13 Jun 2022 01:25:38 +0000 Subject: [PATCH 09/20] * Finish task #55258. --- module/action/lang/en.php | 1 + module/action/lang/zh-cn.php | 1 + module/bug/control.php | 4 +++ module/bug/js/view.js | 46 +++++++++++++++++++++++++++++++++++ module/bug/lang/en.php | 5 ++++ module/bug/lang/zh-cn.php | 5 ++++ module/bug/model.php | 1 + module/bug/view/view.html.php | 40 ++++++++++++++++++++++++++++++ module/product/control.php | 6 +++-- module/task/control.php | 13 ++++++++-- module/task/model.php | 8 +++++- 11 files changed, 125 insertions(+), 5 deletions(-) diff --git a/module/action/lang/en.php b/module/action/lang/en.php index 697ce47740..ae158bc1f2 100755 --- a/module/action/lang/en.php +++ b/module/action/lang/en.php @@ -266,6 +266,7 @@ $lang->action->label->tostory = 'converted to Story '; $lang->action->label->frombug = 'converted from Bug '; $lang->action->label->fromlib = 'imported from Library '; $lang->action->label->totask = 'converted to Task '; +$lang->action->label->converttotask = 'converted to Task '; $lang->action->label->svncommited = 'committed SVN '; $lang->action->label->gitcommited = 'committed Git '; $lang->action->label->linked2plan = 'linked to Plan '; diff --git a/module/action/lang/zh-cn.php b/module/action/lang/zh-cn.php index 25c14d73ec..be06e0aedc 100755 --- a/module/action/lang/zh-cn.php +++ b/module/action/lang/zh-cn.php @@ -266,6 +266,7 @@ $lang->action->label->tostory = "转{$lang->SRCommon}"; $lang->action->label->frombug = "转{$lang->SRCommon}"; $lang->action->label->fromlib = '从用例库导入'; $lang->action->label->totask = '转任务'; +$lang->action->label->converttotask = '转任务'; $lang->action->label->svncommited = '提交代码'; $lang->action->label->gitcommited = '提交代码'; $lang->action->label->linked2plan = "关联计划"; diff --git a/module/bug/control.php b/module/bug/control.php index 3251ad07f6..3c23616300 100755 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -880,6 +880,8 @@ class bug extends control $product = $this->loadModel('product')->getByID($productID); $branches = $product->type == 'normal' ? array() : $this->loadModel('branch')->getPairs($bug->product); + $projects = $this->loadModel('product')->getProjectPairsByProduct($productID, $bug->branch); + $this->executeHooks($bugID); /* Header and positon. */ @@ -902,6 +904,8 @@ class bug extends control $this->view->preAndNext = $this->loadModel('common')->getPreAndNextObject('bug', $bugID); $this->view->product = $product; + $this->view->projects = array('' => '') + $projects; + $this->display(); } diff --git a/module/bug/js/view.js b/module/bug/js/view.js index a5038e130c..5226a3e3e4 100644 --- a/module/bug/js/view.js +++ b/module/bug/js/view.js @@ -7,3 +7,49 @@ $('#tostory').click(function() { if(!confirm(confrimToStory)) return false; }); + +/** + * Load Product executions in html. + * + * @param int productID + * @param int projectID + * @access public + * @return void + */ +function loadProductExecutions(productID, projectID) +{ + link = createLink('product', 'ajaxGetExecutions', 'productID=' + productID + '&projectID=' + projectID +'&branch=' + branchID + '&number=&executionID=0&from=bugToTask'); + + $('#executionBox').load(link, function() + { + $(this).find('select').chosen(); + }); +} + +$('#toTaskButton').on('click', function() +{ + var projectID = $('#taskProjects').val(); + var executionID = $('#execution').val(); + var executionID = executionID ? executionID : 0; + + if(systemMode == 'new' && projectID && executionID != 0) + { + $('#cancelButton').click(); + link = createLink('task', 'create', 'executionID=' + executionID + '&storyID=0&moduleID=0&taskID=0&todoID=0&extra=projectID=' + projectID + '&bugID=' + bugID); + window.parent.$.apps.open(link, 'execution'); + } + else if(systemMode == 'classic' && executionID) + { + $('#cancelButton').click(); + link = createLink('task', 'create', 'executionID=' + executionID + '&storyID=0&moduleID=0&taskID=0&todoID=0&extra=projectID=0&bugID=' + bugID); + window.parent.$.apps.open(link, 'execution'); + } + else if(executionID == 0) + { + alert(errorNoExecution); + } + else + { + alert(errorNoProject); + } +}); diff --git a/module/bug/lang/en.php b/module/bug/lang/en.php index 8c1957c244..9bb908524a 100644 --- a/module/bug/lang/en.php +++ b/module/bug/lang/en.php @@ -95,6 +95,10 @@ $lang->bug->toCase = 'To Case'; $lang->bug->colorTag = 'Color'; $lang->bug->fixedRate = 'Fixed Rate'; $lang->bug->noticefeedbackBy = 'NoticeFeedbackBy'; +$lang->bug->selectProjects = 'Select Projects'; +$lang->bug->nextStep = 'Next Step'; +$lang->bug->noProject = 'Haven’t chosen a project yet'; +$lang->bug->noExecution = 'Haven’t chosen a execution yet'; /* Method list. */ $lang->bug->index = 'Bug Home'; @@ -405,6 +409,7 @@ $lang->bug->action = new stdclass(); $lang->bug->action->resolved = array('main' => '$date, resolved by $actor and the resolution is $extra $appendLink.', 'extra' => 'resolutionList'); $lang->bug->action->tostory = array('main' => '$date, converted by $actor to Story with ID $extra.'); $lang->bug->action->totask = array('main' => '$date, imported by $actor as Task with ID $extra.'); +$lang->bug->action->converttotask = array('main' => '$date, imported by $actor as Task,with ID $extra。'); $lang->bug->action->linked2plan = array('main' => '$date, linked by $actor to Plan $extra.'); $lang->bug->action->unlinkedfromplan = array('main' => '$date, deleted by $actor from Plan $extra.'); $lang->bug->action->linked2build = array('main' => '$date, linked by $actor to Build $extra.'); diff --git a/module/bug/lang/zh-cn.php b/module/bug/lang/zh-cn.php index 52d5277a7c..1887709510 100644 --- a/module/bug/lang/zh-cn.php +++ b/module/bug/lang/zh-cn.php @@ -95,6 +95,10 @@ $lang->bug->toCase = '生成用例'; $lang->bug->colorTag = '颜色标签'; $lang->bug->fixedRate = '修复率'; $lang->bug->noticefeedbackBy = '通知反馈者'; +$lang->bug->selectProjects = '选择项目'; +$lang->bug->nextStep = '下一步'; +$lang->bug->noProject = '还没有选择项目!'; +$lang->bug->noExecution = '还没有选择执行!'; /* 方法列表。*/ $lang->bug->index = '首页'; @@ -405,6 +409,7 @@ $lang->bug->action = new stdclass(); $lang->bug->action->resolved = array('main' => '$date, 由 $actor 解决,方案为 $extra $appendLink。', 'extra' => 'resolutionList'); $lang->bug->action->tostory = array('main' => '$date, 由 $actor 转为 ' . $lang->SRCommon . ',编号为 $extra。'); $lang->bug->action->totask = array('main' => '$date, 由 $actor 导入为任务,编号为 $extra。'); +$lang->bug->action->converttotask = array('main' => '$date, 由 $actor 转为任务,编号为 $extra。'); $lang->bug->action->linked2plan = array('main' => '$date, 由 $actor 关联到计划 $extra。'); $lang->bug->action->unlinkedfromplan = array('main' => '$date, 由 $actor 从计划 $extra 移除。'); $lang->bug->action->linked2build = array('main' => '$date, 由 $actor 关联到版本 $extra。'); diff --git a/module/bug/model.php b/module/bug/model.php index 5e4d93c7cc..3a4f64f6ee 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -3385,6 +3385,7 @@ class bugModel extends model if($type == 'view' && $this->app->tab != 'product') { $menu .= $this->buildMenu('bug', 'toStory', $toStoryParams, $bug, $type, $this->lang->icons['story'], '', '', '', "data-app='product' id='tostory'", $this->lang->bug->toStory); + if(common::hasPriv('task', 'create')) $menu .= html::a('#toTask', "{$this->lang->bug->toTask}", '', "data-app='qa' data-toggle='modal' class='btn btn-link'"); $menu .= $this->buildMenu('bug', 'createCase', $convertParams, $bug, $type, 'sitemap'); } if($type == 'view') diff --git a/module/bug/view/view.html.php b/module/bug/view/view.html.php index d76011e701..5e954c876d 100644 --- a/module/bug/view/view.html.php +++ b/module/bug/view/view.html.php @@ -14,6 +14,12 @@ bug->confirmToStory);?> +systemMode);?> +tab);?> +id);?> +branch);?> +bug->noExecution);?> +bug->noProject);?> session->bugList ? $app->session->bugList : inlink('browse', "productID=$bug->product");?>