* testtask: modify methods order.

This commit is contained in:
liugang
2023-09-12 10:18:03 +08:00
parent c731e1ee95
commit 0eb613d617
+35 -35
View File
@@ -794,41 +794,6 @@ class testtask extends control
$this->display();
}
/**
* activate testtask.
*
* @param int $taskID
* @access public
* @return void
*/
public function activate(int $taskID)
{
if(!empty($_POST))
{
$task = $this->testtaskZen->buildTaskForActivate($taskID);
$this->testtask->activate($task);
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
$message = $this->executeHooks($taskID) ?: $this->lang->saveSuccess;
return $this->send(array('result' => 'success', 'message' => $message, 'closeModal' => true, 'load' => true));
}
/* Get task info. */
$testtask = $this->testtask->getByID($taskID);
$productID = $this->product->saveState($testtask->product, $this->products);
/* Set menu. */
$this->loadModel('qa')->setMenu($this->products, $productID, $testtask->branch, $taskID);
$this->view->title = $testtask->name . $this->lang->colon . $this->lang->testtask->activate;
$this->view->actions = $this->loadModel('action')->getList('testtask', $taskID);
$this->view->users = $this->loadModel('user')->getPairs('nodeleted', $testtask->owner);
$this->view->testtask = $testtask;
$this->display();
}
/**
* Close testtask.
*
@@ -900,6 +865,41 @@ class testtask extends control
$this->display();
}
/**
* activate testtask.
*
* @param int $taskID
* @access public
* @return void
*/
public function activate(int $taskID)
{
if(!empty($_POST))
{
$task = $this->testtaskZen->buildTaskForActivate($taskID);
$this->testtask->activate($task);
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
$message = $this->executeHooks($taskID) ?: $this->lang->saveSuccess;
return $this->send(array('result' => 'success', 'message' => $message, 'closeModal' => true, 'load' => true));
}
/* Get task info. */
$testtask = $this->testtask->getByID($taskID);
$productID = $this->product->saveState($testtask->product, $this->products);
/* Set menu. */
$this->loadModel('qa')->setMenu($this->products, $productID, $testtask->branch, $taskID);
$this->view->title = $testtask->name . $this->lang->colon . $this->lang->testtask->activate;
$this->view->actions = $this->loadModel('action')->getList('testtask', $taskID);
$this->view->users = $this->loadModel('user')->getPairs('nodeleted', $testtask->owner);
$this->view->testtask = $testtask;
$this->display();
}
/**
* Delete a test task.
*