* adjust code and fix bug.

This commit is contained in:
wangyidong
2015-11-20 10:45:18 +08:00
parent 7374c81949
commit c657433fa2
8 changed files with 15 additions and 14 deletions

View File

@@ -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)'"));
}
}

View File

@@ -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]);

View File

@@ -16,8 +16,8 @@
<span class='prefix'><?php echo html::icon($lang->icons['bug']);?></span>
<strong>
<small class='text-muted'><?php echo html::icon($lang->icons['batchCreate']);?></small>
<?php if($this->session->currentProductType !== 'normal') echo '<span class="label label-info">' . $branches[$branch] . '</span>';?>
<?php echo $lang->bug->common . $lang->colon . $lang->bug->batchCreate;?>
<?php if($this->session->currentProductType !== 'normal') echo '<span class="label label-info">' . $branches[$branch] . '</span>';?>
</strong>
<div class='actions'>
<?php if(common::hasPriv('file', 'uploadImages')) echo html::a($this->createLink('file', 'uploadImages', 'module=bug&params=' . helper::safe64Encode("productID=$productID&projectID=$projectID&moduleID=$moduleID")), $lang->uploadImages, '', "data-toggle='modal' data-type='iframe' class='btn' data-width='600px'")?>

View File

@@ -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']);

View File

@@ -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';

View File

@@ -19,8 +19,8 @@
<span class='prefix'><?php echo html::icon($lang->icons['testcase']);?></span>
<strong>
<small class='text-muted'><?php echo html::icon($lang->icons['batchCreate']);?></small>
<?php if($this->session->currentProductType !== 'normal') echo '<span class="label label-info">' . $branches[$branch] . '</span>';?>
<?php echo $lang->testcase->batchCreate;?>
<?php if($this->session->currentProductType !== 'normal') echo '<span class="label label-info">' . $branches[$branch] . '</span>';?>
</strong>
<?php if($story):?>
<small class='text-muted'><?php echo html::icon($lang->icons['story']) . ' ' . $story->title ?></small>

View File

@@ -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;

View File

@@ -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&currentModuleID=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&currentModuleID=0&branch=$branchID"), $branch) : $linkHtml;
if($firstBranch and $product->type != 'normal')
{
$linkHtml = $this->lang->product->branchName[$product->type] . '<ul><li>' . $linkHtml;