From 11ea0f3e9379d992d7980a841e31d63dc96b62d4 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Fri, 19 May 2017 16:56:27 +0800 Subject: [PATCH] * fix for create story in prject story when force review. --- module/project/view/story.html.php | 2 +- module/story/model.php | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/module/project/view/story.html.php b/module/project/view/story.html.php index b35dfca95f..fadb5d57c3 100644 --- a/module/project/view/story.html.php +++ b/module/project/view/story.html.php @@ -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()) { diff --git a/module/story/model.php b/module/story/model.php index 9fd782e44f..602daef05c 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -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)