* fix a bug for build link bug.

This commit is contained in:
wyd621
2013-08-08 15:43:32 +08:00
parent 2b42181852
commit 43ca840982
3 changed files with 8 additions and 3 deletions

View File

@@ -42,6 +42,10 @@ class build extends control
$orderBy = 'status_asc, stage_asc, id_desc';
$stories = $this->story->getProjectStories($projectID, $orderBy);
$bugs = $this->bug->getProjectBugs($projectID);
foreach($bugs as $key => $bug)
{
if($bug->status == 'closed') unset($bugs[$key]);
}
/* Assign. */
$project = $this->loadModel('project')->getById($projectID);

View File

@@ -125,8 +125,9 @@ class buildModel extends model
$this->dao->insert(TABLE_BUILD)->data($build)->autoCheck()->batchCheck($this->config->build->create->requiredFields, 'notempty')->check('name', 'unique', "product = {$build->product}")->exec();
if(!dao::isError())
{
$buildID = $this->dao->lastInsertID();
$this->updateLinkedBug($build);
return $this->dao->lastInsertID();
return $buildID;
}
}
@@ -186,7 +187,7 @@ class buildModel extends model
if(!$bugs) return false;
foreach($bugs as $bug)
{
if($bug->status == 'resolved') continue;
if($bug->status == 'resolved' or $bug->status == 'closed') continue;
$bug->resolvedBy = $resolvedPairs[$bug->id];
$bug->resolvedDate = $now;

View File

@@ -105,7 +105,7 @@
<td class='w-id a-left' id='bug'><input type='checkbox' name='bugs[]' value="<?php echo $bug->id;?>" <?php if(strpos(',' . $build->bugs . ',', ',' . $bug->id . ',') !== false) echo 'checked';?>> <?php echo sprintf('%03d', $bug->id);?></td>
<td class='a-left nobr'><?php echo html::a($bugLink, $bug->title, '', "class='preview'");?></td>
<td class='w-80px'><?php echo $lang->bug->statusList[$bug->status];?></td>
<td class='w-80px'><?php echo $bug->status == 'resolved' ? substr($users[$bug->resolvedBy], 2) : html::select('resolvedBy[]', $users, $this->app->user->account, "class='w-70px'");?></td>
<td class='w-80px'><?php echo ($bug->status == 'resolved' or $bug->status == 'closed') ? substr($users[$bug->resolvedBy], 2) : html::select('resolvedBy[]', $users, $this->app->user->account, "class='w-70px'");?></td>
</tr>
<?php endforeach;?>
</table>