* adjust the logic of review.
This commit is contained in:
@@ -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));
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user