* fix bug for create bug in branch.

This commit is contained in:
wangyidong
2015-12-23 17:23:30 +08:00
parent 82f04a6a22
commit fb2357ef32
5 changed files with 8 additions and 6 deletions

View File

@@ -213,6 +213,7 @@ class build extends control
*/
public function ajaxGetProductBuilds($productID, $varName, $build = '', $branch = 0, $index = 0, $type = 'normal')
{
$branch = $branch ? "0,$branch" : $branch;
if($varName == 'openedBuild' )
{
$params = ($type == 'all') ? 'noempty' : 'noempty, noterminate, nodone';
@@ -241,7 +242,8 @@ class build extends control
*/
public function ajaxGetProjectBuilds($projectID, $productID, $varName, $build = '', $branch = 0, $index = 0, $needCreate = false, $type = 'normal')
{
if($varName == 'openedBuild')
$branch = $branch ? "0,$branch" : $branch;
if($varName == 'openedBuild')
{
$params = ($type == 'all') ? 'noempty' : 'noempty, noterminate, nodone';
$builds = $this->build->getProjectBuildPairs($projectID, $productID, $branch, $params);

View File

@@ -77,7 +77,7 @@ class buildModel extends model
->leftJoin(TABLE_BRANCH)->alias('t4')->on('t1.branch = t4.id')
->where('t1.project')->eq((int)$projectID)
->beginIF($productID)->andWhere('t1.product')->eq((int)$productID)->fi()
->beginIF($branch)->andWhere('t1.branch')->eq($branch)->fi()
->beginIF($branch)->andWhere('t1.branch')->in($branch)->fi()
->andWhere('t1.deleted')->eq(0)
->orderBy('t1.date desc, t1.id desc')->fetchAll('id');
@@ -121,7 +121,7 @@ class buildModel extends model
->leftJoin(TABLE_RELEASE)->alias('t3')->on('t1.id = t3.build')
->leftJoin(TABLE_BRANCH)->alias('t4')->on('t1.branch = t4.id')
->where('t1.product')->in($products)
->beginIF($branch)->andWhere('t1.branch')->eq($branch)->fi()
->beginIF($branch)->andWhere('t1.branch')->in($branch)->fi()
->andWhere('t1.deleted')->eq(0)
->orderBy('t1.date desc, t1.id desc')->fetchAll('id');

View File

@@ -510,7 +510,7 @@ class product extends control
*/
public function ajaxGetProjects($productID, $projectID = 0, $branch = 0)
{
$projects = $this->product->getProjectPairs($productID, $branch, $params = 'nodeleted');
$projects = $this->product->getProjectPairs($productID, $branch ? "0,$branch" : $branch, $params = 'nodeleted');
die(html::select('project', $projects, $projectID, 'class=form-control onchange=loadProjectRelated(this.value)'));
}

View File

@@ -950,7 +950,7 @@ class story extends control
$storyStatus = array_keys($storyStatus);
}
$stories = $this->story->getProductStoryPairs($productID, $branch, $moduleID, $storyStatus, 'id_desc', $limit);
$stories = $this->story->getProductStoryPairs($productID, $branch ? "0,$branch" : $branch, $moduleID, $storyStatus, 'id_desc', $limit);
$select = html::select('story', empty($stories) ? array('' => '') : $stories, $storyID, "class='form-control'");
/* If only need options, remove select wrap. */

View File

@@ -1069,7 +1069,7 @@ class storyModel extends model
->where('1=1')
->beginIF($productID)->andWhere('t1.product')->in($productID)->fi()
->beginIF($moduleIds)->andWhere('t1.module')->in($moduleIds)->fi()
->beginIF($branch)->andWhere('t1.branch')->eq($branch)->fi()
->beginIF($branch)->andWhere('t1.branch')->in($branch)->fi()
->beginIF($status and $status != 'all')->andWhere('t1.status')->in($status)->fi()
->andWhere('t1.deleted')->eq(0)
->orderBy($order)