* testcase: refactor the batchChangeScene method, only cases can batch change scene.

This commit is contained in:
liugang
2023-08-11 16:49:52 +08:00
parent 2fdf5f08e7
commit 3057cd49fb
2 changed files with 15 additions and 266 deletions
+1 -22
View File
@@ -2703,29 +2703,8 @@ class testcase extends control
{
if($this->post->caseIDList)
{
$caseIDList = $this->post->caseIDList;
$caseIDList = array_unique($caseIDList);
unset($_POST['caseIDList']);
$allChanges = $this->testcase->batchChangeScene($caseIDList, $sceneID);
$this->testcase->batchChangeScene($this->post->caseIDList, $sceneID);
if(dao::isError()) return print(js::error(dao::getError()));
if(!empty($allChanges[1]))
{
foreach($allChanges[1] as $caseID => $changes)
{
$this->loadModel('action');
$actionID = $this->action->create('case', $caseID, 'Edited');
}
}
if(!empty($allChanges[0]))
{
foreach($allChanges[0] as $sceneID => $changes)
{
$this->loadModel('action');
$actionID = $this->action->create('scene', $sceneID - CHANGEVALUE, 'Edited');
}
}
}
echo js::locate($this->session->caseList, 'parent');