* adjust the logic of review.

This commit is contained in:
wangchunsheng
2010-02-11 05:35:49 +00:00
parent 6113c46840
commit a8bae0746b
3 changed files with 7 additions and 0 deletions

View File

@@ -225,6 +225,7 @@ class story extends control
if(!empty($_POST))
{
$this->story->review($storyID);
if(dao::isError()) die(js::error(dao::getError()));
$result = $this->post->result;
if(strpos('done,postponed,subdivided', $this->post->closedReason) !== false) $result = 'pass';
$actionID = $this->action->create('story', $storyID, 'Reviewed', $this->post->comment, ucfirst($result));

View File

@@ -198,6 +198,7 @@ class storyModel extends model
->setIF($this->post->result == 'pass' and $oldStory->status == 'changed', 'status', 'active')
->setIF($this->post->result == 'reject', 'closedBy', $this->app->user->account)
->setIF($this->post->result == 'reject', 'closedDate', $now)
->setIF($this->post->result == 'reject', 'assignedTo', 'closed')
->setIF($this->post->result == 'reject', 'status', 'closed')
->setIF($this->post->result == 'revert', 'version', $this->post->preVersion)
->setIF($this->post->result == 'revert', 'status', 'active')
@@ -209,6 +210,7 @@ class storyModel extends model
$this->dao->update(TABLE_STORY)->data($story)
->autoCheck()
->batchCheck('assignedTo, reviewedBy', 'notempty')
->checkIF($this->post->result == 'reject', 'closedReason', 'notempty')
->checkIF($this->post->result == 'reject' and $this->post->closedReason == 'duplicate', 'duplicateStory', 'notempty')
->checkIF($this->post->result == 'reject' and $this->post->closedReason == 'subdivided', 'childStories', 'notempty')
->where('id')->eq($storyID)->exec();

View File

@@ -24,12 +24,14 @@
?>
<?php include './header.html.php';?>
<script language='Javascript'>
var assignedTo = '<?php $story->lastEditedBy ? print($story->lastEditedBy) : print($story->openedBy);?>';
function switchShow(result)
{
if(result == 'reject')
{
$('#rejectedReasonBox').show();
$('#preVersionBox').hide();
$('#assignedTo').val('closed');
}
else if(result == 'revert')
{
@@ -37,6 +39,7 @@ function switchShow(result)
$('#rejectedReasonBox').hide();
$('#duplicateStoryBox').hide();
$('#childStoriesBox').hide();
$('#assignedTo').val(assignedTo);
}
else
{
@@ -45,6 +48,7 @@ function switchShow(result)
$('#duplicateStoryBox').hide();
$('#childStoriesBox').hide();
$('#rejectedReasonBox').hide();
$('#assignedTo').val(assignedTo);
}
}