From 2a65df963edda184de9d39d3153e9b2153da4b4a Mon Sep 17 00:00:00 2001 From: tianshujie98 Date: Tue, 19 Jan 2021 10:46:46 +0800 Subject: [PATCH] * Adjust code style. --- module/story/control.php | 8 +++++++- module/story/model.php | 6 +++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/module/story/control.php b/module/story/control.php index d394ef5cc0..03883e12a2 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -377,7 +377,13 @@ class story extends control $stories = array(); foreach($mails as $mail) $stories[] = $mail->storyID; - if($project) $this->loadModel('project')->linkStory($project, $stories); + + /* Project or execution linked stories. */ + if($project) + { + $this->loadModel('project')->linkStory($project, $stories); + if($project != $this->session->PRJ) $this->loadModel('project')->linkStory($this->session->PRJ, $stories); + } /* If storyID not equal zero, subdivide this story to child stories and close it. */ if($storyID and !empty($mails)) diff --git a/module/story/model.php b/module/story/model.php index a098e89584..9a58802ec3 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -244,7 +244,11 @@ class storyModel extends model $this->dao->insert(TABLE_STORYSPEC)->data($data)->exec(); /* Project or execution linked story. */ - if($projectID != 0 and $story->status != 'draft') $this->linkStory($projectID, $this->post->product, $storyID); + if($projectID != 0 and $story->status != 'draft') + { + $this->linkStory($projectID, $this->post->product, $storyID); + if($projectID != $this->session->PRJ) $this->linkStory($this->session->PRJ, $this->post->product, $storyID); + } if(is_array($this->post->URS)) {