* finish task #1803.
This commit is contained in:
+22
-7
@@ -194,6 +194,21 @@ class bugModel extends model
|
||||
return $bug;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get bug list.
|
||||
*
|
||||
* @param int|array|string $bugIDList
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getList($bugIDList = 0)
|
||||
{
|
||||
return $this->dao->select('*')->from(TABLE_BUG)
|
||||
->where('deleted')->eq(0)
|
||||
->beginIF($bugIDList)->andWhere('id')->in($bugIDList)->fi()
|
||||
->fetchAll('id');
|
||||
}
|
||||
|
||||
/**
|
||||
* getActiveBugs
|
||||
*
|
||||
@@ -353,7 +368,7 @@ class bugModel extends model
|
||||
*
|
||||
* @param int $bugID
|
||||
* @access public
|
||||
* @return void
|
||||
* @return string
|
||||
*/
|
||||
public function assign($bugID)
|
||||
{
|
||||
@@ -406,11 +421,11 @@ class bugModel extends model
|
||||
*/
|
||||
public function batchConfirm($bugIDList)
|
||||
{
|
||||
$now = helper::now();
|
||||
$now = helper::now();
|
||||
$bugs = $this->getList($bugIDList);
|
||||
foreach($bugIDList as $bugID)
|
||||
{
|
||||
$oldBug = $this->getById($bugID);
|
||||
if($oldBug->confirmed) continue;
|
||||
if($bugs[$bugID]->confirmed) continue;
|
||||
|
||||
$bug = new stdclass();
|
||||
$bug->assignedTo = $this->app->user->account;
|
||||
@@ -466,10 +481,11 @@ class bugModel extends model
|
||||
*/
|
||||
public function batchResolve($bugIDList, $resolution, $resolvedBuild)
|
||||
{
|
||||
$now = helper::now();
|
||||
$now = helper::now();
|
||||
$bugs = $this->getList($bugIDList);
|
||||
foreach($bugIDList as $bugID)
|
||||
{
|
||||
$oldBug = $this->getById($bugID);
|
||||
$oldBug = $bugs[$bugID];
|
||||
if($oldBug->status != 'active') continue;
|
||||
$bug = new stdClass();
|
||||
$bug->resolution = $resolution;
|
||||
@@ -528,7 +544,6 @@ class bugModel extends model
|
||||
*/
|
||||
public function close($bugID)
|
||||
{
|
||||
$oldBug = $this->getById($bugID);
|
||||
$now = helper::now();
|
||||
$bug = fixer::input('post')
|
||||
->add('assignedTo', 'closed')
|
||||
|
||||
Reference in New Issue
Block a user