* Modify the drop-down range of versions when submitting tests.
This commit is contained in:
+15
-15
@@ -346,16 +346,16 @@ class build extends control
|
||||
/**
|
||||
* AJAX: get builds of a product in html select.
|
||||
*
|
||||
* @param int $productID
|
||||
* @param string $varName the name of the select object to create
|
||||
* @param string $build build to selected
|
||||
* @param int $branch
|
||||
* @param int $index the index of batch create bug.
|
||||
* @param string $type get all builds or some builds belong to normal releases and executions are not done.
|
||||
* @param int $productID
|
||||
* @param string $varName the name of the select object to create
|
||||
* @param string $build build to selected
|
||||
* @param string|int $branch
|
||||
* @param int $index the index of batch create bug.
|
||||
* @param string $type get all builds or some builds belong to normal releases and executions are not done.
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function ajaxGetProductBuilds($productID, $varName, $build = '', $branch = 0, $index = 0, $type = 'normal')
|
||||
public function ajaxGetProductBuilds($productID, $varName, $build = '', $branch = 'all', $index = 0, $type = 'normal')
|
||||
{
|
||||
$isJsonView = $this->app->getViewType() == 'json';
|
||||
if($varName == 'openedBuild' )
|
||||
@@ -383,17 +383,17 @@ class build extends control
|
||||
/**
|
||||
* AJAX: get builds of an execution in html select.
|
||||
*
|
||||
* @param int $executionID
|
||||
* @param string $varName the name of the select object to create
|
||||
* @param string $build build to selected
|
||||
* @param int $branch
|
||||
* @param int $index the index of batch create bug.
|
||||
* @param bool $needCreate if need to append the link of create build
|
||||
* @param string $type get all builds or some builds belong to normal releases and executions are not done.
|
||||
* @param int $executionID
|
||||
* @param string $varName the name of the select object to create
|
||||
* @param string $build build to selected
|
||||
* @param string|int $branch
|
||||
* @param int $index the index of batch create bug.
|
||||
* @param bool $needCreate if need to append the link of create build
|
||||
* @param string $type get all builds or some builds belong to normal releases and executions are not done.
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function ajaxGetExecutionBuilds($executionID, $productID, $varName, $build = '', $branch = 0, $index = 0, $needCreate = false, $type = 'normal')
|
||||
public function ajaxGetExecutionBuilds($executionID, $productID, $varName, $build = '', $branch = 'all', $index = 0, $needCreate = false, $type = 'normal')
|
||||
{
|
||||
$isJsonView = $this->app->getViewType() == 'json';
|
||||
if($varName == 'openedBuild')
|
||||
|
||||
+13
-14
@@ -217,17 +217,16 @@ class buildModel extends model
|
||||
/**
|
||||
* Get builds of a execution in pairs.
|
||||
*
|
||||
* @param int $executionID
|
||||
* @param int $productID
|
||||
* @param int $branch
|
||||
* @param string $params noempty|notrunk, can be a set of them
|
||||
* @param string $buildIdList
|
||||
* @param int $executionID
|
||||
* @param int $productID
|
||||
* @param string|int $branch
|
||||
* @param string $params noempty|notrunk, can be a set of them
|
||||
* @param string $buildIdList
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getExecutionBuildPairs($executionID, $productID, $branch = 0, $params = '', $buildIdList = '')
|
||||
public function getExecutionBuildPairs($executionID, $productID, $branch = 'all', $params = '', $buildIdList = '')
|
||||
{
|
||||
if($branch == 'all') $branch = 0;
|
||||
$sysBuilds = array();
|
||||
$selectedBuilds = array();
|
||||
if(strpos($params, 'noempty') === false) $sysBuilds = array('' => '');
|
||||
@@ -240,7 +239,7 @@ class buildModel extends model
|
||||
->leftJoin(TABLE_BRANCH)->alias('t4')->on('t1.branch = t4.id')
|
||||
->where('t1.execution')->eq((int)$executionID)
|
||||
->beginIF($productID)->andWhere('t1.product')->eq((int)$productID)->fi()
|
||||
->andWhere('t1.branch')->eq($branch)
|
||||
->beginIF($branch !== 'all')->andWhere('t1.branch')->eq($branch)->fi()
|
||||
->andWhere('t1.deleted')->eq(0)
|
||||
->orderBy('t1.date desc, t1.id desc')->fetchAll('id');
|
||||
|
||||
@@ -260,15 +259,15 @@ class buildModel extends model
|
||||
/**
|
||||
* Get builds of a product in pairs.
|
||||
*
|
||||
* @param mix $products int|array
|
||||
* @param int $branch
|
||||
* @param string $params noempty|notrunk, can be a set of them
|
||||
* @param bool $replace
|
||||
* @param mix $products int|array
|
||||
* @param string|int $branch
|
||||
* @param string $params noempty|notrunk, can be a set of them
|
||||
* @param bool $replace
|
||||
*
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getProductBuildPairs($products, $branch = 0, $params = 'noterminate, nodone', $replace = true)
|
||||
public function getProductBuildPairs($products, $branch = 'all', $params = 'noterminate, nodone', $replace = true)
|
||||
{
|
||||
$sysBuilds = array();
|
||||
if(strpos($params, 'noempty') === false) $sysBuilds = array('' => '');
|
||||
@@ -302,7 +301,7 @@ class buildModel extends model
|
||||
$releases = $this->dao->select('build, name')->from(TABLE_RELEASE)
|
||||
->where('build')->in(array_keys($builds))
|
||||
->andWhere('product')->in($products)
|
||||
->beginIF($branch)->andWhere('branch')->in("0,$branch")->fi()
|
||||
->beginIF($branch !== 'all')->andWhere('branch')->in("$branch")->fi()
|
||||
->andWhere('deleted')->eq(0)
|
||||
->fetchPairs();
|
||||
foreach($releases as $buildID => $releaseName)
|
||||
|
||||
@@ -252,7 +252,7 @@ class testtask extends control
|
||||
/* Create testtask from testtask of test.*/
|
||||
$productID = $productID ? $productID : key($this->products);
|
||||
$executions = empty($productID) ? array() : $this->loadModel('product')->getExecutionPairsByProduct($productID, 0, 'id_desc', $projectID);
|
||||
$builds = empty($productID) ? array() : $this->loadModel('build')->getProductBuildPairs($productID, 0, 'notrunk', true);
|
||||
$builds = empty($productID) ? array() : $this->loadModel('build')->getProductBuildPairs($productID, 'all', 'notrunk', true);
|
||||
|
||||
$testreports = $this->testtask->getTestReportPairsByBuild($build);
|
||||
|
||||
|
||||
@@ -37,5 +37,5 @@ function loadExecutions(productID)
|
||||
$(function()
|
||||
{
|
||||
adjustPriBoxWidth();
|
||||
if($('#execution').val()) loadExecutionBuilds($('#execution').val());
|
||||
if($('#execution').val() != 0) loadExecutionBuilds($('#execution').val());
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user