diff --git a/module/story/control.php b/module/story/control.php index fa206cde03..4f7f8daf19 100755 --- a/module/story/control.php +++ b/module/story/control.php @@ -1143,7 +1143,6 @@ class story extends control /* Append module when change product type. */ $moduleList = array(0 => '/'); $productStoryList = array(); - $storyPlans = array(); foreach($stories as $story) { if(isset($modules[$story->product][$story->branch])) @@ -1162,16 +1161,10 @@ class story extends control if(!isset($productStoryList[$story->product][$story->branch])) $productStoryList[$story->product][$story->branch] = $this->story->getProductStoryPairs($story->product, $branch, 0, 'all', 'id_desc', 0, '', $story->type); } - if(isset($plans[$story->product][$story->branch]) and zget($plans[$story->product][$story->branch], $story->plan)) + if(!empty($story->plan) and !isset($plans[$story->product][$story->branch][$story->plan])) { - $storyPlans = $plans[$story->product][$story->branch]; - $planInfo = $this->dao->select('id,title,begin,end')->from(TABLE_PRODUCTPLAN)->where('id')->eq($story->plan)->fetchAll('id'); - - $storyPlans[$story->plan] = $planInfo[$story->plan]->title . ' [' . $planInfo[$story->plan]->begin . '~' . $planInfo[$story->plan]->end . ']'; - } - else - { - $storyPlans = $plans; + $plan = $this->dao->select('id,title,begin,end')->from(TABLE_PRODUCTPLAN)->where('id')->eq($story->plan)->fetch(); + $plans[$story->product][$story->branch][$story->plan] = $plan->title . ' [' . $plan->begin . '~' . $plan->end . ']'; } } @@ -1186,7 +1179,7 @@ class story extends control $this->view->branchProduct = $branchProduct; $this->view->storyIdList = $storyIdList; $this->view->branch = $branch; - $this->view->plans = array('' => '') + $storyPlans; + $this->view->plans = $plans; $this->view->storyType = $storyType; $this->view->stories = $stories; $this->view->executionID = $executionID; diff --git a/module/story/view/batchedit.html.php b/module/story/view/batchedit.html.php index b0145dcd3b..8e04755b52 100644 --- a/module/story/view/batchedit.html.php +++ b/module/story/view/batchedit.html.php @@ -85,7 +85,7 @@ foreach(explode(',', $showFields) as $field)