* [task#130379,doing,0.5h] Process testcase to bug.
This commit is contained in:
+12
-4
@@ -339,10 +339,12 @@ class bugModel extends model
|
||||
|
||||
if($this->config->edition != 'open')
|
||||
{
|
||||
if($oldBug->story > 0 || $oldBug->task > 0)
|
||||
if($oldBug->story > 0 || $oldBug->task > 0 || $oldBug->case > 0)
|
||||
{
|
||||
$AID = $oldBug->story > 0 ? ($oldBug->task > 0 ? "{$oldBug->story},{$oldBug->task}" : $oldBug->story) : $oldBug->task;
|
||||
$AType = $oldBug->story > 0 ? ($oldBug->task > 0 ? 'story,task' : 'story') : 'task';
|
||||
$AID = $oldBug->story > 0 ? ($oldBug->task > 0 ? "{$oldBug->story},{$oldBug->task}" : $oldBug->story) : $oldBug->task;
|
||||
$AID .= $oldBug->case > 0 ? ",{$oldBug->case}" : '';
|
||||
$AType = $oldBug->story > 0 ? ($oldBug->task > 0 ? 'story,task' : 'story') : 'task';
|
||||
$AType .= $oldBug->case > 0 ? ",testcase" : '';
|
||||
$this->dao->delete()->from(TABLE_RELATION)
|
||||
->where('relation')->eq('generated')
|
||||
->andWhere('AID')->in($AID)
|
||||
@@ -351,7 +353,7 @@ class bugModel extends model
|
||||
->andWhere('BType')->eq('bug')
|
||||
->exec();
|
||||
}
|
||||
if($bug->story > 0 || $bug->task > 0)
|
||||
if($bug->story > 0 || $bug->task > 0 || $bug->case > 0)
|
||||
{
|
||||
$relation = new stdClass();
|
||||
$relation->relation = 'generated';
|
||||
@@ -369,6 +371,12 @@ class bugModel extends model
|
||||
$relation->AType = 'task';
|
||||
$this->dao->replace(TABLE_RELATION)->data($relation)->exec();
|
||||
}
|
||||
if($bug->case > 0)
|
||||
{
|
||||
$relation->AID = $bug->case;
|
||||
$relation->AType = 'testcase';
|
||||
$this->dao->replace(TABLE_RELATION)->data($relation)->exec();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -10022,7 +10022,12 @@ class upgradeModel extends model
|
||||
}
|
||||
|
||||
/* Process bug link bug. */
|
||||
$bugList = $this->dao->select('id,story,relatedBug,task')->from(TABLE_BUG)->where('relatedBug')->ne('')->orWhere('story')->ne(0)->orWhere('task')->ne(0)->fetchAll('id');
|
||||
$bugList = $this->dao->select('id,story,relatedBug,task,`case`')->from(TABLE_BUG)
|
||||
->where('relatedBug')->ne('')
|
||||
->orWhere('story')->ne(0)
|
||||
->orWhere('task')->ne(0)
|
||||
->orWhere('case')->ne(0)
|
||||
->fetchAll('id');
|
||||
foreach($bugList as $bugID => $bug)
|
||||
{
|
||||
if(!empty($bug->relatedBug))
|
||||
@@ -10059,6 +10064,16 @@ class upgradeModel extends model
|
||||
$relation->BID = $bugID;
|
||||
$this->dao->replace(TABLE_RELATION)->data($relation)->exec();
|
||||
}
|
||||
if(!empty($bug->case))
|
||||
{
|
||||
$relation = new stdClass();
|
||||
$relation->AType = 'testcase';
|
||||
$relation->AID = $bug->case;
|
||||
$relation->relation = 'generated';
|
||||
$relation->BType = 'bug';
|
||||
$relation->BID = $bugID;
|
||||
$this->dao->replace(TABLE_RELATION)->data($relation)->exec();
|
||||
}
|
||||
}
|
||||
|
||||
/* Process case link case. */
|
||||
|
||||
Reference in New Issue
Block a user