* fix for create story in prject story when force review.

This commit is contained in:
wangyidong
2017-05-19 16:56:27 +08:00
parent 117bec6bfb
commit 11ea0f3e93
2 changed files with 3 additions and 2 deletions
+1 -1
View File
@@ -23,7 +23,7 @@
common::printIcon('story', 'export', "productID=$productID&orderBy=id_desc", '', 'button', '', '', 'export');
$this->lang->story->create = $this->lang->project->createStory;
if($productID) common::printIcon('story', 'create', "productID=$productID&branch=&moduleID=0&story=0&project=$project->id");
if($productID and !$this->loadModel('story')->checkForceReview()) common::printIcon('story', 'create', "productID=$productID&branch=&moduleID=0&story=0&project=$project->id");
if(commonModel::isTutorialMode())
{
+2 -1
View File
@@ -166,6 +166,7 @@ class storyModel extends model
if($result['stop']) return array('status' => 'exists', 'id' => $result['duplicate']);
if($this->checkForceReview()) $story->status = 'draft';
if($story->status == 'draft') $story->stage = $this->post->plan > 0 ? 'planned' : 'wait';
$story = $this->loadModel('file')->processEditor($story, $this->config->story->editor->create['id'], $this->post->uid);
$this->dao->insert(TABLE_STORY)->data($story, 'spec,verify')->autoCheck()->batchCheck($this->config->story->create->requiredFields, 'notempty')->exec();
if(!dao::isError())
@@ -182,7 +183,7 @@ class storyModel extends model
$data->verify = $story->verify;
$this->dao->insert(TABLE_STORYSPEC)->data($data)->exec();
if($projectID != 0)
if($projectID != 0 and $story->status != 'draft')
{
$this->dao->insert(TABLE_PROJECTSTORY)
->set('project')->eq($projectID)