* Fix bug #19319.
This commit is contained in:
@@ -1433,10 +1433,10 @@ class testtask extends control
|
||||
$user = $this->loadModel('user')->getById($userID, 'id');
|
||||
$account = $user->account;
|
||||
|
||||
$testTasks = $this->testtask->getUserTestTaskPairs($account, 0, $status);
|
||||
$testTasks = $this->testtask->getAjaxUserTestTaskPairs($account, 0, $status);
|
||||
|
||||
if($id) return print(html::select("testtasks[$id]", $testTasks, '', 'class="form-control"'));
|
||||
return print(html::select('testtask', $testTasks, '', 'class=form-control'));
|
||||
return print(html::select('testtask', $testTasks, '', 'class="form-control"'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1074,6 +1074,38 @@ class testtaskModel extends model
|
||||
return $testtaskPairs;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get user test taskpairs for ajax.
|
||||
*
|
||||
* @param mixed $account
|
||||
* @param int $limit
|
||||
* @param string $status
|
||||
* @param array $skipProductIDList
|
||||
* @param array $skipExecutionIDList
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getAjaxUserTestTaskPairs($account, $limit = 0, $status = 'all', $skipProductIDList = array(), $skipExecutionIDList = array())
|
||||
{
|
||||
$stmt = $this->dao->select('t1.id, t1.name, t2.name as execution')
|
||||
->from(TABLE_TESTTASK)->alias('t1')
|
||||
->leftjoin(TABLE_EXTENSION)->alias('t2')->on('t1.execution = t2.id')
|
||||
->where('t1.owner')->eq($account)
|
||||
->andWhere('t1.deleted')->eq(0)
|
||||
->beginIF($status != 'all')->andWhere('t1.status')->in($status)->fi()
|
||||
->beginIF(!empty($skipProductIDList))->andWhere('t1.product')->notin($skipProductIDList)->fi()
|
||||
->beginIF(!empty($skipExecutionIDList))->andWhere('t1.execution')->notin($skipExecutionIDList)->fi()
|
||||
->beginIF($limit)->limit($limit)->fi()
|
||||
->query();
|
||||
|
||||
$testtaskPairs = array();
|
||||
while($testtask = $stmt->fetch())
|
||||
{
|
||||
$testtaskPairs[$testtask->id] = $testtask->execution . ' ' . $testtask->name;
|
||||
}
|
||||
return $testtaskPairs;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get info of a test run.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user