From a24c58482ed1957918cf482c1c8ed122dde8d980 Mon Sep 17 00:00:00 2001 From: holan20180123 <56391770@qq.com> Date: Fri, 19 Mar 2021 09:02:01 +0800 Subject: [PATCH 01/27] * Fix get bug tree error. --- module/tree/model.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/module/tree/model.php b/module/tree/model.php index 2a6b8f9e78..2b6ba00adf 100644 --- a/module/tree/model.php +++ b/module/tree/model.php @@ -636,11 +636,6 @@ class treeModel extends model if($startModule) $startModulePath = $startModule->path . '%'; } - $manage = $userFunc[1] == 'createBugLink' ? true : false; - - /* if not manage, only get linked modules and ignore others. */ - if(!$manage) $executionModules = $this->getBugTreeModules($rootID, true); - /* Get module according to product. */ $productNum = count($products); foreach($products as $id => $product) From a805f958b895cffe539ae9c2466f3dadc4a9db3b Mon Sep 17 00:00:00 2001 From: tianshujie98 Date: Fri, 19 Mar 2021 10:35:18 +0800 Subject: [PATCH 02/27] * Modify the method of linking products when creating a build. --- module/build/lang/de.php | 2 +- module/build/lang/en.php | 2 +- module/build/lang/fr.php | 2 +- module/build/lang/vi.php | 2 +- module/build/lang/zh-cn.php | 2 +- module/build/view/create.html.php | 3 +-- module/execution/control.php | 1 + module/product/control.php | 4 ++-- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/module/build/lang/de.php b/module/build/lang/de.php index b0b86e3e36..8f68f4650b 100644 --- a/module/build/lang/de.php +++ b/module/build/lang/de.php @@ -45,7 +45,7 @@ $lang->build->unlinkBug = 'Bug Verknüpgung aufheben'; $lang->build->stories = "Abgeschlossene {$lang->SRCommon}"; $lang->build->bugs = 'Gelöster Bug'; $lang->build->generatedBugs = 'Left Bug'; -$lang->build->noProduct = " Dieses {$lang->executionCommon} ist nicht mit einem {$lang->productCommon} verknüpft, daher kann das Build nicht erstellt werden. Bitte erst {$lang->productCommon} verknüpfen."; +$lang->build->noProduct = " Dieses {$lang->executionCommon} ist nicht mit einem {$lang->productCommon} verknüpft, daher kann das Build nicht erstellt werden. Bitte erst {$lang->productCommon} verknüpfen."; $lang->build->noBuild = 'Keine Builds. '; $lang->build->notice = new stdclass(); diff --git a/module/build/lang/en.php b/module/build/lang/en.php index d8212d1511..d88c3855f5 100644 --- a/module/build/lang/en.php +++ b/module/build/lang/en.php @@ -45,7 +45,7 @@ $lang->build->unlinkBug = 'Unlink Bug'; $lang->build->stories = "Finished {$lang->SRCommon}"; $lang->build->bugs = 'Resolved Bugs'; $lang->build->generatedBugs = 'Reported Bugs'; -$lang->build->noProduct = " This {$lang->executionCommon} is not linked to {$lang->productCommon}, so the Build cannot be created. Please first link {$lang->productCommon}"; +$lang->build->noProduct = " This {$lang->executionCommon} is not linked to {$lang->productCommon}, so the Build cannot be created. Please first link {$lang->productCommon}"; $lang->build->noBuild = 'No builds yet.'; $lang->build->notice = new stdclass(); diff --git a/module/build/lang/fr.php b/module/build/lang/fr.php index c1ae861a86..c8bc850f73 100644 --- a/module/build/lang/fr.php +++ b/module/build/lang/fr.php @@ -45,7 +45,7 @@ $lang->build->unlinkBug = 'Retirer Bug'; $lang->build->stories = 'Stories terminées'; $lang->build->bugs = 'Bugs Résolus'; $lang->build->generatedBugs = 'Bugs signalés'; -$lang->build->noProduct = " Ce {$lang->executionCommon} n'est pas associé à un {$lang->productCommon}, le Build ne peut pas être créé. Commencez par rattacher le projet à un {$lang->productCommon}"; +$lang->build->noProduct = " Ce {$lang->executionCommon} n'est pas associé à un {$lang->productCommon}, le Build ne peut pas être créé. Commencez par rattacher le projet à un {$lang->productCommon}"; $lang->build->noBuild = 'Aucun builds.'; $lang->build->notice = new stdclass(); diff --git a/module/build/lang/vi.php b/module/build/lang/vi.php index db54213729..adf75db272 100644 --- a/module/build/lang/vi.php +++ b/module/build/lang/vi.php @@ -45,7 +45,7 @@ $lang->build->unlinkBug = 'Hủy liên kết Bug'; $lang->build->stories = "{$lang->SRCommon} đã kết thúc"; $lang->build->bugs = 'Bugs đã giải quyết'; $lang->build->generatedBugs = 'Bugs đã báo cáo'; -$lang->build->noProduct = " {$lang->executionCommon} này chưa liên kết tới {$lang->productCommon}, bởi vậy Bản dựng này không thể tạo. Vui lòng liên kết {$lang->productCommon} trước"; +$lang->build->noProduct = " {$lang->executionCommon} này chưa liên kết tới {$lang->productCommon}, bởi vậy Bản dựng này không thể tạo. Vui lòng liên kết {$lang->productCommon} trước"; $lang->build->noBuild = 'Không có bản dựng nào'; $lang->build->notice = new stdclass(); diff --git a/module/build/lang/zh-cn.php b/module/build/lang/zh-cn.php index d62cd8e7dc..82ae8b7752 100644 --- a/module/build/lang/zh-cn.php +++ b/module/build/lang/zh-cn.php @@ -45,7 +45,7 @@ $lang->build->unlinkBug = '移除Bug'; $lang->build->stories = "完成的{$lang->SRCommon}"; $lang->build->bugs = '解决的Bug'; $lang->build->generatedBugs = '产生的Bug'; -$lang->build->noProduct = " 该{$lang->executionCommon}没有关联{$lang->productCommon},无法创建版本,请先关联{$lang->productCommon}"; +$lang->build->noProduct = " 该{$lang->executionCommon}没有关联{$lang->productCommon},无法创建版本,请先关联{$lang->productCommon}"; $lang->build->noBuild = '暂时没有版本。'; $lang->build->notice = new stdclass(); diff --git a/module/build/view/create.html.php b/module/build/view/create.html.php index 40bc75208c..8c96ae8156 100644 --- a/module/build/view/create.html.php +++ b/module/build/view/create.html.php @@ -40,11 +40,10 @@ ?> -
- build->noProduct, $this->createLink('execution', 'manageproducts', "executionID=$executionID&from=buildCreate"), $openApp);?> + build->noProduct, $this->createLink('execution', 'manageproducts', "executionID=$executionID&from=buildCreate", '', 'true'), $openApp);?>
diff --git a/module/execution/control.php b/module/execution/control.php index 4d3c699636..4f44edaac5 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -2090,6 +2090,7 @@ class execution extends control $diffProducts = array_merge(array_diff($oldProducts, $newProducts), array_diff($newProducts, $oldProducts)); if($diffProducts) $this->loadModel('action')->create($this->objectType, $executionID, 'Managed', '', !empty($_POST['products']) ? join(',', $_POST['products']) : ''); + if(isonlybody()) die(js::reload('parent')); die(js::locate($browseExecutionLink)); } diff --git a/module/product/control.php b/module/product/control.php index 1bef8db7f9..38de9e5cf7 100644 --- a/module/product/control.php +++ b/module/product/control.php @@ -818,10 +818,10 @@ class product extends control $products = $this->product->getProductPairsByProject($executionID); if(empty($products)) { - die(printf($this->lang->build->noProduct, $this->createLink('execution', 'manageproducts', "executionID=$executionID&from=buildCreate"), 'project')); + die(printf($this->lang->build->noProduct, $this->createLink('execution', 'manageproducts', "executionID=$executionID&from=buildCreate", '', 'true'), 'project')); } - die(html::select('product', $products, empty($product) ? '' : $product->id, "onchange='loadBranches(this.value);' class='form-control chosen' required")); + die(html::select('product', $products, empty($product) ? '' : $product->id, "onchange='loadBranches(this.value);' class='form-control chosen' required data-toggle='modal' data-type='iframe'")); } /** From b5434ed7707be09582944e2ccbc334fe64f6b095 Mon Sep 17 00:00:00 2001 From: holan20180123 <56391770@qq.com> Date: Fri, 19 Mar 2021 10:49:08 +0800 Subject: [PATCH 03/27] * Refresh block when finished todo. --- module/bug/control.php | 14 ++++++++++++++ module/bug/js/create.js | 4 ++++ module/bug/view/create.html.php | 1 + module/story/control.php | 13 +++++++++++++ module/story/js/create.js | 4 ++++ module/story/view/create.html.php | 1 + module/task/control.php | 13 +++++++++++++ module/task/js/create.js | 4 ++++ module/task/view/create.html.php | 1 + 9 files changed, 55 insertions(+) diff --git a/module/bug/control.php b/module/bug/control.php index 65a3f1e459..528b8d46b5 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -455,6 +455,7 @@ class bug extends control { $builds = $this->loadModel('build')->getExecutionBuildPairs($executionID, $productID, $branch, 'noempty,noterminate,nodone'); $stories = $this->story->getExecutionStoryPairs($executionID); + if(!$projectID) $projectID = $this->dao->select('project')->from(TABLE_EXECUTION)->where('id')->eq($executionID)->fetch('project'); } else { @@ -496,6 +497,18 @@ class bug extends control $projects += $this->product->getProjectPairsByProduct($productID, $branch); } + /* Get block id of assinge to me. */ + $blockID = 0; + if(isonlybody()) + { + $blockID = $this->dao->select('id')->from(TABLE_BLOCK) + ->where('block')->eq('assingtome') + ->andWhere('module')->eq('my') + ->andWhere('account')->eq($this->app->user->account) + ->orderBy('order_desc') + ->fetch('id'); + } + /* Get executions. */ $executions = array('' => ''); if(isset($projects[$projectID])) $executions += $this->product->getExecutionPairsByProduct($productID, $branch ? "0,$branch" : 0, 'id_desc', $projectID); @@ -541,6 +554,7 @@ class bug extends control $this->view->type = $type; $this->view->branch = $branch; $this->view->branches = $branches; + $this->view->blockID = $blockID; $this->view->color = $color; $this->view->stepsRequired = strpos($this->config->bug->create->requiredFields, 'steps'); $this->view->isStepsTemplate = $steps == $this->lang->bug->tplStep . $this->lang->bug->tplResult . $this->lang->bug->tplExpect ? true : false; diff --git a/module/bug/js/create.js b/module/bug/js/create.js index aa402fd61a..1e6ce04b0c 100644 --- a/module/bug/js/create.js +++ b/module/bug/js/create.js @@ -144,3 +144,7 @@ $(function() } }); }); + +$(window).unload(function(){ + if(blockID) window.parent.refreshBlock($('#block' + blockID)); +}); diff --git a/module/bug/view/create.html.php b/module/bug/view/create.html.php index d42be5ddbd..ec63fba5a6 100644 --- a/module/bug/view/create.html.php +++ b/module/bug/view/create.html.php @@ -24,6 +24,7 @@ js::set('stepsRequired', $stepsRequired); js::set('stepsNotEmpty', $lang->bug->stepsNotEmpty); js::set('isStepsTemplate', $isStepsTemplate); js::set('oldProjectID', $projectID); +js::set('blockID', $blockID); ?>
diff --git a/module/story/control.php b/module/story/control.php index bef59542f5..b458382484 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -267,6 +267,18 @@ class story extends control } } + /* Get block id of assinge to me. */ + $blockID = 0; + if(isonlybody()) + { + $blockID = $this->dao->select('id')->from(TABLE_BLOCK) + ->where('block')->eq('assingtome') + ->andWhere('module')->eq('my') + ->andWhere('account')->eq($this->app->user->account) + ->orderBy('order_desc') + ->fetch('id'); + } + /* Set Custom. */ foreach(explode(',', $this->config->story->list->customCreateFields) as $field) $customFields[$field] = $this->lang->story->$field; $this->view->customFields = $customFields; @@ -297,6 +309,7 @@ class story extends control $this->view->verify = $verify; $this->view->keywords = $keywords; $this->view->mailto = $mailto; + $this->view->blockID = $blockID; $this->view->URS = $type == 'story' ? $this->story->getRequierements($productID) : ''; $this->view->needReview = ($this->app->user->account == $product->PO || $executionID > 0 || $this->config->story->needReview == 0) ? "checked='checked'" : ""; $this->view->type = $type; diff --git a/module/story/js/create.js b/module/story/js/create.js index 22cce69ff6..dcd3dd2c56 100644 --- a/module/story/js/create.js +++ b/module/story/js/create.js @@ -21,3 +21,7 @@ function refreshPlan() { $('a.refresh').click(); } + +$(window).unload(function(){ + if(blockID) window.parent.refreshBlock($('#block' + blockID)); +}); diff --git a/module/story/view/create.html.php b/module/story/view/create.html.php index 04fdee8ca2..8e367acfbe 100644 --- a/module/story/view/create.html.php +++ b/module/story/view/create.html.php @@ -12,6 +12,7 @@ ?> story->placeholder); ?> + diff --git a/module/task/control.php b/module/task/control.php index 716aa93ec3..8b03e21a5a 100644 --- a/module/task/control.php +++ b/module/task/control.php @@ -192,6 +192,18 @@ class task extends control } $stories = $this->story->getExecutionStoryPairs($executionID, 0, 0, $moduleIdList, 'full', 'unclosed'); + /* Get block id of assinge to me. */ + $blockID = 0; + if(isonlybody()) + { + $blockID = $this->dao->select('id')->from(TABLE_BLOCK) + ->where('block')->eq('assingtome') + ->andWhere('module')->eq('my') + ->andWhere('account')->eq($this->app->user->account) + ->orderBy('order_desc') + ->fetch('id'); + } + $title = $execution->name . $this->lang->colon . $this->lang->task->create; $position[] = html::a($taskLink, $execution->name); $position[] = $this->lang->task->common; @@ -214,6 +226,7 @@ class task extends control $this->view->stories = $stories; $this->view->testStoryIdList = $this->loadModel('story')->getTestStories(array_keys($stories), $execution->id); $this->view->members = $members; + $this->view->blockID = $blockID; $this->view->moduleOptionMenu = $moduleOptionMenu; $this->display(); } diff --git a/module/task/js/create.js b/module/task/js/create.js index 84453be652..3eaad47266 100644 --- a/module/task/js/create.js +++ b/module/task/js/create.js @@ -474,3 +474,7 @@ $('#modalTeam .btn').click(function() $('#estimate').val(time); }) }); + +$(window).unload(function(){ + if(blockID) window.parent.refreshBlock($('#block' + blockID)); +}); diff --git a/module/task/view/create.html.php b/module/task/view/create.html.php index 90ed3392ba..4786cb8a30 100644 --- a/module/task/view/create.html.php +++ b/module/task/view/create.html.php @@ -14,6 +14,7 @@ id));?> +
From eda33b8a78040f91c89856b41ef67fbe25933b05 Mon Sep 17 00:00:00 2001 From: Yagami <976204163@qq.com> Date: Fri, 19 Mar 2021 10:59:54 +0800 Subject: [PATCH 04/27] * Fix menu. --- module/common/lang/zh-cn.php | 50 +++++------------------ module/story/control.php | 11 ++--- module/testtask/control.php | 1 + module/testtask/view/browseunits.html.php | 2 + 4 files changed, 17 insertions(+), 47 deletions(-) diff --git a/module/common/lang/zh-cn.php b/module/common/lang/zh-cn.php index e204f17fd2..f3459a0c53 100644 --- a/module/common/lang/zh-cn.php +++ b/module/common/lang/zh-cn.php @@ -383,19 +383,18 @@ $lang->qa->menu = new stdclass(); $lang->qa->menu->index = array('link' => '仪表盘|qa|index'); $lang->qa->menu->bug = array('link' => 'Bug|bug|browse|productID=%s', 'alias' => 'view,create,batchcreate,edit,resolve,close,activate,report,batchedit,batchactivate,confirmbug,assignto'); $lang->qa->menu->testcase = array('link' => '用例|testcase|browse|productID=%s', 'subModule' => 'testsuite,caselib', 'class' => 'dropdown dropdown-hover'); -$lang->qa->menu->testtask = array('link' => '测试单|testtask|browse|productID=%s', 'alias' => 'view,create,edit,linkcase,cases,start,close,batchrun,groupcase,report,importunitresult', 'class' => 'dropdown dropdown-hover'); +$lang->qa->menu->testtask = array('link' => '测试单|testtask|browse|productID=%s', 'subModule' => 'testreport', 'class' => 'dropdown dropdown-hover'); $lang->qa->menu->automation = array('link' => '自动化|automation|browse|productID=%s', 'alias' => '', 'class' => 'dropdown dropdown-hover'); $lang->qa->subMenu = new stdclass(); $lang->qa->subMenu->testcase = new stdclass(); -$lang->qa->subMenu->testcase->feature = array('link' => '功能测试|testcase|browse|productID=%s', 'subModule' => 'testcase,tree,story'); -$lang->qa->subMenu->testcase->unit = array('link' => '单元测试|testtask|browseUnits|productID=%s', 'alias' => 'browseunits'); +$lang->qa->subMenu->testcase->feature = array('link' => '用例|testcase|browse|productID=%s', 'subModule' => 'testcase,tree,story,testtask'); $lang->qa->subMenu->testcase->testsuite = array('link' => '套件|testsuite|browse|productID=%s', 'subModule' => 'testsuite'); $lang->qa->subMenu->testcase->caselib = array('link' => '用例库|caselib|browse|libID=0'); $lang->qa->subMenu->testtask = new stdclass(); $lang->qa->subMenu->testtask->testtask = array('link' => '测试单|testtask|browse|productID=%s', 'alias' => 'view,create,edit,linkcase,cases,start,close,batchrun,groupcase,report,importunitresult'); -$lang->qa->subMenu->testtask->report = array('link' => '报告|testreport|browse|productID=%s', 'alias' => 'view,create,edit'); +$lang->qa->subMenu->testtask->report = array('link' => '报告|testreport|browse|productID=%s', 'alias' => 'view,edit'); $lang->qa->subMenu->automation = new stdclass(); $lang->qa->subMenu->automation->browse = array('link' => '介绍|automation|browse|productID=%s', 'alias' => ''); @@ -406,67 +405,38 @@ $lang->qa->subMenu->automation->browse = array('link' => '介绍|automation $lang->bug = new stdclass(); $lang->bug->menu = new stdclass(); +$lang->bug->menu = $lang->qa->menu; $lang->bug->subMenu = $lang->qa->subMenu; -$lang->bug->menu->index = array('link' => '仪表盘|qa|index'); -$lang->bug->menu->bug = array('link' => 'Bug|bug|browse|productID=%s', 'alias' => 'view,create,batchcreate,edit,resolve,close,activate,report,batchedit,batchactivate,confirmbug,assignto', 'subModule' => 'tree'); -$lang->bug->menu->testcase = array('link' => '用例|testcase|browse|productID=%s', 'class' => 'dropdown dropdown-hover'); -$lang->bug->menu->testtask = array('link' => '测试单|testtask|browse|productID=%s', 'class' => 'dropdown dropdown-hover'); -$lang->bug->menu->automation = array('link' => '自动化|automation|browse|productID=%s', 'alias' => '', 'class' => 'dropdown dropdown-hover'); - $lang->testcase = new stdclass(); $lang->testcase->menu = new stdclass(); +$lang->testcase->menu = $lang->qa->menu; $lang->testcase->subMenu = $lang->qa->subMenu; -$lang->testcase->menu->index = array('link' => '仪表盘|qa|index'); -$lang->testcase->menu->bug = array('link' => 'Bug|bug|browse|productID=%s'); -$lang->testcase->menu->testcase = array('link' => '用例|testcase|browse|productID=%s', 'alias' => 'view,create,batchcreate,edit,batchedit,showimport,groupcase,importfromlib', 'subModule' => 'tree,story', 'class' => 'dropdown dropdown-hover'); -$lang->testcase->menu->testtask = array('link' => '测试单|testtask|browse|productID=%s', 'class' => 'dropdown dropdown-hover'); -$lang->testcase->menu->automation = array('link' => '自动化|automation|browse|productID=%s', 'alias' => '', 'class' => 'dropdown dropdown-hover'); $lang->testtask = new stdclass(); $lang->testtask->menu = new stdclass(); +$lang->testtask->menu = $lang->qa->menu; $lang->testtask->subMenu = $lang->qa->subMenu; -$lang->testtask->menu->index = array('link' => '仪表盘|qa|index'); -$lang->testtask->menu->bug = array('link' => 'Bug|bug|browse|productID=%s'); -$lang->testtask->menu->testcase = array('link' => '用例|testcase|browse|productID=%s', 'class' => 'dropdown dropdown-hover'); -$lang->testtask->menu->testtask = array('link' => '测试单|testtask|browse|productID=%s', 'class' => 'dropdown dropdown-hover'); -$lang->testtask->menu->automation = array('link' => '自动化|automation|browse|productID=%s', 'alias' => '', 'class' => 'dropdown dropdown-hover'); $lang->testsuite = new stdclass(); $lang->testsuite->menu = new stdclass(); +$lang->testsuite->menu = $lang->qa->menu; $lang->testsuite->subMenu = $lang->qa->subMenu; -$lang->testsuite->menu->index = array('link' => '仪表盘|qa|index'); -$lang->testsuite->menu->bug = array('link' => 'Bug|bug|browse|productID=%s'); -$lang->testsuite->menu->testcase = array('link' => '用例|testcase|browse|productID=%s', 'subModule' => 'testsuite', 'class' => 'dropdown dropdown-hover'); -$lang->testsuite->menu->testtask = array('link' => '测试单|testtask|browse|productID=%s', 'class' => 'dropdown dropdown-hover'); -$lang->testsuite->menu->automation = array('link' => '自动化|automation|browse|productID=%s', 'alias' => '', 'class' => 'dropdown dropdown-hover'); $lang->testreport = new stdclass(); $lang->testreport->menu = new stdclass(); +$lang->testreport->menu = $lang->qa->menu; $lang->testreport->subMenu = $lang->qa->subMenu; -$lang->testreport->menu->index = array('link' => '仪表盘|qa|index'); -$lang->testreport->menu->bug = array('link' => 'Bug|bug|browse|productID=%s'); -$lang->testreport->menu->testcase = array('link' => '用例|testcase|browse|productID=%s', 'class' => 'dropdown dropdown-hover'); -$lang->testreport->menu->testtask = array('link' => '测试单|testtask|browse|productID=%s', 'subModule' => 'testreport', 'class' => 'dropdown dropdown-hover'); -$lang->testreport->menu->automation = array('link' => '自动化|automation|browse|productID=%s', 'alias' => '', 'class' => 'dropdown dropdown-hover'); $lang->caselib = new stdclass(); $lang->caselib->menu = new stdclass(); +$lang->caselib->menu = $lang->qa->menu; $lang->caselib->subMenu = $lang->qa->subMenu; -$lang->caselib->menu->index = array('link' => '仪表盘|qa|index'); -$lang->caselib->menu->bug = array('link' => 'Bug|bug|browse|productID=%s'); -$lang->caselib->menu->testcase = array('link' => '用例|testcase|browse|productID=%s', 'subModule' => 'caselib', 'class' => 'dropdown dropdown-hover'); -$lang->caselib->menu->testtask = array('link' => '测试单|testtask|browse|productID=%s', 'class' => 'dropdown dropdown-hover'); -$lang->caselib->menu->automation = array('link' => '自动化|automation|browse|productID=%s', 'alias' => '', 'class' => 'dropdown dropdown-hover'); $lang->automation = new stdclass(); $lang->automation->menu = new stdclass(); +$lang->automation->menu = $lang->qa->menu; $lang->automation->subMenu = $lang->qa->subMenu; -$lang->automation->menu->index = array('link' => '仪表盘|qa|index'); -$lang->automation->menu->bug = array('link' => 'Bug|bug|browse|productID=%s'); -$lang->automation->menu->testcase = array('link' => '用例|testcase|browse|productID=%s', 'class' => 'dropdown dropdown-hover'); -$lang->automation->menu->testtask = array('link' => '测试单|testtask|browse|productID=%s', 'subModule' => 'testreport', 'class' => 'dropdown dropdown-hover'); -$lang->automation->menu->automation = array('link' => '自动化|automation|browse|productID=%s', 'alias' => '', 'class' => 'dropdown dropdown-hover'); $lang->ci = new stdclass(); $lang->ci->menu = new stdclass(); diff --git a/module/story/control.php b/module/story/control.php index e02b53952d..fd06cfa49e 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -1453,14 +1453,11 @@ class story extends control $this->lang->navGroup->story = $from; - if($from == 'project') + $moduleIndex = array_search('story', $this->lang->noMenuModule); + if($moduleIndex !== false) unset($this->lang->noMenuModule[$moduleIndex]); + if($from == 'qa') { - $moduleIndex = array_search('story', $this->lang->noMenuModule); - if($moduleIndex !== false) unset($this->lang->noMenuModule[$moduleIndex]); - } - else - { - $this->app->loadConfig('qa'); + $this->loadModel('qa'); foreach($this->config->qa->menuList as $module) $this->lang->navGroup->$module = 'qa'; } diff --git a/module/testtask/control.php b/module/testtask/control.php index 6e4dffb9d2..7da93ff573 100644 --- a/module/testtask/control.php +++ b/module/testtask/control.php @@ -152,6 +152,7 @@ class testtask extends control /* Set menu. */ $productID = $this->product->saveState($productID, $this->products); $this->loadModel('testtask')->setUnitMenu($this->products, $productID); + $this->lang->testtask->menuOrder = $this->lang->testcase->menuOrder; /* Load pager. */ if($browseType == 'newest') $recPerPage = '10'; diff --git a/module/testtask/view/browseunits.html.php b/module/testtask/view/browseunits.html.php index 8055836e6f..dd396be7d4 100644 --- a/module/testtask/view/browseunits.html.php +++ b/module/testtask/view/browseunits.html.php @@ -96,6 +96,8 @@ $(function() { $('#UnitTab').addClass('selected'); $('#browseunitsTab').addClass('btn-active-text'); + $('#navbar li[data-id="testtask"]').removeClass('active'); + $('#navbar li[data-id="testcase"]').addClass('active'); }) From 3755648673e0629d23339dc5239afafcb5af24da Mon Sep 17 00:00:00 2001 From: Yagami <976204163@qq.com> Date: Fri, 19 Mar 2021 11:20:35 +0800 Subject: [PATCH 05/27] * Fix qa menu. --- module/testcase/model.php | 13 ------- module/testreport/model.php | 9 ----- module/testsuite/model.php | 14 ------- module/testtask/model.php | 75 ------------------------------------- 4 files changed, 111 deletions(-) diff --git a/module/testcase/model.php b/module/testcase/model.php index 125ee96e4d..a69c10f514 100644 --- a/module/testcase/model.php +++ b/module/testcase/model.php @@ -28,20 +28,7 @@ class testcaseModel extends model public function setMenu($products, $productID, $branch = 0, $moduleID = 0, $suiteID = 0, $orderBy = 'id_desc') { $this->loadModel('product')->setMenu($products, $productID, $branch, $moduleID, 'case'); - $selectHtml = $this->product->select($products, $productID, 'testcase', 'browse', '', $branch, $moduleID, 'case'); - $pageNav = ''; - $pageActions = ''; - $isMobile = $this->app->viewType == 'mhtml'; - if($isMobile) - { - $this->app->loadLang('qa'); - $pageNav = html::a(helper::createLink('qa', 'index'), $this->lang->qa->index) . $this->lang->colon; - } - $pageNav .= $selectHtml; - - $this->lang->modulePageNav = $pageNav; - $this->lang->TRActions = $pageActions; foreach($this->lang->testcase->menu as $key => $menu) { if($this->lang->navGroup->testcase != 'qa') $this->loadModel('qa')->setSubMenu('testcase', $key, $productID); diff --git a/module/testreport/model.php b/module/testreport/model.php index c056675f9f..ebb194fb2d 100644 --- a/module/testreport/model.php +++ b/module/testreport/model.php @@ -23,16 +23,7 @@ class testreportModel extends model public function setMenu($products, $productID, $branch = 0) { $this->loadModel('product')->setMenu($products, $productID, $branch); - $selectHtml = $this->product->select($products, $productID, 'testreport', 'browse', $this->session->PRJ, $branch); - /* Remove branch. */ - if(strpos($selectHtml, 'currentBranch') !== false) $selectHtml = substr($selectHtml, 0, strrpos($selectHtml, "
")) . '
'; - - $pageNav = $selectHtml; - $pageActions = ''; - - $this->lang->modulePageNav = $pageNav; - $this->lang->TRActions = $pageActions; foreach($this->lang->testtask->menu as $key => $value) { if($this->lang->navGroup->testreport != 'qa') $this->loadModel('qa')->setSubMenu('testreport', $key, $productID); diff --git a/module/testsuite/model.php b/module/testsuite/model.php index 276a88a081..6f67660d4e 100644 --- a/module/testsuite/model.php +++ b/module/testsuite/model.php @@ -24,21 +24,7 @@ class testsuiteModel extends model public function setMenu($products, $productID) { $this->loadModel('product')->setMenu($products, $productID); - $selectHtml = $this->select($products, $productID, 'testsuite', 'browse'); - if(strpos($selectHtml, 'currentBranch') !== false) $selectHtml = substr($selectHtml, 0, strrpos($selectHtml, "
")) . '
'; - $pageNav = ''; - $pageActions = ''; - $isMobile = $this->app->viewType == 'mhtml'; - if($isMobile) - { - $this->app->loadLang('qa'); - $pageNav = html::a(helper::createLink('qa', 'index'), $this->lang->qa->index) . $this->lang->colon; - } - $pageNav .= $selectHtml; - - $this->lang->modulePageNav = $pageNav; - $this->lang->TRActions = $pageActions; foreach($this->lang->testsuite->menu as $key => $value) { if($this->config->global->flow == 'full' and $this->lang->navGroup->testcase != 'qa') $this->loadModel('qa')->setSubMenu('testsuite', $key, $productID); diff --git a/module/testtask/model.php b/module/testtask/model.php index d928652e23..e9f2a8ec35 100644 --- a/module/testtask/model.php +++ b/module/testtask/model.php @@ -24,42 +24,8 @@ class testtaskModel extends model public function setMenu($products, $productID, $branch = 0, $testtask = 0) { $this->loadModel('product')->setMenu($products, $productID, $branch); - $selectHtml = $this->product->select($products, $productID, 'testtask', 'browse', '', $branch); - - if($testtask and $this->app->viewType != 'mhtml') - { - $testtasks = $this->getProductTasks($productID, 0, 'id_desc', null, array('local', 'totalStatus'), 0, 0, $this->session->PRJ); - if(!isset($testtasks[$testtask])) $testtasks[$testtask] = $this->getById($testtask); - - $selectHtml .= "
"; - $selectHtml .= "
"; - $selectHtml .= "" . $testtasks[$testtask]->name . " "; - $selectHtml .= ""; - $selectHtml .= "
"; - $selectHtml .= "
"; - - $this->lang->TRActions = ''; - if(common::hasPriv('testtask', 'view')) $this->lang->TRActions .= html::a(helper::createLink('testtask', 'view', "taskID={$testtask->id}"), " " . $this->lang->testtask->view, '', "class='btn'"); - if(common::hasPriv('testreport', 'browse')) $this->lang->TRActions .= html::a(helper::createLink('testreport', 'browse', "objectID=$productID&objectType=product&extra={$testtask->id}"), " " . $this->lang->testtask->reportField, '', "class='btn'"); - } $this->app->loadLang('qa'); - $productIndex = $selectHtml; - - $pageNav = ''; - $pageActions = ''; - $isMobile = $this->app->viewType == 'mhtml'; - if($isMobile) - { - $this->app->loadLang('qa'); - $pageNav = html::a(helper::createLink('qa', 'index'), $this->lang->qa->index) . $this->lang->colon; - } - $pageNav .= $selectHtml; - - $this->lang->modulePageNav = $pageNav; - $this->lang->TRActions = $pageActions; foreach($this->lang->testtask->menu as $key => $value) { if($this->lang->navGroup->testtask != 'qa') $this->loadModel('qa')->setSubMenu('testtask', $key, $productID); @@ -93,48 +59,7 @@ class testtaskModel extends model public function setUnitMenu($products, $productID, $branch = 0, $testtask = 0) { $this->loadModel('product')->setMenu($products, $productID, $branch); - $selectHtml = $this->product->select($products, $productID, 'testtask', 'browseUnits', '', $branch); - if($testtask and $this->app->viewType != 'mhtml') - { - $testtasks = $this->getProductUnitTasks($productID, 'all', 'id_desc'); - if(!isset($testtasks[$testtask])) $testtasks[$testtask] = $this->getById($testtask); - - $selectHtml .= "
"; - $selectHtml .= "
"; - $selectHtml .= "" . $testtasks[$testtask]->name . " "; - $selectHtml .= ""; - $selectHtml .= "
"; - $selectHtml .= "
"; - } - - $this->app->loadLang('qa'); - $productIndex = '
' . html::a(helper::createLink('qa', 'index', 'locate=no'), $this->lang->qa->index, '', "class='btn'") . '
'; - $productIndex .= $selectHtml; - - $pageNav = ''; - $pageActions = ''; - $isMobile = $this->app->viewType == 'mhtml'; - if($isMobile) - { - $this->app->loadLang('qa'); - $pageNav = html::a(helper::createLink('qa', 'index'), $this->lang->qa->index) . $this->lang->colon; - } - else - { - if($this->config->global->flow == 'full') - { - $this->app->loadLang('qa'); - $pageNav = '
' . html::a(helper::createLink('qa', 'index', 'locate=no'), $this->lang->qa->index, '', "class='btn'") . '
'; - } - } - $pageNav .= $selectHtml; - - $this->lang->modulePageNav = $pageNav; - $this->lang->TRActions = $pageActions; - if($this->config->global->flow != 'full') $this->lang->testtask->menu = new stdclass(); foreach($this->lang->testtask->menu as $key => $value) { if($this->lang->navGroup->testcase != 'qa') $this->loadModel('qa')->setSubMenu('testtask', $key, $productID); From 58bfee037470bdb4d0d5667bccda72d5dbb317e3 Mon Sep 17 00:00:00 2001 From: hufangzhou <746775970@qq.com> Date: Fri, 19 Mar 2021 11:22:22 +0800 Subject: [PATCH 06/27] * Fix a bug. --- module/common/lang/en.php | 2 +- module/common/lang/zh-cn.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/module/common/lang/en.php b/module/common/lang/en.php index 7894a1a5ef..a8de7a1bf0 100644 --- a/module/common/lang/en.php +++ b/module/common/lang/en.php @@ -859,7 +859,7 @@ $lang->menu = new stdclass(); $lang->menu->scrum = new stdclass(); $lang->menu->scrum->index = 'Index|project|index|project={PROJECT}'; $lang->menu->scrum->project = "$lang->executionCommon|project|index|locate=no"; -$lang->menu->scrum->projectstory = array('link' => $lang->SRCommon . '|projectstory|story|project={PROJECT}', 'subModule' => 'story', 'alias' => 'story,track'); +$lang->menu->scrum->projectstory = array('link' => $lang->SRCommon . '|projectstory|story|', 'subModule' => 'story', 'alias' => 'story,track'); $lang->menu->scrum->doc = 'Doc|doc|index|'; $lang->menu->scrum->qa = 'QA|qa|index'; $lang->menu->scrum->ci = 'Code|repo|browse'; diff --git a/module/common/lang/zh-cn.php b/module/common/lang/zh-cn.php index e204f17fd2..b92ad7d795 100644 --- a/module/common/lang/zh-cn.php +++ b/module/common/lang/zh-cn.php @@ -867,7 +867,7 @@ $lang->menu = new stdclass(); $lang->menu->scrum = new stdclass(); $lang->menu->scrum->index = '仪表盘|project|index|project={PROJECT}'; $lang->menu->scrum->execution = "$lang->executionCommon|project|execution|projectID={PROJECT}"; -$lang->menu->scrum->projectstory = array('link' => $lang->SRCommon . '|projectstory|story|projectID={PROJECT}', 'alias' => 'story,track'); +$lang->menu->scrum->projectstory = array('link' => $lang->SRCommon . '|projectstory|story|', 'alias' => 'story,track'); $lang->menu->scrum->doc = array('link' => '文档|doc|objectLibs|type=project&objectID={PROJECT}', 'subModule' => 'doc'); $lang->menu->scrum->qa = array('link' => '测试|qa|index', 'subModule' => 'testcase,testtask'); $lang->menu->scrum->ci = '代码|repo|browse'; From d5d4d07b397e06963648095d21f3c912c300f119 Mon Sep 17 00:00:00 2001 From: Yagami <976204163@qq.com> Date: Fri, 19 Mar 2021 11:29:42 +0800 Subject: [PATCH 07/27] * Set session in app. --- module/execution/control.php | 70 ++++++++++++++++++------------------ module/task/control.php | 4 +-- 2 files changed, 37 insertions(+), 37 deletions(-) diff --git a/module/execution/control.php b/module/execution/control.php index 4f44edaac5..4b752c0394 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -186,9 +186,9 @@ class execution extends control /* Save to session. */ $uri = $this->app->getURI(true); - $this->app->session->set('taskList', $uri); - $this->app->session->set('storyList', $uri); - $this->app->session->set('executionList', $uri); + $this->app->session->set('taskList', $uri, 'execution'); + $this->app->session->set('storyList', $uri, 'product'); + $this->app->session->set('executionList', $uri, 'execution'); /* Process the order by field. */ if(!$orderBy) $orderBy = $this->cookie->executionTaskOrder ? $this->cookie->executionTaskOrder : 'status,id_desc'; @@ -270,8 +270,8 @@ class execution extends control $executionID = $execution->id; /* Save session. */ - $this->app->session->set('taskList', $this->app->getURI(true)); - $this->app->session->set('storyList', $this->app->getURI(true)); + $this->app->session->set('taskList', $this->app->getURI(true), 'execution'); + $this->app->session->set('storyList', $this->app->getURI(true), 'product'); /* Header and session. */ $this->view->title = $execution->name . $this->lang->colon . $this->lang->execution->task; @@ -493,8 +493,8 @@ class execution extends control } /* Save session. */ - $this->app->session->set('taskList', $this->app->getURI(true)); - $this->app->session->set('storyList', $this->app->getURI(true)); + $this->app->session->set('taskList', $this->app->getURI(true), 'execution'); + $this->app->session->set('storyList', $this->app->getURI(true), 'product'); $this->view->title = $execution->name . $this->lang->colon . $this->lang->execution->importTask; $this->view->position[] = html::a(inlink('browse', "executionID=$toExecution"), $execution->name); @@ -535,9 +535,9 @@ class execution extends control /* Save to session. */ $uri = $this->app->getURI(true); - $this->app->session->set('bugList', $uri); - $this->app->session->set('storyList', $uri); - $this->app->session->set('executionList', $uri); + $this->app->session->set('bugList', $uri, 'qa'); + $this->app->session->set('storyList', $uri, 'product'); + $this->app->session->set('executionList', $uri, 'execution'); $this->loadModel('bug'); $executions = $this->execution->getPairs(0, 'all', 'nocode'); @@ -721,7 +721,7 @@ class execution extends control } /* Save session. */ - $this->app->session->set('storyList', $this->app->getURI(true)); + $this->app->session->set('storyList', $this->app->getURI(true), 'product'); /* Process the order by field. */ if(!$orderBy) $orderBy = $this->cookie->executionStoryOrder ? $this->cookie->executionStoryOrder : 'pri'; @@ -855,7 +855,7 @@ class execution extends control $this->loadModel('user'); /* Save session. */ - $this->session->set('bugList', $this->app->getURI(true)); + $this->session->set('bugList', $this->app->getURI(true), 'qa'); $type = strtolower($type); $queryID = ($type == 'bysearch') ? (int)$param : 0; @@ -963,7 +963,7 @@ class execution extends control { /* Load module and set session. */ $this->loadModel('testtask'); - $this->session->set('buildList', $this->app->getURI(true)); + $this->session->set('buildList', $this->app->getURI(true), 'execution'); $execution = $this->commonAction($executionID); $executionID = $execution->id; @@ -1028,7 +1028,7 @@ class execution extends control $this->loadModel('testtask'); /* Save session. */ - $this->session->set('testtaskList', $this->app->getURI(true)); + $this->session->set('testtaskList', $this->app->getURI(true), 'qa'); $execution = $this->commonAction($executionID); $executionID = $execution->id; @@ -1776,9 +1776,9 @@ class execution extends control { /* Save to session. */ $uri = $this->app->getURI(true); - $this->app->session->set('taskList', $uri); - $this->app->session->set('storyList', $uri); - $this->app->session->set('bugList', $uri); + $this->app->session->set('taskList', $uri, 'execution'); + $this->app->session->set('storyList', $uri, 'product'); + $this->app->session->set('bugList', $uri, 'qa'); /* Compatibility IE8*/ if(strpos($this->server->http_user_agent, 'MSIE 8.0') !== false) header("X-UA-Compatible: IE=EmulateIE7"); @@ -1835,11 +1835,11 @@ class execution extends control /* Save to session. */ $uri = $this->app->getURI(true); - $this->app->session->set('taskList', $uri); - $this->app->session->set('storyList', $uri); - $this->app->session->set('executionList', $uri); - $this->app->session->set('caseList', $uri); - $this->app->session->set('bugList', $uri); + $this->app->session->set('taskList', $uri, 'execution'); + $this->app->session->set('storyList', $uri, 'product'); + $this->app->session->set('executionList', $uri, 'execution'); + $this->app->session->set('caseList', $uri, 'qa'); + $this->app->session->set('bugList', $uri, 'qa'); if($type === 'json') die(helper::jsonEncode4Parse($tree, JSON_HEX_QUOT | JSON_HEX_APOS)); @@ -1973,7 +1973,7 @@ class execution extends control { /* Save to session. */ $uri = $this->app->getURI(true); - $this->app->session->set('storyList', $uri); + $this->app->session->set('storyList', $uri, 'product'); /* Compatibility IE8*/ if(strpos($this->server->http_user_agent, 'MSIE 8.0') !== false) header("X-UA-Compatible: IE=EmulateIE7"); @@ -2260,7 +2260,7 @@ class execution extends control $browseLink = $this->createLink('execution', 'story', "executionID=$executionID"); if($execution->type == 'project') $browseLink = $this->createLink('projectstory', 'story'); - $this->session->set('storyList', $this->app->getURI(true)); // Save session. + $this->session->set('storyList', $this->app->getURI(true), 'product'); // Save session. if($execution->type != 'execution') $this->execution->setMenu($this->executions, $execution->id); // Set menu. if(empty($products)) @@ -2430,16 +2430,16 @@ class execution extends control { /* Save session. */ $uri = $this->app->getURI(true); - $this->session->set('productList', $uri); - $this->session->set('productPlanList', $uri); - $this->session->set('releaseList', $uri); - $this->session->set('storyList', $uri); - $this->session->set('executionList', $uri); - $this->session->set('taskList', $uri); - $this->session->set('buildList', $uri); - $this->session->set('bugList', $uri); - $this->session->set('caseList', $uri); - $this->session->set('testtaskList', $uri); + $this->session->set('productList', $uri, 'product'); + $this->session->set('productPlanList', $uri, 'product'); + $this->session->set('releaseList', $uri, 'product'); + $this->session->set('storyList', $uri, 'product'); + $this->session->set('executionList', $uri, 'execution'); + $this->session->set('taskList', $uri, 'execution'); + $this->session->set('buildList', $uri, 'execution'); + $this->session->set('bugList', $uri, 'qa'); + $this->session->set('caseList', $uri, 'qa'); + $this->session->set('testtaskList', $uri, 'qa'); /* use first execution if executionID does not exist. */ if(!isset($this->executions[$executionID])) $executionID = key($this->executions); @@ -2682,7 +2682,7 @@ class execution extends control $this->app->loadLang('programplan'); $from = $this->app->openApp; - if($from == 'execution') $this->session->set('executionList', $this->app->getURI(true)); + if($from == 'execution') $this->session->set('executionList', $this->app->getURI(true), 'execution'); if($from == 'project') $this->lang->navGroup->execution = 'project'; /* Load pager and get tasks. */ diff --git a/module/task/control.php b/module/task/control.php index 8b03e21a5a..28a0b8d931 100644 --- a/module/task/control.php +++ b/module/task/control.php @@ -800,8 +800,8 @@ class task extends control die(js::locate($this->createLink('task', 'view', "taskID=$taskID"), 'parent')); } - $this->session->set('estimateList', $this->app->getURI(true)); - if(isonlybody() && $this->config->requestType != 'GET') $this->session->set('estimateList', $this->app->getURI(true) . '?onlybody=yes'); + $this->session->set('estimateList', $this->app->getURI(true), 'execution'); + if(isonlybody() && $this->config->requestType != 'GET') $this->session->set('estimateList', $this->app->getURI(true) . '?onlybody=yes', 'execution'); $this->view->task = $this->task->getById($taskID); $this->view->estimates = $this->task->getTaskEstimate($taskID); From 7bb301a8b25726074df0006fc74849179bd0c639 Mon Sep 17 00:00:00 2001 From: tianshujie98 Date: Fri, 19 Mar 2021 12:14:10 +0800 Subject: [PATCH 08/27] * Fix menu bug. --- module/build/control.php | 2 +- module/build/view/create.html.php | 2 +- module/execution/model.php | 8 ++++---- module/product/control.php | 2 +- module/product/model.php | 8 ++++---- module/project/model.php | 8 ++++---- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/module/build/control.php b/module/build/control.php index b9d08080ca..f6a3788628 100644 --- a/module/build/control.php +++ b/module/build/control.php @@ -32,7 +32,7 @@ class build extends control commonModel::setAppObjectID('project', $projectID); $executions = $this->execution->getPairs($projectID); - $executionID = key($executions); + $executionID = $executionID == 0 ? key($executions) : $executionID; } if(!empty($_POST)) diff --git a/module/build/view/create.html.php b/module/build/view/create.html.php index 8c96ae8156..c8e28e82c0 100644 --- a/module/build/view/create.html.php +++ b/module/build/view/create.html.php @@ -19,7 +19,7 @@
- + diff --git a/module/execution/model.php b/module/execution/model.php index d3dcda9d44..a9afb1f466 100644 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -275,23 +275,23 @@ class executionModel extends model /* When the cookie and session do not exist, get it from the database. */ if(empty($executionID) and isset($this->config->execution->lastExecution) and isset($executions[$this->config->execution->lastExecution])) { - $this->session->set('execution', $this->config->execution->lastExecution); + $this->session->set('execution', $this->config->execution->lastExecution, $this->app->openApp); $this->setProjectSession($this->session->execution); return $this->session->execution; } - if($executionID > 0) $this->session->set('execution', (int)$executionID); + if($executionID > 0) $this->session->set('execution', (int)$executionID, $this->app->openApp); if($executionID == 0 and $this->cookie->lastExecution) { /* Execution link is execution-task. */ $executionID = (int)$this->cookie->lastExecution; $executionID = in_array($executionID, array_keys($executions)) ? $executionID : key($executions); - $this->session->set('execution', $executionID); + $this->session->set('execution', $executionID, $this->app->openApp); } if($executionID == 0 and $this->session->execution == '') $this->session->set('execution', key($executions)); if(!isset($executions[$this->session->execution])) { - $this->session->set('execution', key($executions)); + $this->session->set('execution', key($executions), $this->app->openApp); if($executionID && strpos(",{$this->app->user->view->sprints},", ",{$this->session->execution},") === false) $this->accessDenied(); } diff --git a/module/product/control.php b/module/product/control.php index 38de9e5cf7..df19069b23 100644 --- a/module/product/control.php +++ b/module/product/control.php @@ -130,7 +130,7 @@ class product extends control $this->loadModel('execution'); /* Set product, module and query. */ - $productID = $this->app->rawModule != 'projectstory' ? $this->product->saveState($productID, $this->products) : $productID; + $productID = $this->app->openApp != 'projectstory' ? $this->product->saveState($productID, $this->products) : $productID; $branch = ($branch === '') ? (int)$this->cookie->preBranch : (int)$branch; setcookie('preProductID', $productID, $this->config->cookieLife, $this->config->webRoot, '', false, true); setcookie('preBranch', (int)$branch, $this->config->cookieLife, $this->config->webRoot, '', false, true); diff --git a/module/product/model.php b/module/product/model.php index 0e8be554c1..6dc234b88f 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -167,12 +167,12 @@ class productModel extends model */ public function saveState($productID, $products) { - if($productID > 0) $this->session->set('product', (int)$productID); - if($productID == 0 and $this->cookie->lastProduct) $this->session->set('product', (int)$this->cookie->lastProduct); - if($productID == 0 and $this->session->product == '') $this->session->set('product', key($products)); + if($productID > 0) $this->session->set('product', (int)$productID, $this->app->openApp); + if($productID == 0 and $this->cookie->lastProduct) $this->session->set('product', (int)$this->cookie->lastProduct, $this->app->openApp); + if($productID == 0 and $this->session->product == '') $this->session->set('product', key($products), $this->app->openApp); if(!isset($products[$this->session->product])) { - $this->session->set('product', key($products)); + $this->session->set('product', key($products), $this->app->openApp); if($productID && strpos(",{$this->app->user->view->products},", ",{$this->session->product},") === false) $this->accessDenied(); } if($this->cookie->preProductID != $productID) diff --git a/module/project/model.php b/module/project/model.php index eb4d4c5a34..27b29fbaca 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -115,12 +115,12 @@ class projectModel extends model */ public function saveState($projectID = 0, $projects = array()) { - if($projectID > 0) $this->session->set('PRJ', (int)$projectID); - if($projectID == 0 and $this->cookie->lastProject) $this->session->set('PRJ', (int)$this->cookie->lastProject); - if($projectID == 0 and $this->session->PRJ == '') $this->session->set('PRJ', key($projects)); + if($projectID > 0) $this->session->set('PRJ', (int)$projectID, $this->app->openApp); + if($projectID == 0 and $this->cookie->lastProject) $this->session->set('PRJ', (int)$this->cookie->lastProject, $this->app->openApp); + if($projectID == 0 and $this->session->PRJ == '') $this->session->set('PRJ', key($projects), $this->app->openApp); if(!isset($projects[$this->session->PRJ])) { - $this->session->set('PRJ', key($projects)); + $this->session->set('PRJ', key($projects), $this->app->openApp); if($projectID && strpos(",{$this->app->user->view->projects},", ",{$this->session->PRJ},") === false) $this->accessDenied(); } From 1e1493d710a4b3421ae40f5412f316bee6ff5b1e Mon Sep 17 00:00:00 2001 From: hufangzhou <746775970@qq.com> Date: Fri, 19 Mar 2021 13:24:08 +0800 Subject: [PATCH 09/27] * Fix bug #11397. --- module/execution/model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/execution/model.php b/module/execution/model.php index a9afb1f466..2bce8e7325 100644 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -1855,7 +1855,7 @@ class executionModel extends model $bugToTasks = fixer::input('post')->get(); $bugs = $this->bug->getByList(array_keys($bugToTasks->import)); - $projectID = $this->loadModel('execution')->getProjectID($executionID); + $projectID = $this->loadModel('task')->getProjectID($executionID); foreach($bugToTasks->import as $key => $value) { $bug = zget($bugs, $key, ''); From d5665b54f7f651fcaec6eb41c5815eb5ef5d993a Mon Sep 17 00:00:00 2001 From: tianshujie98 Date: Fri, 19 Mar 2021 14:51:01 +0800 Subject: [PATCH 10/27] * Reduction. --- module/execution/model.php | 8 ++++---- module/product/model.php | 8 ++++---- module/project/model.php | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/module/execution/model.php b/module/execution/model.php index 2bce8e7325..d9d36ac94c 100644 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -275,23 +275,23 @@ class executionModel extends model /* When the cookie and session do not exist, get it from the database. */ if(empty($executionID) and isset($this->config->execution->lastExecution) and isset($executions[$this->config->execution->lastExecution])) { - $this->session->set('execution', $this->config->execution->lastExecution, $this->app->openApp); + $this->session->set('execution', $this->config->execution->lastExecution); $this->setProjectSession($this->session->execution); return $this->session->execution; } - if($executionID > 0) $this->session->set('execution', (int)$executionID, $this->app->openApp); + if($executionID > 0) $this->session->set('execution', (int)$executionID); if($executionID == 0 and $this->cookie->lastExecution) { /* Execution link is execution-task. */ $executionID = (int)$this->cookie->lastExecution; $executionID = in_array($executionID, array_keys($executions)) ? $executionID : key($executions); - $this->session->set('execution', $executionID, $this->app->openApp); + $this->session->set('execution', $executionID); } if($executionID == 0 and $this->session->execution == '') $this->session->set('execution', key($executions)); if(!isset($executions[$this->session->execution])) { - $this->session->set('execution', key($executions), $this->app->openApp); + $this->session->set('execution', key($executions)); if($executionID && strpos(",{$this->app->user->view->sprints},", ",{$this->session->execution},") === false) $this->accessDenied(); } diff --git a/module/product/model.php b/module/product/model.php index 6dc234b88f..0e8be554c1 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -167,12 +167,12 @@ class productModel extends model */ public function saveState($productID, $products) { - if($productID > 0) $this->session->set('product', (int)$productID, $this->app->openApp); - if($productID == 0 and $this->cookie->lastProduct) $this->session->set('product', (int)$this->cookie->lastProduct, $this->app->openApp); - if($productID == 0 and $this->session->product == '') $this->session->set('product', key($products), $this->app->openApp); + if($productID > 0) $this->session->set('product', (int)$productID); + if($productID == 0 and $this->cookie->lastProduct) $this->session->set('product', (int)$this->cookie->lastProduct); + if($productID == 0 and $this->session->product == '') $this->session->set('product', key($products)); if(!isset($products[$this->session->product])) { - $this->session->set('product', key($products), $this->app->openApp); + $this->session->set('product', key($products)); if($productID && strpos(",{$this->app->user->view->products},", ",{$this->session->product},") === false) $this->accessDenied(); } if($this->cookie->preProductID != $productID) diff --git a/module/project/model.php b/module/project/model.php index 27b29fbaca..eb4d4c5a34 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -115,12 +115,12 @@ class projectModel extends model */ public function saveState($projectID = 0, $projects = array()) { - if($projectID > 0) $this->session->set('PRJ', (int)$projectID, $this->app->openApp); - if($projectID == 0 and $this->cookie->lastProject) $this->session->set('PRJ', (int)$this->cookie->lastProject, $this->app->openApp); - if($projectID == 0 and $this->session->PRJ == '') $this->session->set('PRJ', key($projects), $this->app->openApp); + if($projectID > 0) $this->session->set('PRJ', (int)$projectID); + if($projectID == 0 and $this->cookie->lastProject) $this->session->set('PRJ', (int)$this->cookie->lastProject); + if($projectID == 0 and $this->session->PRJ == '') $this->session->set('PRJ', key($projects)); if(!isset($projects[$this->session->PRJ])) { - $this->session->set('PRJ', key($projects), $this->app->openApp); + $this->session->set('PRJ', key($projects)); if($projectID && strpos(",{$this->app->user->view->projects},", ",{$this->session->PRJ},") === false) $this->accessDenied(); } From 08de0fa0736f4348f8f82911e6e448a5cb4d17de Mon Sep 17 00:00:00 2001 From: hufangzhou <746775970@qq.com> Date: Fri, 19 Mar 2021 14:53:44 +0800 Subject: [PATCH 11/27] * Adjust the label width. --- module/program/view/project.html.php | 2 +- module/project/view/browse.html.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/module/program/view/project.html.php b/module/program/view/project.html.php index ed7dd913e1..cc42447563 100644 --- a/module/program/view/project.html.php +++ b/module/program/view/project.html.php @@ -16,7 +16,7 @@ js::set('programID', $programID); js::set('browseType', $browseType); ?> - - - + + + - - + + - + @@ -69,7 +77,7 @@ - + From b3ce0b4689cccfc0515bd7aa088607ebdf2dec94 Mon Sep 17 00:00:00 2001 From: tianshujie98 Date: Fri, 19 Mar 2021 14:56:43 +0800 Subject: [PATCH 13/27] * Fix bug. --- module/project/js/build.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/project/js/build.js b/module/project/js/build.js index e98b0b44e9..2079622260 100644 --- a/module/project/js/build.js +++ b/module/project/js/build.js @@ -5,7 +5,7 @@ $(function() if(executions.length == 0) { alert(createExecution); - location.href = createLink('execution', 'create', 'productID=&executionID=©ExecutionID=&planID=&confirm=&projectID=' + projectID); + location.href = createLink('execution', 'create', 'projectID=' + projectID); return false; } }); From 2f5eb04e08b0737a1c4365a7714c0420d674e2c9 Mon Sep 17 00:00:00 2001 From: Yagami <976204163@qq.com> Date: Fri, 19 Mar 2021 15:14:14 +0800 Subject: [PATCH 14/27] * Merge code. --- framework/base/router.class.php | 14 -------------- module/admin/lang/en.php | 2 +- module/common/lang/en.php | 12 +++++++++--- module/execution/model.php | 2 +- module/project/model.php | 14 +++++++------- module/projectstory/control.php | 7 +------ 6 files changed, 19 insertions(+), 32 deletions(-) diff --git a/framework/base/router.class.php b/framework/base/router.class.php index 2b1ba1f2ed..43a0bc0428 100644 --- a/framework/base/router.class.php +++ b/framework/base/router.class.php @@ -382,7 +382,6 @@ class baseRouter $this->setErrorHandler(); $this->setTimezone(); $this->startSession(); - $this->setProject(); if($this->config->framework->multiSite) $this->setSiteCode() && $this->loadExtraConfig(); if($this->config->framework->autoConnectDB) $this->connectDB(); @@ -854,18 +853,6 @@ class baseRouter } } - /** - * 从Get里取project id 设置到session中。 - * Get project id from Get and set it to session. - * - * @access public - * @return void - */ - public function setProject() - { - if(isset($_GET['PRJ'])) $this->session->set('PRJ', $_GET['PRJ']); //Set project id into session. - } - /** * 从cookie中获取当前的group, 即URL锚链接'#open=?'。 * Get current group from cookie, original source is url '#open=?'. @@ -1830,7 +1817,6 @@ class baseRouter global $filter; /* Remove these three params. */ - unset($passedParams['PRJ']); unset($passedParams['onlybody']); unset($passedParams['HTTP_X_REQUESTED_WITH']); diff --git a/module/admin/lang/en.php b/module/admin/lang/en.php index 0d73574ab9..7b0b00e926 100644 --- a/module/admin/lang/en.php +++ b/module/admin/lang/en.php @@ -80,7 +80,7 @@ $lang->admin->safe->reasonList['birthday'] = 'Same as DOB'; $lang->admin->safe->modifyPasswordList[1] = 'Yes'; $lang->admin->safe->modifyPasswordList[0] = 'No'; -$lang->admin->safe->loginCaptchaList[1] = 'Yes' +$lang->admin->safe->loginCaptchaList[1] = 'Yes'; $lang->admin->safe->loginCaptchaList[0] = 'No'; $lang->admin->safe->noticeMode = 'Password will be checked when a user logs in, or a user is added or edited.'; diff --git a/module/common/lang/en.php b/module/common/lang/en.php index a8de7a1bf0..b9708b98ab 100644 --- a/module/common/lang/en.php +++ b/module/common/lang/en.php @@ -133,7 +133,7 @@ list($executionModule, $executionMethod) = explode('-', $config->executionLink); /* Main menu. */ $lang->mainNav = new stdclass(); $lang->mainNav->my = ' My|my|index|'; -$lang->mainNav->product = " Product|$productModule|$productMethod|"; +$lang->mainNav->product = " Product|$productModule|$productMethod|"; if($config->systemMode == 'new') { $lang->mainNav->project = " Project|$projectModule|$projectMethod|"; @@ -192,7 +192,7 @@ $lang->product->homeMenu->list = array('link' => $lang->productCommon . '|produc $lang->product->menu = new stdclass(); $lang->product->menu->dashboard = array('link' => 'Dashboard|product|dashboard|productID=%s'); -if($config->URAndSR) $lang->product->viewMenu->requirement = array('link' => "$lang->URCommon|product|browse|productID=%s&branch=&browseType=unclosed¶m=0&storyType=requirement", 'alias' => 'batchedit', 'subModule' => 'story'); +if($config->URAndSR) $lang->product->menu->requirement = array('link' => "$lang->URCommon|product|browse|productID=%s&branch=&browseType=unclosed¶m=0&storyType=requirement", 'alias' => 'batchedit', 'subModule' => 'story'); $lang->product->menu->story = array('link' => "$lang->SRCommon|product|browse|productID=%s", 'alias' => 'batchedit', 'subModule' => 'story'); $lang->product->menu->plan = array('link' => "Plan|productplan|browse|productID=%s", 'subModule' => 'productplan'); $lang->product->menu->release = array('link' => "Release|release|browse|productID=%s", 'subModule' => 'release'); @@ -213,7 +213,7 @@ $lang->release = new stdclass(); $lang->branch = new stdclass(); $lang->productplan = new stdclass(); -$lang->release->menu = $lang->product->viewMenu; +$lang->release->menu = $lang->product->menu; $lang->branch->menu = $lang->product->menu; $lang->productplan->menu = $lang->product->menu; @@ -367,6 +367,12 @@ $lang->execution->subMenu->more->whitelist = array('link' => 'Whitelist|executio $lang->execution->subMenu->more->action = array('link' => 'Dynamics|execution|dynamic|executionID=%s'); $lang->execution->subMenu->more->view = array('link' => 'Overview|execution|view|executionID=%s', 'subModule' => 'view', 'alias' => 'edit,start,suspend,putoff,close'); +$lang->execution->qaMenu = new stdclass(); +$lang->execution->qaMenu->qa = array('link' => '仪表盘|execution|qa|executionID=%s'); +$lang->execution->qaMenu->bug = array('link' => 'Bug|execution|bug|executionID=%s'); +$lang->execution->qaMenu->testcase = array('link' => '用例|execution|testcase|executionID=%s', 'alias' => 'create'); +$lang->execution->qaMenu->testtask = array('link' => '测试单|execution|testtask|executionID=%s'); + $lang->execution->dividerMenu = ',execution,programplan,executionbuild,story,doc,other,'; $lang->task = new stdclass(); diff --git a/module/execution/model.php b/module/execution/model.php index d9d36ac94c..10d87527dc 100644 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -113,7 +113,7 @@ class executionModel extends model if($methodName == 'all') $label = $this->lang->execution->allExecutions; if($methodName == 'create' and $moduleName == 'execution') $label = $this->lang->execution->create; - foreach($this->lang->execution->viewMenu as $key => $menu) common::setMenuVars($this->lang->execution->viewMenu, $key, $executionID); + foreach($this->lang->execution->menu as $key => $menu) common::setMenuVars($this->lang->execution->menu, $key, $executionID); foreach($this->lang->execution->qaMenu as $key => $menu) common::setMenuVars($this->lang->execution->qaMenu, $key, $executionID); foreach($this->lang->execution->menu as $key => $menu) diff --git a/module/project/model.php b/module/project/model.php index eb4d4c5a34..546cfc2295 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -115,16 +115,16 @@ class projectModel extends model */ public function saveState($projectID = 0, $projects = array()) { - if($projectID > 0) $this->session->set('PRJ', (int)$projectID); - if($projectID == 0 and $this->cookie->lastProject) $this->session->set('PRJ', (int)$this->cookie->lastProject); - if($projectID == 0 and $this->session->PRJ == '') $this->session->set('PRJ', key($projects)); - if(!isset($projects[$this->session->PRJ])) + if($projectID > 0) $this->session->set('project', (int)$projectID); + if($projectID == 0 and $this->cookie->lastProject) $this->session->set('project', (int)$this->cookie->lastProject); + if($projectID == 0 and $this->session->project == '') $this->session->set('project', key($projects)); + if(!isset($projects[$this->session->project])) { - $this->session->set('PRJ', key($projects)); - if($projectID && strpos(",{$this->app->user->view->projects},", ",{$this->session->PRJ},") === false) $this->accessDenied(); + $this->session->set('project', key($projects)); + if($projectID && strpos(",{$this->app->user->view->projects},", ",{$this->session->project},") === false) $this->accessDenied(); } - return $this->session->PRJ; + return $this->session->project; } /* diff --git a/module/projectstory/control.php b/module/projectstory/control.php index 478b4963f6..70d48c6224 100644 --- a/module/projectstory/control.php +++ b/module/projectstory/control.php @@ -44,12 +44,7 @@ class projectStory extends control */ public function story($productID = 0, $branch = 0, $browseType = '', $param = 0, $storyType = 'story', $orderBy = '', $recTotal = 0, $recPerPage = 20, $pageID = 1) { - $this->session->set('storyList', $this->app->getURI(true)); - - $this->lang->story->title = str_replace($this->lang->SRCommon, $this->lang->SRCommon, $this->lang->story->title); - $this->lang->story->createRequirement = str_replace($this->lang->SRCommon, $this->lang->SRCommon, $this->lang->story->createRequirement); - $this->lang->story->createStory = str_replace($this->lang->SRCommon, $this->lang->SRCommon, $this->lang->story->createStory); - $this->lang->story->noStory = str_replace($this->lang->SRCommon, $this->lang->SRCommon, $this->lang->story->noStory); + $this->session->set('storyList', $this->app->getURI(true), 'project'); echo $this->fetch('product', 'browse', "productID=$productID&branch=$branch&browseType=$browseType¶m=$param&storyType=$storyType&orderBy=$orderBy&recTotal=$recTotal&recPerPage=$recPerPage&pageID=$pageID&from=project"); } From 7413cbdbe29845c48dd004c838a331289f375b52 Mon Sep 17 00:00:00 2001 From: Yagami <976204163@qq.com> Date: Fri, 19 Mar 2021 15:39:18 +0800 Subject: [PATCH 15/27] * Fix menu bug. --- module/common/lang/en.php | 2 +- module/common/lang/zh-cn.php | 2 +- module/execution/control.php | 11 +++++------ module/project/control.php | 4 ++-- module/project/model.php | 3 +-- 5 files changed, 10 insertions(+), 12 deletions(-) diff --git a/module/common/lang/en.php b/module/common/lang/en.php index b9708b98ab..17334cc5cd 100644 --- a/module/common/lang/en.php +++ b/module/common/lang/en.php @@ -182,7 +182,7 @@ $lang->personnel = new stdClass(); $lang->personnel->menu = new stdClass(); $lang->personnel->menu->invest = array('link' => "Investment|personnel|invest|programID=%s"); $lang->personnel->menu->accessible = array('link' => "Accessible|personnel|accessible|programID=%s"); -$lang->personnel->menu->whitelist = array('link' => "Whitelist|personnel|whitelist|program=ID%s", 'alias' => 'addwhitelist'); +$lang->personnel->menu->whitelist = array('link' => "Whitelist|personnel|whitelist|programID=%s", 'alias' => 'addwhitelist'); /* Scrum menu. */ $lang->product = new stdclass(); diff --git a/module/common/lang/zh-cn.php b/module/common/lang/zh-cn.php index cbdc6b57a0..aefc6cd571 100644 --- a/module/common/lang/zh-cn.php +++ b/module/common/lang/zh-cn.php @@ -182,7 +182,7 @@ $lang->personnel = new stdClass(); $lang->personnel->menu = new stdClass(); $lang->personnel->menu->invest = array('link' => "投入人员|personnel|invest|programID=%s"); $lang->personnel->menu->accessible = array('link' => "可访问人员|personnel|accessible|programID=%s"); -$lang->personnel->menu->whitelist = array('link' => "白名单|personnel|whitelist|objectID=%s", 'alias' => 'addwhitelist'); +$lang->personnel->menu->whitelist = array('link' => "白名单|personnel|whitelist|programID=%s", 'alias' => 'addwhitelist'); /* Scrum menu. */ $lang->product = new stdclass(); diff --git a/module/execution/control.php b/module/execution/control.php index 4b752c0394..6480b21ddd 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -1402,7 +1402,7 @@ class execution extends control $isSprint = true; if($this->config->systemMode == 'new') { - $project = $this->project->getById($this->session->PRJ); + $project = $this->project->getById($execution->project); if($project->model == 'scrum') { unset($this->lang->execution->endList[62]); @@ -1431,8 +1431,8 @@ class execution extends control $this->view->title = $title; $this->view->position = $position; - $this->view->executions = $executions; - $this->view->execution = $execution; + $this->view->executions = $executions; + $this->view->execution = $execution; $this->view->poUsers = $poUsers; $this->view->pmUsers = $pmUsers; $this->view->qdUsers = $qdUsers; @@ -1718,7 +1718,6 @@ class execution extends control if(empty($execution) || strpos('stage,sprint', $execution->type) === false) die(js::error($this->lang->notFound) . js::locate('back')); $this->app->loadLang('program'); - $this->session->PRJ = $execution->project; /* Execution not found to prevent searching for .*/ if(!isset($this->executions[$execution->id])) $this->executions = $this->execution->getPairs($execution->execution, 'all', 'nocode'); @@ -2793,9 +2792,9 @@ class execution extends control unset($fields[$key]); } - $projectID = $from == 'project' ? $this->session->PRJ : 0; + $projectID = $from == 'project' ? $this->session->project : 0; $executionStats = $this->project->getStats($projectID, $status == 'byproduct' ? 'all' : $status, $productID, 0, 30, 'id_asc'); - $users = $this->loadModel('user')->getPairs('noletter'); + $users = $this->loadModel('user')->getPairs('noletter'); foreach($executionStats as $i => $execution) { $execution->PM = zget($users, $execution->PM); diff --git a/module/project/control.php b/module/project/control.php index c44c2dab1c..00b741ffaf 100644 --- a/module/project/control.php +++ b/module/project/control.php @@ -389,7 +389,7 @@ class project extends control $this->action->logHistory($actionID, $changes); } - $locateLink = $this->session->PRJBrowse ? $this->session->PRJBrowse : inLink('view', "projectID=$projectID"); + $locateLink = $this->session->projectBrowse ? $this->session->projectBrowse : inLink('view', "projectID=$projectID"); if($from == 'program') $locateLink = $this->createLink('program', 'browse'); if($from == 'programProject') $locateLink = $this->session->programProject ? $this->session->programProject : $this->createLink('program', 'project', "projectID=$projectID"); $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $locateLink)); @@ -1289,7 +1289,7 @@ class project extends control $diffProducts = array_merge(array_diff($oldProducts, $newProducts), array_diff($newProducts, $oldProducts)); if($diffProducts) $this->loadModel('action')->create('project', $projectID, 'Managed', '', !empty($_POST['products']) ? join(',', $_POST['products']) : ''); - $locateLink = $this->session->PRJBrowse ? $this->session->PRJBrowse : inLink('manageProducts', "projectID=$projectID"); + $locateLink = $this->session->projectBrowse ? $this->session->projectBrowse : inLink('manageProducts', "projectID=$projectID"); if($from == 'program') $locateLink = $this->createLink('program', 'browse'); if($from == 'programproject') $locateLink = $this->session->programProject ? $this->session->programProject : inLink('programProject', "projectID=$projectID"); $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $locateLink)); diff --git a/module/project/model.php b/module/project/model.php index 546cfc2295..a692316456 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -34,7 +34,6 @@ class projectModel extends model { echo(js::alert($this->lang->project->accessDenied)); - unset($_SESSION['PRJ']); die(js::locate(helper::createLink('project', 'index'))); } @@ -1570,7 +1569,7 @@ class projectModel extends model } /* In the case of the waterfall model, calculate the sub-stage. */ - $project = $this->getByID($this->session->PRJ); + $project = $this->getByID($projectID); if($project and $project->model == 'waterfall') { foreach($parents as $id => $execution) From 81e74ec9e567814262584a16fcb480226483d9b2 Mon Sep 17 00:00:00 2001 From: holan20180123 <56391770@qq.com> Date: Fri, 19 Mar 2021 15:41:05 +0800 Subject: [PATCH 16/27] * Fix task #36754. --- module/bug/control.php | 2 +- module/task/control.php | 8 ++++++-- module/task/js/batchedit.js | 4 ++++ module/task/view/batchedit.html.php | 2 +- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/module/bug/control.php b/module/bug/control.php index 528b8d46b5..6b8bc9e44b 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -382,7 +382,7 @@ class bug extends control $this->bug->setMenu($this->products, $productID, $branch); /* Init vars. */ - $projectID = $this->lang->navGroup->bug == 'project' ? $this->session->PRJ : 0; + $projectID = $this->session->PRJ ? $this->session->PRJ : 0; $moduleID = 0; $executionID = 0; $taskID = 0; diff --git a/module/task/control.php b/module/task/control.php index 8b03e21a5a..e39b8b3cb7 100644 --- a/module/task/control.php +++ b/module/task/control.php @@ -475,9 +475,13 @@ class task extends control /* The tasks of my. */ else { - $this->lang->task->menu = $this->lang->my->menu; - $this->lang->task->menuOrder = $this->lang->my->menuOrder; + /* Set my menu. */ $this->loadModel('my')->setMenu(); + $moduleIndex = array_search('task', $this->lang->noMenuModule); + if($moduleIndex !== false) unset($this->lang->noMenuModule[$moduleIndex]); + $this->lang->task->menu = $this->lang->my->workMenu; + $this->lang->my->menu->myWork['subModule'] = 'task'; + $this->view->position[] = html::a($this->createLink('my', 'task'), $this->lang->my->task); $this->view->title = $this->lang->task->batchEdit; $this->view->users = $this->loadModel('user')->getPairs('noletter'); diff --git a/module/task/js/batchedit.js b/module/task/js/batchedit.js index e7fad9c273..32dd170945 100644 --- a/module/task/js/batchedit.js +++ b/module/task/js/batchedit.js @@ -46,3 +46,7 @@ $(document).on('change', 'select', function() } }); +$(function() +{ + $('#subNavbar li[data-id="task"]').addClass('active'); +}); diff --git a/module/task/view/batchedit.html.php b/module/task/view/batchedit.html.php index 52fd386645..e916c07f69 100755 --- a/module/task/view/batchedit.html.php +++ b/module/task/view/batchedit.html.php @@ -91,7 +91,7 @@ js::set('dittoNotice', $dittoNotice); parent < 0) ? "disabled='disabled'" : '';?> '', 'ditto' => $this->lang->task->ditto); - $teamAccounts = array_keys($executionTeams[$tasks[$taskID]->execution]); + $teamAccounts = !empty($executionTeams[$tasks[$taskID]->execution]) ? array_keys($executionTeams[$tasks[$taskID]->execution]) : array(); foreach($teamAccounts as $teamAccount) $members[$teamAccount] = $users[$teamAccount]; $members['closed'] = 'Closed'; From e904c6b39a66efa4bd4bed1d73b8999e924a7aa6 Mon Sep 17 00:00:00 2001 From: holan20180123 <56391770@qq.com> Date: Fri, 19 Mar 2021 16:00:56 +0800 Subject: [PATCH 17/27] * Fix bug #36758. --- module/doc/control.php | 9 +++++++++ module/doc/js/edit.js | 2 ++ module/doc/model.php | 1 + module/my/view/doc.html.php | 6 +++++- 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/module/doc/control.php b/module/doc/control.php index 09ed175f2c..78abec6574 100644 --- a/module/doc/control.php +++ b/module/doc/control.php @@ -448,6 +448,15 @@ class doc extends control $this->doc->setMenu($type, $libID, $doc->module, $lib->product, $lib->execution); } + /* Set my menu. */ + if($this->app->openApp == 'my') + { + $this->lang->doc->menu = $this->lang->my->contributeMenu; + $this->lang->modulePageNav = ''; + $this->lang->TRActions = ''; + $this->lang->my->menu->contribute['subModule'] = 'doc'; + } + $this->view->title = $lib->name . $this->lang->colon . $this->lang->doc->edit; $this->view->position[] = html::a($this->createLink('doc', 'browse', "libID=$libID"), $lib->name); $this->view->position[] = $this->lang->doc->edit; diff --git a/module/doc/js/edit.js b/module/doc/js/edit.js index 39e5b0b754..35a6e4f1d1 100644 --- a/module/doc/js/edit.js +++ b/module/doc/js/edit.js @@ -20,4 +20,6 @@ $(function() $('#urlBox').removeClass('hidden'); } }); + + $('#subNavbar li[data-id="doc"]').addClass('active'); }) diff --git a/module/doc/model.php b/module/doc/model.php index 6470209568..d8533b34d7 100644 --- a/module/doc/model.php +++ b/module/doc/model.php @@ -361,6 +361,7 @@ class docModel extends model $docIDList = $this->dao->select('objectID')->from(TABLE_ACTION) ->where('objectType')->eq('doc') ->andWhere('actor')->eq($this->app->user->account) + ->andWhere('action')->eq('edited') ->fetchAll('objectID'); $docs = $this->dao->select('*')->from(TABLE_DOC) ->where('deleted')->eq(0) diff --git a/module/my/view/doc.html.php b/module/my/view/doc.html.php index b584afeabd..035a071eeb 100644 --- a/module/my/view/doc.html.php +++ b/module/my/view/doc.html.php @@ -25,7 +25,7 @@

- project->empty;?> + doc->noDoc;?>

@@ -35,7 +35,9 @@
+ + @@ -48,7 +50,9 @@ + +
executionCommon;?>
idAB;?>execution->execName : $lang->execution->name;?>execution->execCode : $lang->execution->code;?>'>execution->execPM : $lang->execution->PM;?>execution->$name;?>execution->$code;?>'>execution->$PM;?> '>execution->PO;?> '>execution->QD;?> '>execution->RD;?>'>execution->execType : $lang->execution->type;?>'>execution->execStatus : $lang->execution->status;?>'>execution->$type;?>'>execution->$status;?> execution->begin;?> execution->end;?>'> execution->execDesc : $lang->execution->desc;?>'>execution->$desc;?> '>execution->teamname;?> '>execution->days;?>
name, "class='form-control'");?> code, "class='form-control'");?>' style='overflow:visible'>PM, "class='form-control chosen'");?>' style='overflow:visible'>PM, "class='form-control chosen'");?> ' style='overflow:visible'>PO, "class='form-control chosen'");?> ' style='overflow:visible'>QD, "class='form-control chosen'");?> ' style='overflow:visible'>RD, "class='form-control chosen'");?>
doc->title;?> doc->size;?> doc->addedBy;?> doc->addedDate;?> doc->editedDate;?> actions;?>
createLink('doc', 'view', "docID=$doc->id&version=0&from={$lang->navGroup->doc}"), "  " . $doc->title, '', "title={$doc->title}");?> fileSize ? $doc->fileSize : '-';?> addedBy);?> addedDate, 'y-m-d');?> editedDate, 'y-m-d');?> From c681e42bfb04f7d993d85c5bf5052f05b0db8a5e Mon Sep 17 00:00:00 2001 From: holan20180123 <56391770@qq.com> Date: Fri, 19 Mar 2021 16:09:06 +0800 Subject: [PATCH 18/27] * Finish task #36755. --- module/bug/control.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/module/bug/control.php b/module/bug/control.php index 6b8bc9e44b..ab819af186 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -902,11 +902,12 @@ class bug extends control } } - $this->lang->navGroup->bug = 'my'; - $this->lang->noMenuModule[] = 'bug'; - $this->lang->bug->menu = $this->lang->my->menu; - $this->lang->bug->menuOrder = $this->lang->my->menuOrder; $this->loadModel('my')->setMenu(); + $moduleIndex = array_search('bug', $this->lang->noMenuModule); + if($moduleIndex !== false) unset($this->lang->noMenuModule[$moduleIndex]); + $this->lang->task->menu = $this->lang->my->workMenu; + $this->lang->my->menu->myWork['subModule'] = 'bug'; + $this->view->position[] = html::a($this->createLink('my', 'bug'), $this->lang->my->bug); $this->view->title = "BUG" . $this->lang->bug->batchEdit; } From 781b378e5711e961fabc5dace878a350b438e83a Mon Sep 17 00:00:00 2001 From: leiyong <1549684884@qq.com> Date: Fri, 19 Mar 2021 17:58:48 +0800 Subject: [PATCH 19/27] * Adjust menu. --- module/common/lang/zh-cn.php | 10 +++++----- module/common/model.php | 1 - module/story/control.php | 4 ++-- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/module/common/lang/zh-cn.php b/module/common/lang/zh-cn.php index aefc6cd571..73be2dbdb5 100644 --- a/module/common/lang/zh-cn.php +++ b/module/common/lang/zh-cn.php @@ -382,19 +382,19 @@ $lang->qa->menu = new stdclass(); $lang->qa->menu->index = array('link' => '仪表盘|qa|index'); $lang->qa->menu->bug = array('link' => 'Bug|bug|browse|productID=%s', 'alias' => 'view,create,batchcreate,edit,resolve,close,activate,report,batchedit,batchactivate,confirmbug,assignto'); -$lang->qa->menu->testcase = array('link' => '用例|testcase|browse|productID=%s', 'subModule' => 'testsuite,caselib', 'class' => 'dropdown dropdown-hover'); -$lang->qa->menu->testtask = array('link' => '测试单|testtask|browse|productID=%s', 'subModule' => 'testreport', 'class' => 'dropdown dropdown-hover'); +$lang->qa->menu->testcase = array('link' => '用例|testcase|browse|productID=%s', 'subModule' => 'testcase,testsuite,caselib,story', 'class' => 'dropdown dropdown-hover'); +$lang->qa->menu->testtask = array('link' => '测试单|testtask|browse|productID=%s', 'subModule' => 'testreport,testtask', 'class' => 'dropdown dropdown-hover'); $lang->qa->menu->automation = array('link' => '自动化|automation|browse|productID=%s', 'alias' => '', 'class' => 'dropdown dropdown-hover'); $lang->qa->subMenu = new stdclass(); $lang->qa->subMenu->testcase = new stdclass(); $lang->qa->subMenu->testcase->feature = array('link' => '用例|testcase|browse|productID=%s', 'subModule' => 'testcase,tree,story,testtask'); $lang->qa->subMenu->testcase->testsuite = array('link' => '套件|testsuite|browse|productID=%s', 'subModule' => 'testsuite'); -$lang->qa->subMenu->testcase->caselib = array('link' => '用例库|caselib|browse|libID=0'); +$lang->qa->subMenu->testcase->caselib = array('link' => '用例库|caselib|browse|libID=0', 'subModule' => 'caselib'); $lang->qa->subMenu->testtask = new stdclass(); -$lang->qa->subMenu->testtask->testtask = array('link' => '测试单|testtask|browse|productID=%s', 'alias' => 'view,create,edit,linkcase,cases,start,close,batchrun,groupcase,report,importunitresult'); -$lang->qa->subMenu->testtask->report = array('link' => '报告|testreport|browse|productID=%s', 'alias' => 'view,edit'); +$lang->qa->subMenu->testtask->testtask = array('link' => '测试单|testtask|browse|productID=%s', 'subModule' => 'testtask'); +$lang->qa->subMenu->testtask->report = array('link' => '报告|testreport|browse|productID=%s', 'subModule' => 'testreport'); $lang->qa->subMenu->automation = new stdclass(); $lang->qa->subMenu->automation->browse = array('link' => '介绍|automation|browse|productID=%s', 'alias' => ''); diff --git a/module/common/model.php b/module/common/model.php index b6c1212ec3..2225ba6e49 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -696,7 +696,6 @@ class commonModel extends model /* Avoid highlighting the same navigation method at the same time. */ if($currentModule == 'feedback' and $currentMethod == 'admin') $active = ''; if($currentModule == 'product' and $currentMethod == 'browse') $active = ''; - if($currentModule == 'story') $active = ''; $misc = isset($lang->navGroup->$module) and $openApp != $lang->navGroup->$module ? "data-app='$openApp'" : ''; $menuItemHtml = "
  • " . html::a($link, $label, $target, $misc) . $subMenu . "
  • \n"; diff --git a/module/story/control.php b/module/story/control.php index fd06cfa49e..0c2974d763 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -1451,17 +1451,17 @@ class story extends control $this->session->set('productList', $this->app->getURI(true)); $products = $this->product->getPairs(); - $this->lang->navGroup->story = $from; $moduleIndex = array_search('story', $this->lang->noMenuModule); if($moduleIndex !== false) unset($this->lang->noMenuModule[$moduleIndex]); + if($from == 'qa') { $this->loadModel('qa'); foreach($this->config->qa->menuList as $module) $this->lang->navGroup->$module = 'qa'; } - $this->lang->story->menu = $this->lang->testcase->menu; + $this->lang->story->menu = $this->lang->qa->subMenu->testcase; $this->lang->story->menuOrder = $this->lang->testcase->menuOrder; $this->loadModel('testcase')->setMenu($products, $productID); From dd35ed8c5ba4e4a05a85b1a04378ee2e59ba0144 Mon Sep 17 00:00:00 2001 From: holan20180123 <56391770@qq.com> Date: Fri, 19 Mar 2021 17:59:08 +0800 Subject: [PATCH 20/27] * Finish task #36756. --- module/testcase/control.php | 6 +++--- module/testcase/js/batchedit.js | 1 + module/testtask/control.php | 6 +++--- module/testtask/js/batchrun.js | 5 +++++ 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/module/testcase/control.php b/module/testcase/control.php index a679d4ba53..10b2747ed2 100644 --- a/module/testcase/control.php +++ b/module/testcase/control.php @@ -799,7 +799,6 @@ class testcase extends control $this->view->title = $product->name . $this->lang->colon . $this->lang->testcase->batchEdit; } } - /* The cases of my. */ else { /* Get the edited cases. */ @@ -809,9 +808,10 @@ class testcase extends control ->fetchAll('id'); $caseIDList = array_keys($cases); - $this->lang->testcase->menu = $this->lang->my->menu; - $this->lang->testcase->menuOrder = $this->lang->my->menuOrder; + /* The cases of my. */ $this->loadModel('my')->setMenu(); + $this->lang->testcase->menu = $this->lang->my->workMenu; + $this->lang->my->menu->myWork['subModule'] = 'testcase'; $this->view->position[] = html::a($this->server->http_referer, $this->lang->my->testCase); $this->view->title = $this->lang->testcase->batchEdit; diff --git a/module/testcase/js/batchedit.js b/module/testcase/js/batchedit.js index e9747337f4..618c579d39 100644 --- a/module/testcase/js/batchedit.js +++ b/module/testcase/js/batchedit.js @@ -37,6 +37,7 @@ function loadBranches(product, branch, caseID) $(function() { removeDitto(); //Remove 'ditto' in first row. + $('#subNavbar li[data-id="testcase"]').addClass('active'); }); $(document).on('click', '.chosen-with-drop', function(){oldValue = $(this).prev('select').val();})//Save old value. diff --git a/module/testtask/control.php b/module/testtask/control.php index 7da93ff573..7378af8139 100644 --- a/module/testtask/control.php +++ b/module/testtask/control.php @@ -1095,9 +1095,9 @@ class testtask extends control /* The case of my. */ else { - $this->lang->testtask->menu = $this->lang->my->menu; - $this->lang->testtask->menuOrder = $this->lang->my->menuOrder; - $this->loadModel('my')->setMenu(); + $this->lang->testtask->menu = $this->lang->my->workMenu; + $this->lang->my->menu->myWork['subModule'] = 'testtask'; + $this->view->title = $this->lang->testtask->batchRun; $cases = $this->dao->select('t1.*,t2.id as runID')->from(TABLE_CASE)->alias('t1') diff --git a/module/testtask/js/batchrun.js b/module/testtask/js/batchrun.js index 4554de1f19..a6fb240b16 100644 --- a/module/testtask/js/batchrun.js +++ b/module/testtask/js/batchrun.js @@ -10,3 +10,8 @@ $(document).on('keyup', 'form input:text', function() $(preSelect).val('fail'); } }) + +$(function() +{ + $('#subNavbar li[data-id="testcase"]').addClass('active'); +}) From a6eff425ca4c8224fcc8935929366a5f37d6ba1e Mon Sep 17 00:00:00 2001 From: zhujinyong Date: Sun, 21 Mar 2021 12:15:55 +0800 Subject: [PATCH 21/27] * Adjust menu logic. --- framework/base/helper.class.php | 7 +- module/admin/view/safe.html.php | 2 +- module/automation/control.php | 2 +- module/automation/model.php | 30 - module/backup/view/index.html.php | 2 +- module/bug/control.php | 7 + module/bug/model.php | 13 - module/caselib/model.php | 30 +- module/common/lang/common.php | 142 +++++ module/common/lang/en.php | 51 +- module/common/lang/menu.php | 555 +++++++++++++++++++ module/common/lang/menuOrder.php | 57 +- module/common/lang/zh-cn.php | 727 ++++--------------------- module/common/model.php | 401 ++++++-------- module/common/view/header.html.php | 26 +- module/company/model.php | 2 + module/cron/view/index.html.php | 2 +- module/custom/model.php | 3 +- module/custom/view/timezone.html.php | 2 +- module/doc/control.php | 20 +- module/execution/control.php | 6 +- module/execution/model.php | 59 +- module/group/lang/resource.php | 17 - module/message/view/header.html.php | 2 +- module/personnel/control.php | 40 +- module/product/control.php | 34 +- module/product/model.php | 54 +- module/productplan/control.php | 5 +- module/program/control.php | 15 +- module/program/model.php | 6 + module/project/control.php | 68 +-- module/project/model.php | 17 + module/project/view/group.html.php | 2 +- module/projectrelease/control.php | 9 +- module/qa/control.php | 1 - module/qa/model.php | 6 +- module/release/control.php | 5 +- module/repo/model.php | 5 +- module/search/view/buildindex.html.php | 2 +- module/story/control.php | 10 +- module/testcase/model.php | 22 +- module/testreport/control.php | 4 +- module/testsuite/control.php | 4 +- module/testsuite/model.php | 33 -- module/testtask/control.php | 5 +- module/testtask/model.php | 72 --- module/tree/control.php | 12 +- module/tree/view/browse.html.php | 4 +- module/webhook/view/header.html.php | 2 +- 49 files changed, 1212 insertions(+), 1390 deletions(-) create mode 100644 module/common/lang/common.php create mode 100644 module/common/lang/menu.php diff --git a/framework/base/helper.class.php b/framework/base/helper.class.php index 703d5ec08f..c04e7904bf 100644 --- a/framework/base/helper.class.php +++ b/framework/base/helper.class.php @@ -215,15 +215,12 @@ class baseHelper { if(is_array($idList)) { - if(!function_exists('get_magic_quotes_gpc') or !get_magic_quotes_gpc()) - { - foreach($idList as $key=>$value) $idList[$key] = addslashes($value); - } + foreach($idList as $key=>$value) $idList[$key] = addslashes($value); return "IN ('" . join("','", $idList) . "')"; } if(!is_string($idList)) $idList = json_encode($idList); - if(!function_exists('get_magic_quotes_gpc') or !get_magic_quotes_gpc()) $idList = addslashes($idList); + $idList = addslashes($idList); return "IN ('" . str_replace(',', "','", str_replace(' ', '', $idList)) . "')"; } diff --git a/module/admin/view/safe.html.php b/module/admin/view/safe.html.php index e020158c19..738fb25ca6 100644 --- a/module/admin/view/safe.html.php +++ b/module/admin/view/safe.html.php @@ -14,7 +14,7 @@
    diff --git a/module/automation/control.php b/module/automation/control.php index c81ec5bedf..c686ef87fe 100644 --- a/module/automation/control.php +++ b/module/automation/control.php @@ -61,7 +61,7 @@ class automation extends control /* Set menu. */ $productID = $this->product->saveState($productID, $this->products); if(empty($branch)) $branch = (int)$this->cookie->preBranch; - $this->automation->setMenu($this->products, $productID, $branch); + $this->loadModel('qa')->setMenu($this->products, $productID, $branch); $this->view->title = $this->lang->automation->common; $this->view->position[] = $this->lang->automation->browse; diff --git a/module/automation/model.php b/module/automation/model.php index 9af5349169..720c9b4b80 100644 --- a/module/automation/model.php +++ b/module/automation/model.php @@ -13,34 +13,4 @@ loadModel('product'); - foreach($this->lang->testtask->menu as $key => $value) - { - if($this->lang->navGroup->testtask != 'qa') $this->loadModel('qa')->setSubMenu('automation', $key, $productID); - common::setMenuVars($this->lang->testtask->menu, $key, $productID); - } - - if($this->lang->navGroup->automation == 'qa') - { - foreach($this->lang->qa->subMenu->automation as $key => $menu) - { - common::setMenuVars($this->lang->qa->subMenu->automation, $key, $productID); - } - $this->lang->qa->menu = $this->lang->automation->menu; - $this->lang->automation->menu = $this->lang->qa->subMenu->automation; - $this->lang->qa->switcherMenu = $this->product->getSwitcher($productID, '', $branch); - } - } - } diff --git a/module/backup/view/index.html.php b/module/backup/view/index.html.php index 34d3759544..9d61e02d1c 100644 --- a/module/backup/view/index.html.php +++ b/module/backup/view/index.html.php @@ -17,7 +17,7 @@