* Fix bug#16188.
This commit is contained in:
@@ -532,7 +532,7 @@ class bug extends control
|
||||
if($user) $productMembers[$assignedTo] = $user->realname;
|
||||
}
|
||||
|
||||
$moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'bug', $startModuleID = 0, $branch);
|
||||
$moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'bug', $startModuleID = 0, $branch === 'all' ? 0 : $branch);
|
||||
if(empty($moduleOptionMenu)) die(js::locate(helper::createLink('tree', 'browse', "productID=$productID&view=story")));
|
||||
|
||||
/* Get products and projects. */
|
||||
@@ -722,7 +722,7 @@ class bug extends control
|
||||
$this->view->users = $this->user->getPairs('devfirst|nodeleted');
|
||||
$this->view->executions = array('' => '') + $this->product->getExecutionPairsByProduct($productID, $branch ? "0,$branch" : 0, 'id_desc', $projectID);
|
||||
$this->view->executionID = $executionID;
|
||||
$this->view->moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'bug', $startModuleID = 0, $branch);
|
||||
$this->view->moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'bug', $startModuleID = 0, $branch === 'all' ? 0 : $branch);
|
||||
$this->view->moduleID = $moduleID;
|
||||
$this->view->branch = $branch;
|
||||
$this->view->branches = $this->loadModel('branch')->getPairs($productID);
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<div class='main-header'>
|
||||
<h2>
|
||||
<?php echo $lang->bug->batchCreate;?>
|
||||
<?php if($this->session->currentProductType !== 'normal') echo '<span class="label label-info">' . $branches[$branch] . '</span>';?>
|
||||
<?php if($this->session->currentProductType !== 'normal' and $branch !== 'all') echo '<span class="label label-info">' . $branches[$branch] . '</span>';?>
|
||||
</h2>
|
||||
<div class="pull-right btn-toolbar">
|
||||
<?php if(common::hasPriv('file', 'uploadImages')) echo html::a($this->createLink('file', 'uploadImages', 'module=bug¶ms=' . helper::safe64Encode("productID=$productID&executionID=$executionID&moduleID=$moduleID")), $lang->uploadImages, '', "data-toggle='modal' data-type='iframe' class='btn btn-primary' data-width='70%'")?>
|
||||
|
||||
@@ -367,7 +367,7 @@ $currentBrowseType = isset($lang->bug->mySelects[$browseType]) && in_array($brow
|
||||
</div>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
<?php if($canBatchChangeModule):?>
|
||||
<?php if($canBatchChangeModule and $branch !== 'all'):?>
|
||||
<div class="btn-group dropup">
|
||||
<button data-toggle="dropdown" type="button" class="btn"><?php echo $lang->bug->moduleAB;?> <span class="caret"></span></button>
|
||||
<?php $withSearch = count($modules) > 8;?>
|
||||
|
||||
@@ -437,7 +437,7 @@ $projectIDParam = $isProjectStory ? "projectID=$projectID&" : '';
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<?php if($canBatchChangeModule):?>
|
||||
<?php if($canBatchChangeModule and $branch !== 'all'):?>
|
||||
<div class="btn-group dropup">
|
||||
<button data-toggle="dropdown" type="button" class="btn"><?php echo $lang->story->moduleAB;?> <span class="caret"></span></button>
|
||||
<?php $withSearch = count($modules) > 8;?>
|
||||
|
||||
@@ -197,7 +197,7 @@ class story extends control
|
||||
}
|
||||
|
||||
$users = $this->user->getPairs('pdfirst|noclosed|nodeleted');
|
||||
$moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'story', 0, $branch);
|
||||
$moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'story', 0, $branch === 'all' ? 0 : $branch);
|
||||
if(empty($moduleOptionMenu)) die(js::locate(helper::createLink('tree', 'browse', "productID=$productID&view=story")));
|
||||
|
||||
/* Init vars. */
|
||||
@@ -435,7 +435,7 @@ class story extends control
|
||||
/* Set products and module. */
|
||||
$product = $this->product->getById($productID);
|
||||
$products = $this->product->getPairs();
|
||||
$moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'story', 0, $branch);
|
||||
$moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'story', 0, $branch === 'all' ? 0 : $branch);
|
||||
|
||||
if($product) $this->lang->product->branch = sprintf($this->lang->product->branch, $this->lang->product->branchName[$product->type]);
|
||||
|
||||
|
||||
@@ -459,7 +459,7 @@ class testcase extends control
|
||||
$this->view->projectID = isset($projectID) ? $projectID : 0;
|
||||
$this->view->productID = $productID;
|
||||
$this->view->productName = $this->products[$productID];
|
||||
$this->view->moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'case', $startModuleID = 0, $branch);
|
||||
$this->view->moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'case', $startModuleID = 0, $branch === 'all' ? 0 : $branch);
|
||||
$this->view->currentModuleID = $currentModuleID;
|
||||
$this->view->gobackLink = (isset($output['from']) and $output['from'] == 'global') ? $this->createLink('testcase', 'browse', "productID=$productID") : '';
|
||||
$this->view->stories = $stories;
|
||||
@@ -526,7 +526,7 @@ class testcase extends control
|
||||
$storyList = $storyID ? array($storyID => $story->id . ':' . $story->title) : array('');
|
||||
|
||||
/* Set module option menu. */
|
||||
$moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'case', $startModuleID = 0, $branch);
|
||||
$moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'case', $startModuleID = 0, $branch === 'all' ? 0 : $branch);
|
||||
$moduleOptionMenu['ditto'] = $this->lang->testcase->ditto;
|
||||
|
||||
/* Set custom. */
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<div class="main-header">
|
||||
<h2>
|
||||
<?php echo $lang->testcase->batchCreate;?>
|
||||
<?php if($this->session->currentProductType !== 'normal') echo '<span class="label label-info">' . $branches[$branch] . '</span>';?>
|
||||
<?php if($this->session->currentProductType !== 'normal' and $branch !== 'all') echo '<span class="label label-info">' . $branches[$branch] . '</span>';?>
|
||||
<?php if($story):?>
|
||||
<small class='text' title='<?php echo $story->title ?>'><?php echo $lang->arrow . $story->title ?></small>
|
||||
<?php endif;?>
|
||||
|
||||
@@ -207,7 +207,7 @@ js::set('suiteID', $suiteID);
|
||||
</div>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
<?php if($canBatchChangeModule and !empty($productID)):?>
|
||||
<?php if($canBatchChangeModule and !empty($productID) and $branch !== 'all'):?>
|
||||
<div class="btn-group dropup">
|
||||
<button data-toggle="dropdown" type="button" class="btn"><?php echo $lang->story->moduleAB;?> <span class="caret"></span></button>
|
||||
<?php $withSearch = count($modules) > 10;?>
|
||||
|
||||
@@ -87,7 +87,7 @@ class treeModel extends model
|
||||
->beginIF($type != 'task')->andWhere('type')->in("story,$type")->fi()
|
||||
->beginIF($startModulePath)->andWhere('path')->like($startModulePath)->fi()
|
||||
->beginIF($branch === 'null')->andWhere('branch')->eq(0)->fi()
|
||||
->beginIF((($branch or $branch === 0) and $branch !== 'null'))->andWhere("branch")->eq($branch)->fi()
|
||||
->beginIF((($branch or $branch === 0) and $branch !== 'null' and $branch !== 'all'))->andWhere("branch")->eq($branch)->fi()
|
||||
->andWhere('deleted')->eq(0)
|
||||
->orderBy('grade desc, `order`, type desc')
|
||||
->get();
|
||||
@@ -99,7 +99,7 @@ class treeModel extends model
|
||||
->andWhere('type')->eq($type)
|
||||
->beginIF($startModulePath)->andWhere('path')->like($startModulePath)->fi()
|
||||
->beginIF($branch === 'null')->andWhere('branch')->eq(0)->fi()
|
||||
->beginIF((($branch or $branch === 0) and $branch !== 'null'))->andWhere("branch")->eq($branch)->fi()
|
||||
->beginIF((($branch or $branch === 0) and $branch !== 'null' and $branch !== 'all'))->andWhere("branch")->eq($branch)->fi()
|
||||
->andWhere('deleted')->eq(0)
|
||||
->orderBy('grade desc, `order`')
|
||||
->get();
|
||||
@@ -126,13 +126,11 @@ class treeModel extends model
|
||||
$product = $this->loadModel('product')->getById($rootID);
|
||||
if($product and $product->type != 'normal')
|
||||
{
|
||||
$branches = array('null' => '') + $this->loadModel('branch')->getPairs($rootID, 'all');
|
||||
if($branch)
|
||||
{
|
||||
$newBranches['null'] = '';
|
||||
$newBranches[$branch] = $branches[$branch];
|
||||
$branches = $newBranches;
|
||||
}
|
||||
$branchList = array('null' => '') + $this->loadModel('branch')->getPairs($rootID, 'all');
|
||||
|
||||
if(!$branch) $newBranches['null'] = '';
|
||||
$newBranches[$branch] = $branchList[$branch];
|
||||
$branches = $branch === 'all' ? $branchList : $newBranches;
|
||||
}
|
||||
elseif($product and $product->type == 'normal')
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user