diff --git a/module/story/config.php b/module/story/config.php index 71fd167136..537d48e7a2 100644 --- a/module/story/config.php +++ b/module/story/config.php @@ -5,6 +5,7 @@ $config->story->batchCreate = 10; $config->story->affectedFixedNum = 7; $config->story->needReview = 1; $config->story->removeFields = 'objectTypeList,productList,executionList,execution'; +$config->story->feedbackSource = array('customer', 'user', 'market', 'service', 'operation', 'support', 'forum'); $config->story->batchClose = new stdclass(); $config->story->batchClose->columns = 10; diff --git a/module/story/js/create.js b/module/story/js/create.js index 473c38bd5f..70d8d69f15 100644 --- a/module/story/js/create.js +++ b/module/story/js/create.js @@ -24,6 +24,19 @@ $(function() var value = $select.val(); $selector.find('.pri-text').html('' + value + ''); }); + + $('#source').on('change', function() + { + var source = $(this).val(); + if($.inArray(source, feedbackSource) != -1) + { + $('#feedbackBox').removeClass('hidden'); + } + else + { + $('#feedbackBox').addClass('hidden'); + } + }); }); function refreshPlan() diff --git a/module/story/js/edit.js b/module/story/js/edit.js index f124856088..f234363a3e 100644 --- a/module/story/js/edit.js +++ b/module/story/js/edit.js @@ -19,4 +19,17 @@ $(function() reviewers = $('#reviewer').val(); } }) + + $('#source').on('change', function() + { + var source = $(this).val(); + if($.inArray(source, feedbackSource) != -1) + { + $('.feedbackBox').removeClass('hidden'); + } + else + { + $('.feedbackBox').addClass('hidden'); + } + }); }) diff --git a/module/story/model.php b/module/story/model.php index 695ae0d632..601880b177 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -207,6 +207,8 @@ class storyModel extends model ->setIF($this->post->needNotReview, 'status', 'active') ->setIF($this->post->plan > 0, 'stage', 'planned') ->setIF($this->post->estimate, 'estimate', (float)$this->post->estimate) + ->setIF(!in_array($this->post->source, $this->config->story->feedbackSource), 'feedbackBy', '') + ->setIF(!in_array($this->post->source, $this->config->story->feedbackSource), 'notifyEmail', '') ->setIF($executionID > 0, 'stage', 'projected') ->setIF($bugID > 0, 'fromBug', $bugID) ->join('mailto', ',') @@ -748,6 +750,8 @@ class storyModel extends model ->setIF($this->post->closedReason != false and $oldStory->closedDate == '', 'closedDate', $now) ->setIF($this->post->closedBy != false or $this->post->closedReason != false, 'status', 'closed') ->setIF($this->post->closedReason != false and $this->post->closedBy == false, 'closedBy', $this->app->user->account) + ->setIF(!in_array($this->post->source, $this->config->story->feedbackSource), 'feedbackBy', '') + ->setIF(!in_array($this->post->source, $this->config->story->feedbackSource), 'notifyEmail', '') ->setIF(!empty($_POST['plan'][0]) and $oldStory->stage == 'wait', 'stage', 'planned') ->stripTags($this->config->story->editor->edit['id'], $this->config->allowedTags) ->join('reviewedBy', ',') diff --git a/module/story/view/create.html.php b/module/story/view/create.html.php index c5da7971c7..a1449daacb 100644 --- a/module/story/view/create.html.php +++ b/module/story/view/create.html.php @@ -17,6 +17,7 @@ story->placeholder); ?> +story->feedbackSource); ?> @@ -131,7 +132,7 @@ -