* Optimize bug edit, change render testtasks with ajax.

This commit is contained in:
chaideqing
2023-06-28 05:43:32 +00:00
parent 7c4c863e3c
commit 22a691a2fd
3 changed files with 32 additions and 4 deletions
+11 -1
View File
@@ -1189,7 +1189,6 @@ class bug extends control
$this->view->branchOption = $branchOption;
$this->view->branchTagOption = $branchTagOption;
$this->view->tasks = $this->task->getExecutionTaskPairs($bug->execution);
$this->view->testtasks = $this->loadModel('testtask')->getPairs($bug->product, $bug->execution, $bug->testtask);
$this->view->users = $this->user->getPairs('', "$bug->assignedTo,$bug->resolvedBy,$bug->closedBy,$bug->openedBy");
$this->view->assignedToList = $assignedToList;
$this->view->cases = array('' => '') + $cases;
@@ -1255,6 +1254,17 @@ class bug extends control
echo json_encode($builds);
}
public function ajaxGetTestTasks($bugID)
{
$bug = $this->bug->getById($bugID);
$testTasks = $this->loadModel('testtask')->getPairs($bug->product, $bug->execution, $bug->testtask);
$testTasks = array_map(function($key, $value)
{
return (object) array('value' => $key, 'text' => $value);
}, array_keys($testTasks), array_values($testTasks));
echo json_encode($testTasks);
}
/**
* Batch edit bug.
*