diff --git a/module/execution/control.php b/module/execution/control.php index aa40827601..de72a5abee 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -4141,11 +4141,10 @@ class execution extends control if(!empty($planStory)) { $projectProducts = $this->loadModel('project')->getBranchesByProject($executionID); - foreach($planStory as $id => $story) { $projectBranches = zget($projectProducts, $story->product, array()); - if($story->status == 'draft' or $story->status == 'reviewing' or (!empty($projectBranches) and !isset($projectBranches[$story->branch]))) + if($story->status == 'draft' or $story->status == 'reviewing' or (!empty($story->branch) and !empty($projectBranches) and !isset($projectBranches[$story->branch]))) { $count++; unset($planStory[$id]); @@ -4178,7 +4177,7 @@ class execution extends control } $haveDraft = sprintf($this->lang->execution->haveDraft, $count); - if(!$execution->multiple) $haveDraft = str_replace($this->lang->executionCommon, $this->lang->projectCommon, $haveDraft); + if(!$execution->multiple or $moduleName == 'projectstory') $haveDraft = str_replace($this->lang->executionCommon, $this->lang->projectCommon, $haveDraft); if($count != 0) echo js::alert($haveDraft) . js::locate($this->createLink($moduleName, $fromMethod, $param)); return print(js::locate(helper::createLink($moduleName, $fromMethod, $param))); } diff --git a/module/execution/model.php b/module/execution/model.php index e8a1dbae68..7420d45898 100755 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -2937,7 +2937,7 @@ class executionModel extends model { foreach($planStory as $id => $story) { - if($story->status == 'draft' or $story->status == 'reviewing' or (!empty($executionBranches) and !isset($executionBranches[$story->branch]))) + if($story->status == 'draft' or $story->status == 'reviewing' or (!empty($story->branch) and !empty($executionBranches) and !isset($executionBranches[$story->branch]))) { unset($planStory[$id]); continue; diff --git a/module/productplan/model.php b/module/productplan/model.php index 3a3aa649b8..d378d62382 100644 --- a/module/productplan/model.php +++ b/module/productplan/model.php @@ -1069,7 +1069,7 @@ class productplanModel extends model foreach($planStory as $id => $story) { $projectBranches = zget($projectProducts, $story->product, array()); - if($story->status == 'draft' or $story->status == 'reviewing' or (!empty($projectBranches) and !isset($projectBranches[$story->branch]))) + if($story->status == 'draft' or $story->status == 'reviewing' or (!empty($story->branch) and !empty($projectBranches) and !isset($projectBranches[$story->branch]))) { unset($planStory[$id]); continue;