* finish task #4596.

This commit is contained in:
wangyidong
2018-07-09 16:22:09 +08:00
parent 8e33b05bb5
commit abc7375b2e
3 changed files with 37 additions and 3 deletions
+19 -1
View File
@@ -495,11 +495,29 @@ class storyModel extends model
->join('mailto', ',')
->join('linkStories', ',')
->join('childStories', ',')
->remove('files,labels,comment,contactListMenu')
->remove('files,labels,comment,contactListMenu,stages')
->get();
if(isset($story->plan) and is_array($story->plan)) $story->plan = trim(join(',', $story->plan), ',');
if(empty($_POST['product'])) $story->branch = $oldStory->branch;
if(empty($_POST['branch'])) $story->branch = 0;
if(!empty($_POST['stages']))
{
$this->dao->delete()->from(TABLE_STORYSTAGE)->where('story')->eq($storyID)->exec();
$stageList = join(',', array_keys($this->lang->story->stageList));
$minStagePos = strlen($stageList);
$minStage = '';
foreach($this->post->stages as $branch => $stage)
{
$this->dao->insert(TABLE_STORYSTAGE)->set('story')->eq($storyID)->set('branch')->eq($branch)->set('stage')->eq($stage)->exec();
if(strpos($stageList, $stage) !== false and strpos($stageList, $stage) < $minStagePos)
{
$minStage = $stage;
$minStagePos = strpos($stageList, $stage);
}
}
$story->stage = $minStage;
}
$this->dao->update(TABLE_STORY)
->data($story)