This commit is contained in:
holan20180123
2021-03-12 15:01:08 +08:00
parent eee180eb5e
commit 39a273978c
3 changed files with 34 additions and 26 deletions
+26 -22
View File
@@ -13,8 +13,8 @@ class branchModel extends model
{
/**
* Get name by id.
*
* @param int $branchID
*
* @param int $branchID
* @access public
* @return string
*/
@@ -32,15 +32,19 @@ class branchModel extends model
/**
* Get pairs.
*
* @param int $productID
* @param string $params
*
* @param int $productID
* @param string $params
* @access public
* @return array
*/
public function getPairs($productID, $params = '')
{
$branches = $this->dao->select('*')->from(TABLE_BRANCH)->where('product')->eq($productID)->andWhere('deleted')->eq(0)->orderBy('`order`')->fetchPairs('id', 'name');
$branches = $this->dao->select('*')->from(TABLE_BRANCH)
->where('deleted')->eq(0)
->beginIF($productID)->andWhere('product')->eq($productID)->fi()
->orderBy('`order`')
->fetchPairs('id', 'name');
foreach($branches as $branchID => $branchName) $branches[$branchID] = htmlspecialchars_decode($branchName);
if(strpos($params, 'noempty') === false)
@@ -55,8 +59,8 @@ class branchModel extends model
/**
* Get all pairs.
*
* @param string $params
*
* @param string $params
* @access public
* @return array
*/
@@ -85,9 +89,9 @@ class branchModel extends model
}
/**
* Manage branch
*
* @param int $productID
* Manage branch
*
* @param int $productID
* @access public
* @return bool
*/
@@ -112,11 +116,11 @@ class branchModel extends model
}
/**
* Get branch group by products
*
* @param array $products
* @param string $params
* @param array $appendBranch
* Get branch group by products
*
* @param array $products
* @param string $params
* @param array $appendBranch
* @access public
* @return array
*/
@@ -152,8 +156,8 @@ class branchModel extends model
/**
* Get product bype by branch.
*
* @param int $branchID
*
* @param int $branchID
* @access public
* @return void
*/
@@ -166,8 +170,8 @@ class branchModel extends model
}
/**
* Sort branch.
*
* Sort branch.
*
* @access public
* @return void
*/
@@ -183,8 +187,8 @@ class branchModel extends model
/**
* Check branch data.
*
* @param int $branchID
*
* @param int $branchID
* @access public
* @return bool
*/
+1 -1
View File
@@ -211,7 +211,7 @@ class bug extends control
$this->view->moduleID = $moduleID;
$this->view->memberPairs = $this->user->getPairs('noletter|nodeleted');
$this->view->branch = $branch;
$this->view->branches = $this->loadModel('branch')->getPairs($productID);
$this->view->branches = $this->loadModel('branch')->getPairs($productID, 'noempty');
$this->view->executions = $executions;
$this->view->plans = $this->loadModel('productplan')->getPairs($productID);
$this->view->stories = $storyList;
+7 -3
View File
@@ -193,8 +193,12 @@ class treeModel extends model
{
/* When case with libIdList then append lib modules. */
$modules = array();
if($this->isMergeModule($rootID, $viewType)) $viewType .= ',story';
$modules += $this->dao->select('id,name,path,short')->from(TABLE_MODULE)->where('root')->eq($rootID)->andWhere('type')->in($viewType)->andWhere('deleted')->eq(0)->fetchAll('id');
if($this->isMergeModule($rootID, $viewType) or !$rootID) $viewType .= ',story';
$modules += $this->dao->select('id,name,path,short')->from(TABLE_MODULE)
->where('type')->in($viewType)
->beginIF($rootID)->andWhere('root')->eq($rootID)->fi()
->andWhere('deleted')->eq(0)
->fetchAll('id');
}
$modulePairs = array();
@@ -659,7 +663,7 @@ class treeModel extends model
foreach($branchGroups[$id] as $branch => $branchName)
{
$treeMenu = array();
$query = $this->dao->select('*')->from(TABLE_MODULE)->where("((root = '" . (int)$rootID . "' and type = 'bug' and parent != 0) OR (root = $id and type = 'story' and branch ='$branch'))")
$query = $this->dao->select('*')->from(TABLE_MODULE)->where("((root = $id and type = 'bug') OR (root = $id and type = 'story' and branch ='$branch'))")
->beginIF($startModulePath)->andWhere('path')->like($startModulePath)->fi()
->andWhere('deleted')->eq(0)
->orderBy('grade desc, `order`, type')