* finish task #4760.
This commit is contained in:
@@ -270,10 +270,9 @@
|
||||
echo "<li class='dropdown-submenu'>";
|
||||
echo html::a('javascript:;', $lang->story->stageAB, '', "id='stageItem'");
|
||||
echo "<ul class='dropdown-menu'>";
|
||||
$stageList['verified'] = $lang->story->stageList['verified'];
|
||||
$stageList['closed'] = $lang->story->stageList['closed'];
|
||||
foreach($stageList as $key => $stage)
|
||||
foreach($lang->story->stageList as $key => $stage)
|
||||
{
|
||||
if(empty($key)) continue;
|
||||
$actionLink = $this->createLink('story', 'batchChangeStage', "stage=$key");
|
||||
echo "<li>" . html::a('#', $stage, '', "onclick=\"setFormAction('$actionLink','hiddenwin')\"") . "</li>";
|
||||
}
|
||||
|
||||
@@ -195,6 +195,7 @@ $lang->story->errorEmptyChildStory = '『Subdivide Story』canot be blank.';
|
||||
$lang->story->mustChooseResult = 'Select Result';
|
||||
$lang->story->mustChoosePreVersion = 'Select the Version to revert to.';
|
||||
$lang->story->noStory = 'No stories. ';
|
||||
$lang->story->failChangeStage = 'The status of story %s is draft, that fail to change stage.';
|
||||
|
||||
$lang->story->form = new stdclass();
|
||||
$lang->story->form->area = 'Story Scope';
|
||||
|
||||
@@ -195,6 +195,7 @@ $lang->story->errorEmptyChildStory = '『细分需求』不能为空。';
|
||||
$lang->story->mustChooseResult = '必须选择评审结果';
|
||||
$lang->story->mustChoosePreVersion = '必须选择回溯的版本';
|
||||
$lang->story->noStory = '暂时没有需求。';
|
||||
$lang->story->failChangeStage = '需求 %s 为草稿状态,没有修改其阶段。';
|
||||
|
||||
$lang->story->form = new stdclass();
|
||||
$lang->story->form->area = '该需求所属范围';
|
||||
|
||||
+10
-7
@@ -1030,23 +1030,26 @@ class storyModel extends model
|
||||
$now = helper::now();
|
||||
$allChanges = array();
|
||||
$oldStories = $this->getByList($storyIDList);
|
||||
$failStories = '';
|
||||
foreach($storyIDList as $storyID)
|
||||
{
|
||||
$oldStory = $oldStories[$storyID];
|
||||
if($oldStory->status == 'draft') continue;
|
||||
if($oldStory->status == 'draft')
|
||||
{
|
||||
$failStories .= "#{$storyID} ";
|
||||
continue;
|
||||
}
|
||||
|
||||
$story = new stdclass();
|
||||
$story->lastEditedBy = $this->app->user->account;
|
||||
$story->lastEditedDate = $now;
|
||||
$story->stage = $stage;
|
||||
|
||||
if($stage == 'verified' or $stage == 'closed')
|
||||
{
|
||||
$this->dao->update(TABLE_STORY)->data($story)->autoCheck()->where('id')->eq((int)$storyID)->exec();
|
||||
$this->dao->update(TABLE_STORYSTAGE)->set('stage')->eq($stage)->where('story')->eq((int)$storyID)->exec();
|
||||
if(!dao::isError()) $allChanges[$storyID] = common::createChanges($oldStory, $story);
|
||||
}
|
||||
$this->dao->update(TABLE_STORY)->data($story)->autoCheck()->where('id')->eq((int)$storyID)->exec();
|
||||
$this->dao->update(TABLE_STORYSTAGE)->set('stage')->eq($stage)->where('story')->eq((int)$storyID)->exec();
|
||||
if(!dao::isError()) $allChanges[$storyID] = common::createChanges($oldStory, $story);
|
||||
}
|
||||
if($failStories) echo js::alert(sprintf($this->lang->story->failChangeStage, $failStories));
|
||||
return $allChanges;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user