diff --git a/module/story/control.php b/module/story/control.php index 2a58fdf81b..12ada3ffd5 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -945,6 +945,7 @@ class story extends control { if($this->post->comments) { + $data = fixer::input('post')->get(); $allChanges = $this->story->batchClose(); if($allChanges) @@ -955,6 +956,13 @@ class story extends control $this->action->logHistory($actionID, $changes); } } + + foreach($data->storyParentList as $storyID => $parent) + { + if($parent == -1) $skipStory[$storyID] = $data->storyIdList[$storyID]; + } + if(isset($skipStory)) echo js::alert(sprintf($this->lang->story->parentSkip, join(',', $skipStory))); + if(!dao::isError()) $this->loadModel('score')->create('ajax', 'batchOther'); die(js::locate($this->session->storyList, 'parent')); } diff --git a/module/story/lang/zh-cn.php b/module/story/lang/zh-cn.php index 655f0ca508..14a0c2ccbf 100644 --- a/module/story/lang/zh-cn.php +++ b/module/story/lang/zh-cn.php @@ -58,7 +58,7 @@ $lang->story->batchChangeStage = "批量修改阶段"; $lang->story->batchAssignTo = "批量指派"; $lang->story->batchChangeModule = "批量修改模块"; $lang->story->viewAll = '查看全部'; -$lang->story->parentClose = '需求:%s 为父需求,将不会被关闭。'; +$lang->story->parentSkip = '需求:%s 为父需求,将不会被关闭。'; $lang->story->common = $lang->storyCommon; $lang->story->id = '编号'; diff --git a/module/story/model.php b/module/story/model.php index d7263016f3..a4cd949dfc 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -1136,11 +1136,10 @@ class storyModel extends model $storyIdList = $data->storyIdList ? $data->storyIdList : array(); $oldStories = $this->getByList($storyIdList); - $parentIdList = array(); foreach($storyIdList as $storyID) { $oldStory = $oldStories[$storyID]; - if($oldStory->parent == -1) $parentIdList[] = $oldStory->id; + if($oldStory->parent == -1) continue; if($oldStory->status == 'closed') continue; $story = new stdclass(); @@ -1163,12 +1162,6 @@ class storyModel extends model unset($story); } - if(count($parentIdList)) - { - $noticeParentID = implode(',', $parentIdList); - die(js::alert(sprintf($this->lang->story->parentClose, $noticeParentID))); - } - foreach($stories as $storyID => $story) { if(!$story->closedReason) continue; diff --git a/module/story/view/batchclose.html.php b/module/story/view/batchclose.html.php index 2815cf19f4..e1812d2256 100755 --- a/module/story/view/batchclose.html.php +++ b/module/story/view/batchclose.html.php @@ -32,6 +32,7 @@ $story):?>