* Fix bug #16605.
This commit is contained in:
@@ -205,8 +205,7 @@ class branch extends control
|
||||
*/
|
||||
public function ajaxGetDropMenu($productID, $branch = 0, $module, $method, $extra = '')
|
||||
{
|
||||
$products = $this->loadModel('execution')->getBranchByProduct($productID, $extra, 'all');
|
||||
$branches = $products[$productID];
|
||||
$branches = $this->branch->getPairs($productID, 'all', empty($extra) ? $extra : 0);
|
||||
$statusList = $this->dao->select('id,status')->from(TABLE_BRANCH)->where('product')->eq($productID)->fetchPairs();
|
||||
|
||||
$this->view->link = $this->loadModel('product')->getProductLink($module, $method, $extra, true);
|
||||
|
||||
@@ -1635,13 +1635,12 @@ class executionModel extends model
|
||||
*
|
||||
* @param array $products
|
||||
* @param int $projectID
|
||||
* @param string $status
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getBranchByProduct($products, $projectID = 0, $status = 'noclosed')
|
||||
public function getBranchByProduct($products, $projectID = 0)
|
||||
{
|
||||
$branchGroups = $this->loadModel('branch')->getByProducts($products, $status);
|
||||
$branchGroups = $this->loadModel('branch')->getByProducts($products, 'noclosed');
|
||||
|
||||
if($projectID)
|
||||
{
|
||||
|
||||
@@ -75,8 +75,7 @@ class productModel extends model
|
||||
*/
|
||||
public function select($products, $productID, $currentModule, $currentMethod, $extra = '', $branch = '', $module = 0, $moduleType = '', $withBranch = true)
|
||||
{
|
||||
$browseBugMethod = ',bug,testcase,testtask,ajaxselectstory,groupcase,zerocase,browseunits,';
|
||||
$isBrowseBug = (strpos(',project,execution,', ",{$this->app->tab},") !== false and strpos($browseBugMethod, ",{$this->app->rawMethod},") !== false and isset($products)) ? true : false;
|
||||
$isBrowseBug = (strpos(',project,execution,', ",{$this->app->tab},") !== false and strpos(',bug,testcase,testtask,ajaxselectstory,', ",{$this->app->rawMethod},") !== false and isset($products[0])) ? true : false;
|
||||
|
||||
$this->app->loadLang('product');
|
||||
if(!$isBrowseBug and !$productID)
|
||||
|
||||
@@ -1687,7 +1687,7 @@ class story extends control
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function zeroCase($productID = 0, $branchID = 0, $orderBy = 'id_desc')
|
||||
public function zeroCase($productID = 0, $branchID = 0, $orderBy = 'id_desc', $projectID = 0)
|
||||
{
|
||||
$this->session->set('storyList', $this->app->getURI(true) . '#app=' . $this->app->tab, 'product');
|
||||
$this->session->set('caseList', $this->app->getURI(true), $this->app->tab);
|
||||
@@ -1700,7 +1700,7 @@ class story extends control
|
||||
$this->lang->project->menu->qa['subMenu']->testcase['subModule'] = 'story';
|
||||
$products = $this->product->getProducts($this->session->project, 'all', '', false);
|
||||
$productID = $this->product->saveState($productID, $products);
|
||||
$this->lang->modulePageNav = $this->product->select($products, $productID, 'story', 'zeroCase', '', $branchID);
|
||||
$this->lang->modulePageNav = $this->product->select($products, $productID, 'story', 'zeroCase', $projectID, $branchID);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1721,6 +1721,7 @@ class story extends control
|
||||
|
||||
$this->view->stories = $this->story->getZeroCase($productID, $branchID, $sort);
|
||||
$this->view->users = $this->user->getPairs('noletter');
|
||||
$this->view->projectID = $projectID;
|
||||
$this->view->productID = $productID;
|
||||
$this->view->branchID = $branchID;
|
||||
$this->view->orderBy = $orderBy;
|
||||
|
||||
@@ -197,6 +197,7 @@ class testcase extends control
|
||||
$this->view->title = $this->products[$productID] . $this->lang->colon . $this->lang->testcase->common;
|
||||
$this->view->position[] = html::a($this->createLink('testcase', 'browse', "productID=$productID&branch=$branch"), $this->products[$productID]);
|
||||
$this->view->position[] = $this->lang->testcase->common;
|
||||
$this->view->projectID = $projectID;
|
||||
$this->view->productID = $productID;
|
||||
$this->view->product = $product;
|
||||
$this->view->productName = $this->products[$productID];
|
||||
@@ -230,7 +231,7 @@ class testcase extends control
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function groupCase($productID = 0, $branch = '', $groupBy = 'story')
|
||||
public function groupCase($productID = 0, $branch = '', $groupBy = 'story', $projectID = 0)
|
||||
{
|
||||
$groupBy = empty($groupBy) ? 'story' : $groupBy;
|
||||
$productID = $this->product->saveState($productID, $this->products);
|
||||
@@ -242,7 +243,7 @@ class testcase extends control
|
||||
if($this->app->tab == 'project')
|
||||
{
|
||||
$products = array('0' => $this->lang->product->all) + $this->product->getProducts($this->session->project, 'all', '', false);
|
||||
$this->lang->modulePageNav = $this->product->select($products, $productID, 'testcase', 'groupCase', '', $branch);
|
||||
$this->lang->modulePageNav = $this->product->select($products, $productID, 'testcase', 'groupCase', $projectID, $branch);
|
||||
}
|
||||
|
||||
$this->session->set('caseList', $this->app->getURI(true), $this->app->tab);
|
||||
@@ -269,6 +270,7 @@ class testcase extends control
|
||||
$this->view->title = $this->products[$productID] . $this->lang->colon . $this->lang->testcase->common;
|
||||
$this->view->position[] = html::a($this->createLink('testcase', 'groupTask', "productID=$productID&groupBy=$groupBy"), $this->products[$productID]);
|
||||
$this->view->position[] = $this->lang->testcase->common;
|
||||
$this->view->projectID = $projectID;
|
||||
$this->view->productID = $productID;
|
||||
$this->view->productName = $this->products[$productID];
|
||||
$this->view->users = $this->user->getPairs('noletter');
|
||||
|
||||
@@ -89,7 +89,7 @@
|
||||
$active = !empty($groupBy) ? 'btn-active-text' : '';
|
||||
|
||||
echo "<div id='groupTab' class='btn-group'>";
|
||||
echo html::a($this->createLink('testcase', 'groupCase', "productID=$productID&branch=$branch&groupBy=story"), "<span class='text'>{$lang->testcase->groupByStories}</span>", '', "class='btn btn-link $active' data-app='{$this->app->tab}'");
|
||||
echo html::a($this->createLink('testcase', 'groupCase', "productID=$productID&branch=$branch&groupBy=story&projectID=$projectID"), "<span class='text'>{$lang->testcase->groupByStories}</span>", '', "class='btn btn-link $active' data-app='{$this->app->tab}'");
|
||||
echo '</div>';
|
||||
}
|
||||
elseif($hasZeroPriv and $menuType == 'zerocase')
|
||||
@@ -99,7 +99,7 @@
|
||||
}
|
||||
elseif($hasUnitPriv and $menuType == 'browseunits')
|
||||
{
|
||||
echo html::a($this->createLink('testtask', 'browseUnits', "productID=$productID"), "<span class='text'>{$lang->testcase->browseUnits}</span>", '', "class='btn btn-link' id='browseunitsTab' data-app='{$this->app->tab}'");
|
||||
echo html::a($this->createLink('testtask', 'browseUnits', "productID=$productID&browseType=newest&orderBy=id_desc&recTotal=0&recPerPage=20&pageID=1&projectID=$projectID"), "<span class='text'>{$lang->testcase->browseUnits}</span>", '', "class='btn btn-link' id='browseunitsTab' data-app='{$this->app->tab}'");
|
||||
}
|
||||
?>
|
||||
<?php endforeach;?>
|
||||
|
||||
@@ -152,7 +152,7 @@ class testtask extends control
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function browseUnits($productID = 0, $browseType = 'newest', $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
|
||||
public function browseUnits($productID = 0, $browseType = 'newest', $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1, $projectID = 0)
|
||||
{
|
||||
/* Save session. */
|
||||
$this->session->set('testtaskList', $this->app->getURI(true), 'qa');
|
||||
@@ -175,7 +175,7 @@ class testtask extends control
|
||||
}
|
||||
|
||||
$this->loadModel('project')->setMenu($this->session->project);
|
||||
$this->lang->modulePageNav = $this->product->select($this->products, $productID, 'testtask', 'browseUnits');
|
||||
$this->lang->modulePageNav = $this->product->select($this->products, $productID, 'testtask', 'browseUnits', $projectID);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -194,6 +194,7 @@ class testtask extends control
|
||||
$this->view->title = $this->products[$productID] . $this->lang->colon . $this->lang->testtask->common;
|
||||
$this->view->position[] = html::a($this->createLink('testtask', 'browseUnits', "productID=$productID"), $this->products[$productID]);
|
||||
$this->view->position[] = $this->lang->testtask->common;
|
||||
$this->view->projectID = $projectID;
|
||||
$this->view->productID = $productID;
|
||||
$this->view->productName = $this->products[$productID];
|
||||
$this->view->orderBy = $orderBy;
|
||||
|
||||
Reference in New Issue
Block a user