* Finish task#7549.

This commit is contained in:
leiyong
2020-07-25 20:50:38 -07:00
parent deb448d2bb
commit da5249b3c7
4 changed files with 11 additions and 9 deletions
+8
View File
@@ -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'));
}
+1 -1
View File
@@ -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 = '编号';
+1 -8
View File
@@ -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;
+1
View File
@@ -32,6 +32,7 @@
<?php foreach($stories as $storyID => $story):?>
<tr class='text-center'>
<td><?php echo $storyID . html::hidden("storyIdList[$storyID]", $storyID);?></td>
<?php echo html::hidden("storyParentList[$storyID]", $story->parent);?>
<td class='text-left'><?php echo $story->title;?></td>
<td class='story-<?php echo $story->status;?>'><?php echo $this->processStatus('story', $story);?></td>
<td>