diff --git a/module/execution/control.php b/module/execution/control.php index 44d1973535..38651c5404 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -2595,6 +2595,12 @@ class execution extends control $execution = $this->commonAction($executionID); if($execution->type != 'kanban') return print(js::locate(inlink('view', "executionID=$executionID"))); + if($execution->lifetime == 'ops' or in_array($execution->attribute, array('request', 'review'))) + { + $browseType = 'task'; + unset($this->lang->kanban->group->task['story']); + } + $kanbanData = $this->loadModel('kanban')->getRDKanban($executionID, $browseType, $orderBy, 0, $groupBy); $executionActions = array(); foreach($this->config->execution->statusActions as $action) @@ -2602,12 +2608,6 @@ class execution extends control if($this->execution->isClickable($execution, $action)) $executionActions[] = $action; } - if($execution->lifetime == 'ops' or in_array($execution->attribute, array('request', 'review'))) - { - $browseType = 'task'; - unset($this->lang->kanban->group->task['story']); - } - $userList = array(); $users = $this->loadModel('user')->getPairs('noletter|nodeleted'); $avatarPairs = $this->user->getAvatarPairs('all'); diff --git a/module/task/control.php b/module/task/control.php index c911ae4c34..141f00a025 100755 --- a/module/task/control.php +++ b/module/task/control.php @@ -311,6 +311,15 @@ class task extends control } } + $lifetimeList = array(); + $attributeList = array(); + $executionList = $this->execution->getByIdList(array_keys($executions)); + foreach($executionList as $id => $object) + { + $lifetimeList[$id] = $object->lifetime; + $attributeList[$id] = $object->attribute; + } + $testStoryIdList = $this->loadModel('story')->getTestStories(array_keys($stories), $execution->id); /* Stories that can be used to create test tasks. */ $testStories = array(); @@ -330,7 +339,8 @@ class task extends control $this->view->gobackLink = (isset($output['from']) and $output['from'] == 'global') ? $this->createLink('execution', 'task', "executionID=$executionID") : ''; $this->view->execution = $execution; $this->view->executions = $executions; - $this->view->lifetimeList = $this->execution->getLifetimeByIdList(array_keys($executions)); + $this->view->lifetimeList = $lifetimeList; + $this->view->attributeList = $attributeList; $this->view->task = $task; $this->view->users = $users; $this->view->storyID = $storyID; diff --git a/module/task/js/create.js b/module/task/js/create.js index 25b2552ef3..10c979ad08 100644 --- a/module/task/js/create.js +++ b/module/task/js/create.js @@ -63,14 +63,16 @@ function showTeamMenu() function loadAll(executionID) { lifetime = lifetimeList[executionID]; + attribute = attributeList[executionID]; var fieldList = showFields + ','; - if(lifetime == 'ops') + if(lifetime == 'ops' || attribute == 'request' || attribute == 'review') { - $('.storyBox').addClass('hidden'); + $('.storyBox,#selectTestStoryBox,#testStoryBox').addClass('hidden'); } else if(fieldList.indexOf('story') >= 0) { - $('.storyBox').removeClass('hidden'); + $('.storyBox,#selectTestStoryBox').removeClass('hidden'); + if($('#selectTestStory').prop('checked')) $('#testStoryBox').removeClass('hidden'); } loadModuleMenu(executionID); @@ -504,9 +506,10 @@ $(document).ready(function() var value = $select.val(); $selector.find('.pri-text').html('' + value + ''); }); + $('#type').change(function() { - if(lifetime != 'ops') + if(lifetime != 'ops' && attribute != 'request' && attribute != 'review') { $('#selectTestStoryBox').toggleClass('hidden', $(this).val() != 'test'); toggleSelectTestStory(); diff --git a/module/task/view/create.html.php b/module/task/view/create.html.php index ac48512805..3a132b9d2f 100644 --- a/module/task/view/create.html.php +++ b/module/task/view/create.html.php @@ -22,7 +22,9 @@ task->create->requiredFields);?> error->gt, $lang->task->estimate, '0'))?> lifetime);?> +attribute);?> + hasProduct);?>