+ [task#134172,doing,0.2h] add testtask::assignCase.

This commit is contained in:
liumengyi
2024-12-30 09:51:11 +08:00
committed by 刘刚
parent eb15526141
commit 36905bc847
+18
View File
@@ -1020,6 +1020,24 @@ class testtask extends control
if(!empty($_POST))
{
$newRun = form::data($this->config->testtask->form->assignCase)
->add('id', $runID)
->stripTags($this->config->testtask->editor->assignCase['id'], $this->config->allowedTags)
->get();
$newRun = $this->loadModel('file')->processImgURL($newRun, $this->config->testtask->editor->assignCase['id'], $newRun->uid);
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
$changes = $this->testtask->assignCase($newRun, $run);
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
if(empty($changes)) return $this->sendSuccess(array('closeModal' => true, 'load' => true));
$actionID = $this->loadModel('action')->create('case', (int)$run->case->id, 'assigned', '', $run->assignedTo);
$this->action->logHistory($actionID, $changes);
$message = $this->executeHooks($run->task) ?: $this->lang->saveSuccess;
return $this->sendSuccess(array('message' => $message, 'closeModal' => true, 'load' => true));
}