* adjust code for adding stories and bugs for release and build.

This commit is contained in:
shiyangyangwork@yahoo.cn
2012-01-03 07:12:55 +00:00
parent 2f84f49ab5
commit 46448df386
5 changed files with 13 additions and 2 deletions

View File

@@ -50,6 +50,7 @@
<tr>
<th class='w-id'><?php echo $lang->idAB;?></th>
<th><?php echo $lang->story->title;?></th>
<th class='w-hour'><?php echo $lang->statusAB;?></th>
<th class='w-100px'><?php echo $lang->story->stageAB;?></th>
</tr>
<?php foreach($stories as $key => $story):?>
@@ -59,6 +60,7 @@
<tr class='a-center'>
<td><input type='checkbox' name='stories[]' value="<?php echo $story->id;?>" <?php if($story->stage == 'developed') echo 'checked';?>> <?php echo sprintf('%03d', $story->id);?></td>
<td class='a-left nobr'><?php echo html::a($storyLink,$story->title);?></td>
<td class='<?php echo $story->status;?>'><?php echo $lang->story->statusList[$story->status];?></td>
<td><?php echo $lang->story->stageList[$story->stage];?></td>
</tr>
<?php endforeach;?>

View File

@@ -50,6 +50,7 @@
<tr>
<th class='w-id'><?php echo $lang->idAB;?></th>
<th><?php echo $lang->story->title;?></th>
<th class='w-hour'><?php echo $lang->statusAB;?></th>
<th class='w-100px'><?php echo $lang->story->stageAB;?></th>
</tr>
<?php foreach($stories as $key => $story):?>
@@ -59,6 +60,7 @@
<tr class='a-center'>
<td><input type='checkbox' name='stories[]' value="<?php echo $story->id;?>" <?php if(strpos($build->stories, $story->id) !== false) echo 'checked';?>> <?php echo sprintf('%03d', $story->id);?></td>
<td class='a-left nobr'><?php echo html::a($storyLink,$story->title);?></td>
<td class='<?php echo $story->status;?>'><?php echo $lang->story->statusList[$story->status];?></td>
<td><?php echo $lang->story->stageList[$story->stage];?></td>
</tr>
<?php endforeach;?>

View File

@@ -68,7 +68,9 @@ class releaseModel extends model
->join('bugs', ',')
->get();
$this->dao->insert(TABLE_RELEASE)->data($release)->autoCheck()->batchCheck($this->config->release->create->requiredFields, 'notempty')->check('name','unique')->exec();
if(!dao::isError()) return $this->dao->lastInsertID();
$releaseID = $this->dao->lastInsertID();
$this->dao->update(TABLE_STORY)->set('stage')->eq('released')->where('id')->in($release->stories)->exec();
if(!dao::isError()) return $releaseID;
}
/**
@@ -90,6 +92,7 @@ class releaseModel extends model
->check('name','unique', "id != $releaseID")
->where('id')->eq((int)$releaseID)
->exec();
$this->dao->update(TABLE_STORY)->set('stage')->eq('released')->where('id')->in($release->stories)->exec();
if(!dao::isError()) return common::createChanges($oldRelease, $release);
}
}

View File

@@ -7,13 +7,15 @@
<tr>
<th class='w-id'><?php echo $lang->idAB;?></th>
<th><?php echo $lang->story->title;?></th>
<th class='w-hour'><?php echo $lang->statusAB;?></th>
<th class='w-100px'><?php echo $lang->story->stageAB;?></th>
</tr>
<?php foreach($stories as $storyID => $story):?>
<?php $storyLink = $this->createLink('story', 'view', "storyID=$storyID");?>
<tr class='a-center'>
<td><input type='checkbox' name='stories[]' value="<?php echo $storyID;?>" <?php if($story->stage == 'developed') echo 'checked';?> <?php echo sprintf('%03d', $story->id);?></td>
<td><input type='checkbox' name='stories[]' value="<?php echo $storyID;?>" <?php if($story->stage == 'developed') echo 'checked';?>> <?php echo sprintf('%03d', $story->id);?></td>
<td class='a-left nobr'><?php echo html::a($storyLink,$story->title);?></td>
<td class='<?php echo $story->status;?>'><?php echo $lang->story->statusList[$story->status];?></td>
<td><?php echo $lang->story->stageList[$story->stage];?></td>
</tr>
<?php endforeach;?>

View File

@@ -38,6 +38,7 @@
<tr>
<th class='w-id'><?php echo $lang->idAB;?></th>
<th><?php echo $lang->story->title;?></th>
<th class='w-hour'><?php echo $lang->statusAB;?></th>
<th class='w-100px'><?php echo $lang->story->stageAB;?></th>
</tr>
<?php foreach($stories as $key => $story):?>
@@ -47,6 +48,7 @@
<tr class='a-center'>
<td><input type='checkbox' name='stories[]' value="<?php echo $story->id;?>" <?php if(strpos($release->stories, $story->id) !== false) echo 'checked';?>> <?php echo sprintf('%03d', $story->id);?></td>
<td class='a-left nobr'><?php echo html::a($storyLink,$story->title);?></td>
<td class='<?php echo $story->status;?>'><?php echo $lang->story->statusList[$story->status];?></td>
<td><?php echo $lang->story->stageList[$story->stage];?></td>
</tr>
<?php endforeach;?>