From 834660195392f6ed7ca1423891506c2f1f2f9b71 Mon Sep 17 00:00:00 2001 From: sunjun Date: Wed, 18 May 2022 05:07:58 +0000 Subject: [PATCH 01/44] sprint_sunjun_54322 --- module/my/control.php | 11 ++++++++++- module/my/lang/en.php | 1 + module/my/lang/zh-cn.php | 1 + module/my/view/requirement.html.php | 7 ++++--- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/module/my/control.php b/module/my/control.php index 3cf5216ea5..679741b9e5 100755 --- a/module/my/control.php +++ b/module/my/control.php @@ -350,6 +350,7 @@ EOF; public function requirement($type = 'assignedTo', $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1) { /* Save session. */ + $this->loadModel('story'); if($this->app->viewType != 'json') $this->session->set('storyList', $this->app->getURI(true), 'my'); /* Load pager. */ @@ -360,7 +361,15 @@ EOF; /* Append id for secend sort. */ $sort = common::appendOrder($orderBy); - $stories = $this->loadModel('story')->getUserStories($this->app->user->account, $type, $sort, $pager, 'requirement'); + if($type == 'assignedBy') + { + $stories = $this->loadModel('my')->getAssignedByMe($this->app->user->account, '', $pager, $orderBy, '', 'story'); + } + else + { + $stories = $this->getUserStories($this->app->user->account, $type, $sort, $pager, 'requirement'); + } + if(!empty($stories)) $stories = $this->story->mergeReviewer($stories); /* Assign. */ diff --git a/module/my/lang/en.php b/module/my/lang/en.php index f97a214255..a8a1c61bcf 100644 --- a/module/my/lang/en.php +++ b/module/my/lang/en.php @@ -74,6 +74,7 @@ $lang->my->storyMenu->reviewByMe = 'ReviewByMe'; $lang->my->storyMenu->openedByMe = 'CreatedByMe'; $lang->my->storyMenu->reviewedByMe = 'ReviewedByMe'; $lang->my->storyMenu->closedByMe = 'ClosedByMe'; +$lang->my->storyMenu->assignedByMe = 'AssignedByMe'; $lang->my->projectMenu = new stdclass(); $lang->my->projectMenu->doing = 'Doing'; diff --git a/module/my/lang/zh-cn.php b/module/my/lang/zh-cn.php index 763e49b434..8a59dfb2ca 100644 --- a/module/my/lang/zh-cn.php +++ b/module/my/lang/zh-cn.php @@ -74,6 +74,7 @@ $lang->my->storyMenu->reviewByMe = '待我评审'; $lang->my->storyMenu->openedByMe = '由我创建'; $lang->my->storyMenu->reviewedByMe = '由我评审'; $lang->my->storyMenu->closedByMe = '由我关闭'; +$lang->my->storyMenu->assignedByMe = '由我指派'; $lang->my->projectMenu = new stdclass(); $lang->my->projectMenu->doing = '进行中'; diff --git a/module/my/view/requirement.html.php b/module/my/view/requirement.html.php index 0cbe9bc1eb..7db6b3d34f 100644 --- a/module/my/view/requirement.html.php +++ b/module/my/view/requirement.html.php @@ -20,9 +20,10 @@ $recTotalLabel = " {$pager->recTotal}"; if($app->rawMethod == 'contribute') { - echo html::a(inlink($app->rawMethod, "mode=requirement&type=openedBy&orderBy=$orderBy&recTotal=$recTotal&recPerPage=$recPerPage&pagerID=$pageID"), "{$lang->my->storyMenu->openedByMe}" . ($type == 'openedBy' ? $recTotalLabel : ''), '', "class='btn btn-link" . ($type == 'openedBy' ? ' btn-active-text' : '') . "'"); - echo html::a(inlink($app->rawMethod, "mode=requirement&type=reviewedBy&orderBy=$orderBy&recTotal=$recTotal&recPerPage=$recPerPage&pagerID=$pageID"), "{$lang->my->storyMenu->reviewedByMe}" . ($type == 'reviewedBy' ? $recTotalLabel : ''), '', "class='btn btn-link" . ($type == 'reviewedBy' ? ' btn-active-text' : '') . "'"); - echo html::a(inlink($app->rawMethod, "mode=requirement&type=closedBy&&orderBy=$orderBy&recTotal=$recTotal&recPerPage=$recPerPage&pagerID=$pageID"), "{$lang->my->storyMenu->closedByMe}" . ($type == 'closedBy' ? $recTotalLabel : ''), '', "class='btn btn-link" . ($type == 'closedBy' ? ' btn-active-text' : '') . "'"); + echo html::a(inlink($app->rawMethod, "mode=requirement&type=openedBy&orderBy=$orderBy&recTotal=$recTotal&recPerPage=$recPerPage&pagerID=$pageID"), "{$lang->my->storyMenu->openedByMe}" . ($type == 'openedBy' ? $recTotalLabel : ''), '', "class='btn btn-link" . ($type == 'openedBy' ? ' btn-active-text' : '') . "'"); + echo html::a(inlink($app->rawMethod, "mode=requirement&type=reviewedBy&orderBy=$orderBy&recTotal=$recTotal&recPerPage=$recPerPage&pagerID=$pageID"), "{$lang->my->storyMenu->reviewedByMe}" . ($type == 'reviewedBy' ? $recTotalLabel : ''), '', "class='btn btn-link" . ($type == 'reviewedBy' ? ' btn-active-text' : '') . "'"); + echo html::a(inlink($app->rawMethod, "mode=requirement&type=closedBy&&orderBy=$orderBy&recTotal=$recTotal&recPerPage=$recPerPage&pagerID=$pageID"), "{$lang->my->storyMenu->closedByMe}" . ($type == 'closedBy' ? $recTotalLabel : ''), '', "class='btn btn-link" . ($type == 'closedBy' ? ' btn-active-text' : '') . "'"); + echo html::a(inlink($app->rawMethod, "mode=requirement&type=assignedBy&&orderBy=$orderBy&recTotal=$recTotal&recPerPage=$recPerPage&pagerID=$pageID"), "{$lang->my->storyMenu->assignedByMe}" . ($type == 'assignedBy' ? $recTotalLabel : ''), '', "class='btn btn-link" . ($type == 'assignedBy' ? ' btn-active-text' : '') . "'"); } else { From b59fb9cc1c035522d8611f4afe99297fa7c7d32b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E5=8D=8E=E4=BC=9F?= Date: Wed, 18 May 2022 13:43:48 +0800 Subject: [PATCH 02/44] *Fix bug#22616. --- module/execution/view/edit.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/execution/view/edit.html.php b/module/execution/view/edit.html.php index 6172a701b8..d8cb0e613b 100644 --- a/module/execution/view/edit.html.php +++ b/module/execution/view/edit.html.php @@ -25,7 +25,7 @@
- systemMode == 'new'):?> + systemMode == 'new' and isset($project) and $project->model == 'scrum'):?> From 6be752163d01ce619231e8bf573d2f0ca94e84ec Mon Sep 17 00:00:00 2001 From: sunjun Date: Wed, 18 May 2022 05:56:39 +0000 Subject: [PATCH 03/44] sprint_sunjun_54322 --- module/my/control.php | 2 +- module/my/model.php | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/module/my/control.php b/module/my/control.php index 679741b9e5..6f0a05fbba 100755 --- a/module/my/control.php +++ b/module/my/control.php @@ -367,7 +367,7 @@ EOF; } else { - $stories = $this->getUserStories($this->app->user->account, $type, $sort, $pager, 'requirement'); + $stories = $this->loadModel('story')->getUserStories($this->app->user->account, $type, $sort, $pager, 'requirement'); } if(!empty($stories)) $stories = $this->story->mergeReviewer($stories); diff --git a/module/my/model.php b/module/my/model.php index 7ab57208a6..9fe9826c1a 100644 --- a/module/my/model.php +++ b/module/my/model.php @@ -325,7 +325,7 @@ class myModel extends model public function getAssignedByMe($account, $limit = 0, $pager = null, $orderBy = "id_desc", $projectID = 0, $objectType = '') { $this->loadModel($objectType); - $objectList = $this->dao->select('t1.*') + $objectList = $this->dao->select('DISTINCT t1.*') ->from($this->config->objectTables[$objectType])->alias('t1') ->leftJoin(TABLE_ACTION)->alias('t2')->on("t1.id = t2.objectID and t2.objectType='{$objectType}'") ->where('t2.actor')->eq($account) @@ -358,7 +358,13 @@ class myModel extends model $productPairs = $this->dao->select('id,name')->from(TABLE_PRODUCT)->where('id')->in($productList)->fetchPairs('id'); foreach($objectList as $bug) $bug->productName = zget($productPairs, $bug->product); } - + if($objectType == 'story') + { + $productList = array(); + foreach($objectList as $story) $productList[$story->product] = $story->product; + $productPairs = $this->dao->select('id,name')->from(TABLE_PRODUCT)->where('id')->in($productList)->fetchPairs('id'); + foreach($objectList as $story) $story->productTitle = zget($productPairs, $story->product); + } return $objectList; } } From 587bc3c41422ebc6757cccde0def3620ad200248 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E5=8D=8E=E4=BC=9F?= Date: Wed, 18 May 2022 14:48:09 +0800 Subject: [PATCH 04/44] *Fix bug #22621. --- module/task/js/recordestimate.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/module/task/js/recordestimate.js b/module/task/js/recordestimate.js index 1237816baf..385f117b95 100644 --- a/module/task/js/recordestimate.js +++ b/module/task/js/recordestimate.js @@ -8,7 +8,15 @@ $(function() { if($(this).val() !== '') left = $(this).val(); }); - if(left === '0') return confirm(confirmRecord); + if(left == '0') + { + var confirmMsg = confirm(confirmRecord); + if(confirmMsg == false) + { + $('#submit').attr("disabled",false); + return false; + } + } }); $('#recordForm .showinonlybody').each(function() From aa0b81f0a68d5bbe349cb3205d3ac1c750762467 Mon Sep 17 00:00:00 2001 From: mayue Date: Wed, 18 May 2022 07:19:19 +0000 Subject: [PATCH 05/44] * Fix bug #22246. --- lib/base/filter/filter.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/base/filter/filter.class.php b/lib/base/filter/filter.class.php index 8db2523369..fda784c2a2 100644 --- a/lib/base/filter/filter.class.php +++ b/lib/base/filter/filter.class.php @@ -661,11 +661,11 @@ class baseValidater global $config; if(empty($config->framework->filterXSS)) return $var; - if(stripos($var, ' Date: Wed, 18 May 2022 07:31:45 +0000 Subject: [PATCH 06/44] * Finish task #54351. --- module/datatable/config.php | 2 + module/project/control.php | 79 ++++++++++++++++++----- module/project/view/bug.html.php | 106 ++++++++++++------------------- 3 files changed, 105 insertions(+), 82 deletions(-) diff --git a/module/datatable/config.php b/module/datatable/config.php index 99efa085bf..fb535f0f36 100644 --- a/module/datatable/config.php +++ b/module/datatable/config.php @@ -3,3 +3,5 @@ $config->datatable->moduleAlias['product-browse'] = 'story'; $config->datatable->moduleAlias['execution-task'] = 'task'; $config->datatable->moduleAlias['testtask-cases'] = 'testcase'; $config->datatable->moduleAlias['program-project'] = 'project'; +$config->datatable->moduleAlias['project-bug'] = 'bug'; +$config->datatable->moduleAlias['execution-bug'] = 'bug'; diff --git a/module/project/control.php b/module/project/control.php index bb048bcf56..3f0e298bd2 100644 --- a/module/project/control.php +++ b/module/project/control.php @@ -971,11 +971,13 @@ class project extends control $this->loadModel('bug'); $this->loadModel('user'); $this->loadModel('product'); + $this->loadModel('datatable'); /* Save session. */ $this->session->set('bugList', $this->app->getURI(true), 'project'); $this->project->setMenu($projectID); + $product = $this->product->getById($productID); $project = $this->project->getByID($projectID); $type = strtolower($type); $queryID = ($type == 'bysearch') ? (int)$param : 0; @@ -983,7 +985,7 @@ class project extends control $branchID = isset($products[$productID]) ? current($products[$productID]->branches) : 0; $productPairs = array('0' => $this->lang->product->all); - foreach($products as $product) $productPairs[$product->id] = $product->name; + foreach($products as $productData) $productPairs[$productData->id] = $productData->name; $this->lang->modulePageNav = $this->product->select($productPairs, $productID, 'project', 'bug', '', $branchID, 0, '', false); /* Header and position. */ @@ -991,6 +993,8 @@ class project extends control $position[] = html::a($this->createLink('project', 'browse', "projectID=$projectID"), $project->name); $position[] = $this->lang->bug->common; + $executions = $this->loadModel('execution')->getPairs($projectID, 'all', 'empty|withdelete'); + /* Load pager and get bugs, user. */ $this->app->loadClass('pager', $static = true); $pager = new pager($recTotal, $recPerPage, $pageID); @@ -1008,22 +1012,65 @@ class project extends control $actionURL = $this->createLink('project', 'bug', "projectID=$projectID&productID=$productID&orderBy=$orderBy&build=$build&type=bysearch&queryID=myQueryID"); $this->loadModel('execution')->buildBugSearchForm($products, $queryID, $actionURL, 'project'); + $showBranch = false; + $branchOption = array(); + $branchTagOption = array(); + if($product and $product->type != 'normal') + { + /* Display of branch label. */ + $showBranch = $this->loadModel('branch')->showBranch($productID); + + /* Display status of branch. */ + $branches = $this->loadModel('branch')->getList($productID, 0, 'all'); + foreach($branches as $branchInfo) + { + $branchOption[$branchInfo->id] = $branchInfo->name; + $branchTagOption[$branchInfo->id] = $branchInfo->name . ($branchInfo->status == 'closed' ? ' (' . $this->lang->branch->statusList['closed'] . ')' : ''); + } + } + + $showModule = !empty($this->config->datatable->bugBrowse->showModule) ? $this->config->datatable->bugBrowse->showModule : ''; + + $storyIdList = $taskIdList = array(); + a($bugs); + foreach($bugs as $bug) + { + if($bug->story) $storyIdList[$bug->story] = $bug->story; + if($bug->task) $taskIdList[$bug->task] = $bug->task; + if($bug->toTask) $taskIdList[$bug->toTask] = $bug->toTask; + } + $storyList = $storyIdList ? $this->loadModel('story')->getByList($storyIdList) : array(); + $taskList = $taskIdList ? $this->loadModel('task')->getByList($taskIdList) : array(); + /* Assign. */ - $this->view->title = $title; - $this->view->position = $position; - $this->view->bugs = $bugs; - $this->view->tabID = 'bug'; - $this->view->build = $this->loadModel('build')->getById($build); - $this->view->buildID = $this->view->build ? $this->view->build->id : 0; - $this->view->pager = $pager; - $this->view->orderBy = $orderBy; - $this->view->users = $users; - $this->view->productID = $productID; - $this->view->project = $this->project->getById($projectID); - $this->view->branchID = empty($this->view->build->branch) ? $branchID : $this->view->build->branch; - $this->view->memberPairs = $memberPairs; - $this->view->type = $type; - $this->view->param = $param; + $this->view->title = $title; + $this->view->position = $position; + $this->view->bugs = $bugs; + $this->view->tabID = 'bug'; + $this->view->build = $this->loadModel('build')->getById($build); + $this->view->buildID = $this->view->build ? $this->view->build->id : 0; + $this->view->pager = $pager; + $this->view->orderBy = $orderBy; + $this->view->users = $users; + $this->view->productID = $productID; + $this->view->project = $this->project->getById($projectID); + $this->view->branchID = empty($this->view->build->branch) ? $branchID : $this->view->build->branch; + $this->view->memberPairs = $memberPairs; + $this->view->type = $type; + $this->view->param = $param; + $this->view->builds = $this->loadModel('build')->getBuildPairs($productID); + $this->view->users = $this->user->getPairs('noletter'); + $this->view->memberPairs = $this->user->getPairs('noletter|noclosed'); + $this->view->openedBuilds = $this->build->getBuildPairs($productID, $bug->branch, 'noempty,noterminate,nodone,withbranch', $projectID, 'project'); + $this->view->branchOption = $branchOption; + $this->view->branchTagOption = $branchTagOption; + $this->view->executions = $executions; + $this->view->modulePairs = $showModule ? $this->tree->getModulePairs($productID, 'bug', $showModule) : array(); + $this->view->plans = $this->loadModel('productplan')->getPairs($productID); + $this->view->stories = $storyList; + $this->view->tasks = $taskList; + $this->view->projectPairs = $this->project->getPairsByProgram(); + $this->display(); } diff --git a/module/project/view/bug.html.php b/module/project/view/bug.html.php index 10461b58c3..7f20454148 100644 --- a/module/project/view/bug.html.php +++ b/module/project/view/bug.html.php @@ -11,6 +11,7 @@ */ ?> + + + +
execution->projectName;?> project, "class='form-control chosen' onchange='changeProject(this.value)' required");?>
- - +
+ - - > + + + getClientLang() != 'zh-cn' and $app->getClientLang() !== 'zh-tw') ? ' ': '';?> + + + + + + + + + + + + + + + + + + > - > @@ -231,6 +264,42 @@ EOT; + + +
custom->storyReview;?> custom->reviewList, $needReview);?>
custom->notice->forceReview, $lang->$module->common) . $lang->custom->notice->storyReviewTip;?>
custom->forceReview . $space . $lang->custom->account;?> + $lang->custom->allUsers), $forceReviewAll);?> + +
custom->forceReview . $space . $lang->custom->role;?>user->roleList, $forceReviewRoles, "class='form-control chosen' multiple");?>
custom->forceReview . $space . $lang->custom->dept;?>
custom->forceReview;?> custom->notice->forceReview, $lang->$module->common);?>
custom->forceNotReview;?>