diff --git a/module/story/model.php b/module/story/model.php index 7c1415de45..6baf6f5edb 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -2671,11 +2671,12 @@ class storyModel extends model if($story->parent < 0 and $action != 'edit' and $action != 'batchcreate') return false; - if($action == 'change') return $story->status != 'closed'; - if($action == 'review') return $story->status == 'draft' or $story->status == 'changed'; - if($action == 'close') return $story->status != 'closed'; - if($action == 'activate') return $story->status == 'closed'; - if($action == 'assignto') return $story->status != 'closed'; + if($action == 'change') return $story->status != 'closed'; + if($action == 'review') return $story->status == 'draft' or $story->status == 'changed'; + if($action == 'close') return $story->status != 'closed'; + if($action == 'activate') return $story->status == 'closed'; + if($action == 'assignto') return $story->status != 'closed'; + if($action == 'createcase') return $story->type != 'requirement'; if($action == 'batchcreate' and $story->parent > 0) return false; if($action == 'batchcreate' and $story->type == 'requirement') return $story->status != 'draft'; if($action == 'batchcreate' and ($story->status != 'active' or $story->stage != 'wait')) return false; diff --git a/module/story/view/view.html.php b/module/story/view/view.html.php index 753b2d0098..8f55734d77 100644 --- a/module/story/view/view.html.php +++ b/module/story/view/view.html.php @@ -136,7 +136,7 @@ common::printIcon('story', 'close', "storyID=$story->id", $story, 'button', '', '', 'iframe showinonlybody', true); common::printIcon('story', 'activate', "storyID=$story->id", $story, 'button', '', '', 'iframe showinonlybody', true); - if($config->global->flow != 'onlyStory' and !isonlybody() and $story->parent >= 0 and (common::hasPriv('testcase', 'create') or common::hasPriv('testcase', 'batchCreate'))) + if($config->global->flow != 'onlyStory' and !isonlybody() and $story->parent >= 0 and $story->type != 'requirement' and (common::hasPriv('testcase', 'create') or common::hasPriv('testcase', 'batchCreate'))) { $this->app->loadLang('testcase'); echo "