From c657433fa203e56f5de669dde602ce4e16a992ea Mon Sep 17 00:00:00 2001 From: wangyidong Date: Fri, 20 Nov 2015 10:45:18 +0800 Subject: [PATCH] * adjust code and fix bug. --- module/branch/control.php | 2 +- module/bug/control.php | 10 +++++----- module/bug/view/batchcreate.html.php | 2 +- module/story/control.php | 6 +++--- module/testcase/control.php | 2 +- module/testcase/view/batchcreate.html.php | 2 +- module/testtask/control.php | 2 +- module/tree/model.php | 3 ++- 8 files changed, 15 insertions(+), 14 deletions(-) diff --git a/module/branch/control.php b/module/branch/control.php index 9c0fa88040..1dad07ae1b 100644 --- a/module/branch/control.php +++ b/module/branch/control.php @@ -115,6 +115,6 @@ class branch extends control $branches = $this->branch->getPairs($productID); if($oldBranch) $branches = array($oldBranch => $branches[$oldBranch]); - die(html::select('branch', $branches, '', "class='form-control' onchange='loadBranch()'")); + die(html::select('branch', $branches, '', "class='form-control' onchange='loadBranch(this)'")); } } diff --git a/module/bug/control.php b/module/bug/control.php index 81d27888e3..83aa91d733 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -691,7 +691,7 @@ class bug extends control $bug = $this->bug->getById($bugID); /* Set menu. */ - $this->bug->setMenu($this->products, $bug->product); + $this->bug->setMenu($this->products, $bug->product, $bug->branch); if(!empty($_POST)) { @@ -764,7 +764,7 @@ class bug extends control $bug = $this->bug->getById($bugID); $productID = $bug->product; - $this->bug->setMenu($this->products, $productID); + $this->bug->setMenu($this->products, $productID, $bug->branch); $this->view->title = $this->products[$productID] . $this->lang->colon . $this->lang->bug->confirmBug; $this->view->position[] = html::a($this->createLink('bug', 'browse', "productID=$productID"), $this->products[$productID]); @@ -832,7 +832,7 @@ class bug extends control $assignedTo = $bug->openedBy; if(!isset($users[$assignedTo])) $assignedTo = $this->bug->getModuleOwner($bug->module, $productID); - $this->bug->setMenu($this->products, $productID); + $this->bug->setMenu($this->products, $productID, $bug->branch); $this->view->title = $this->products[$productID] . $this->lang->colon . $this->lang->bug->resolve; $this->view->position[] = html::a($this->createLink('bug', 'browse', "productID=$productID"), $this->products[$productID]); @@ -889,7 +889,7 @@ class bug extends control $bug = $this->bug->getById($bugID); $productID = $bug->product; - $this->bug->setMenu($this->products, $productID); + $this->bug->setMenu($this->products, $productID, $bug->branch); $this->view->title = $this->products[$productID] . $this->lang->colon . $this->lang->bug->activate; $this->view->position[] = html::a($this->createLink('bug', 'browse', "productID=$productID"), $this->products[$productID]); @@ -924,7 +924,7 @@ class bug extends control $bug = $this->bug->getById($bugID); $productID = $bug->product; - $this->bug->setMenu($this->products, $productID); + $this->bug->setMenu($this->products, $productID, $bug->branch); $this->view->title = $this->products[$productID] . $this->lang->colon . $this->lang->bug->close; $this->view->position[] = html::a($this->createLink('bug', 'browse', "productID=$productID"), $this->products[$productID]); diff --git a/module/bug/view/batchcreate.html.php b/module/bug/view/batchcreate.html.php index 0be8fd8f1a..850bb0ba8e 100644 --- a/module/bug/view/batchcreate.html.php +++ b/module/bug/view/batchcreate.html.php @@ -16,8 +16,8 @@ icons['bug']);?> icons['batchCreate']);?> - session->currentProductType !== 'normal') echo '' . $branches[$branch] . '';?> bug->common . $lang->colon . $lang->bug->batchCreate;?> + session->currentProductType !== 'normal') echo '' . $branches[$branch] . '';?>
createLink('file', 'uploadImages', 'module=bug¶ms=' . helper::safe64Encode("productID=$productID&projectID=$projectID&moduleID=$moduleID")), $lang->uploadImages, '', "data-toggle='modal' data-type='iframe' class='btn' data-width='600px'")?> diff --git a/module/story/control.php b/module/story/control.php index 070e74ec6f..3d8191456a 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -286,7 +286,7 @@ class story extends control $moduleOptionMenu = $this->tree->getOptionMenu($product->id, $viewType = 'story', 0, $story->branch); /* Set menu. */ - $this->product->setMenu($products, $product->id); + $this->product->setMenu($products, $product->id, $story->branch); /* Assign. */ $this->view->position[] = html::a($this->createLink('product', 'browse', "product=$product->id&branch=$story->branch"), $product->name); @@ -609,7 +609,7 @@ class story extends control $product = $this->dao->findById($story->product)->from(TABLE_PRODUCT)->fields('name, id')->fetch(); /* Set menu. */ - $this->product->setMenu($this->product->getPairs(), $product->id); + $this->product->setMenu($this->product->getPairs(), $product->id, $story->branch); /* Set the review result options. */ if($story->status == 'draft' and $story->version == 1) unset($this->lang->story->reviewResultList['revert']); @@ -678,7 +678,7 @@ class story extends control $product = $this->dao->findById($story->product)->from(TABLE_PRODUCT)->fields('name, id')->fetch(); /* Set menu. */ - $this->product->setMenu($this->product->getPairs(), $product->id); + $this->product->setMenu($this->product->getPairs(), $product->id, $story->branch); /* Set the closed reason options. */ if($story->status == 'draft') unset($this->lang->story->reasonList['cancel']); diff --git a/module/testcase/control.php b/module/testcase/control.php index 3c676aa74b..815505fd23 100644 --- a/module/testcase/control.php +++ b/module/testcase/control.php @@ -396,7 +396,7 @@ class testcase extends control $currentModuleID = (int)$moduleID; /* Set menu. */ - $this->testcase->setMenu($this->products, $productID); + $this->testcase->setMenu($this->products, $productID, $branch); /* Init vars. */ $type = 'feature'; diff --git a/module/testcase/view/batchcreate.html.php b/module/testcase/view/batchcreate.html.php index 40cae6bdb7..033c5071ce 100644 --- a/module/testcase/view/batchcreate.html.php +++ b/module/testcase/view/batchcreate.html.php @@ -19,8 +19,8 @@ icons['testcase']);?> icons['batchCreate']);?> - session->currentProductType !== 'normal') echo '' . $branches[$branch] . '';?> testcase->batchCreate;?> + session->currentProductType !== 'normal') echo '' . $branches[$branch] . '';?> icons['story']) . ' ' . $story->title ?> diff --git a/module/testtask/control.php b/module/testtask/control.php index 2fb8e9dc81..1f36d2bf9d 100644 --- a/module/testtask/control.php +++ b/module/testtask/control.php @@ -317,7 +317,7 @@ class testtask extends control $this->view->productName = $this->products[$productID]; $this->view->task = $task; $this->view->users = $this->loadModel('user')->getPairs('noclosed,nodeleted,qafirst'); - $this->view->moduleTree = $this->loadModel('tree')->getTreeMenu($productID, $viewType = 'case', $startModuleID = 0, array('treeModel', 'createTestTaskLink'), $extra = $taskID, $task->branch); + $this->view->moduleTree = $this->loadModel('tree')->getTreeMenu($productID, $viewType = 'case', $startModuleID = 0, array('treeModel', 'createTestTaskLink'), $extra = $taskID); $this->view->browseType = $browseType; $this->view->param = $param; $this->view->orderBy = $orderBy; diff --git a/module/tree/model.php b/module/tree/model.php index d7ac6e2bf8..558b23feeb 100644 --- a/module/tree/model.php +++ b/module/tree/model.php @@ -290,7 +290,8 @@ class treeModel extends model ksort($treeMenu); if(!empty($branchID) and $branch and $branchID != 'null') { - $linkHtml = $manage ? html::a(inlink('browse', "root=$rootID&viewType=$type¤tModuleID=0&branch=$branchID"), $branch) : $this->createBranchLink($type, $rootID, $branchID, $branch); + $linkHtml = ($type == 'case' and !empty($extra)) ? $branch : $this->createBranchLink($type, $rootID, $branchID, $branch); + $linkHtml = $manage ? html::a(inlink('browse', "root=$rootID&viewType=$type¤tModuleID=0&branch=$branchID"), $branch) : $linkHtml; if($firstBranch and $product->type != 'normal') { $linkHtml = $this->lang->product->branchName[$product->type] . '