* Code for finish task #84593.

This commit is contained in:
tianshujie
2023-02-18 15:16:29 +08:00
parent 8208608430
commit 4e7f8247e3
4 changed files with 26 additions and 11 deletions
+6 -6
View File
@@ -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');
+11 -1
View File
@@ -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;
+7 -4
View File
@@ -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('<span class="label-pri label-pri-' + value + '" title="' + value + '">' + value + '</span>');
});
$('#type').change(function()
{
if(lifetime != 'ops')
if(lifetime != 'ops' && attribute != 'request' && attribute != 'review')
{
$('#selectTestStoryBox').toggleClass('hidden', $(this).val() != 'test');
toggleSelectTestStory();
+2
View File
@@ -22,7 +22,9 @@
<?php js::set('requiredFields', $config->task->create->requiredFields);?>
<?php js::set('estimateNotEmpty', sprintf($lang->error->gt, $lang->task->estimate, '0'))?>
<?php js::set('lifetime', $execution->lifetime);?>
<?php js::set('attribute', $execution->attribute);?>
<?php js::set('lifetimeList', $lifetimeList);?>
<?php js::set('attributeList', $attributeList);?>
<?php js::set('hasProduct', $execution->hasProduct);?>
<?php
$requiredFields = array();