From bfad848beeb240dab6a42d42823e25a687631fb6 Mon Sep 17 00:00:00 2001 From: dingguodong Date: Thu, 7 Sep 2023 09:35:01 +0800 Subject: [PATCH] * Rename ACTIONMODEL to actionModel. --- framework/model.class.php | 2 +- module/action/control.php | 2 +- module/action/model.php | 4 ++-- module/caselib/model.php | 2 +- module/execution/control.php | 2 +- module/host/control.php | 2 +- module/program/control.php | 2 +- module/project/zen.php | 2 +- module/story/control.php | 2 +- module/testcase/control.php | 2 +- module/testcase/model.php | 4 ++-- module/tree/model.php | 2 +- module/zahost/control.php | 2 +- 13 files changed, 15 insertions(+), 15 deletions(-) diff --git a/framework/model.class.php b/framework/model.class.php index 041d61bd07..39ff84816e 100644 --- a/framework/model.class.php +++ b/framework/model.class.php @@ -65,7 +65,7 @@ class model extends baseModel { $this->dao->update($table)->set('deleted')->eq(1)->where('id')->eq($id)->exec(); $object = preg_replace('/^' . preg_quote((string) $this->config->db->prefix) . '/', '', trim($table, '`')); - $this->loadModel('action')->create($object, $id, 'deleted', '', ACTIONMODEL::CAN_UNDELETED); + $this->loadModel('action')->create($object, $id, 'deleted', '', actionModel::CAN_UNDELETED); return true; } diff --git a/module/action/control.php b/module/action/control.php index e77734092c..515c5be411 100755 --- a/module/action/control.php +++ b/module/action/control.php @@ -245,7 +245,7 @@ class action extends control public function undelete(int $actionID, string $browseType = 'all', string $confirmChange = 'no') { $oldAction = $this->action->getById($actionID); - $extra = $oldAction->extra == ACTIONMODEL::BE_HIDDEN ? 'hidden' : 'all'; + $extra = $oldAction->extra == actionModel::BE_HIDDEN ? 'hidden' : 'all'; if(in_array($oldAction->objectType, array('program', 'project', 'execution', 'product'))) { diff --git a/module/action/model.php b/module/action/model.php index 0f0616826d..3473d727c0 100755 --- a/module/action/model.php +++ b/module/action/model.php @@ -2069,7 +2069,7 @@ class actionModel extends model /* 在action表中更新action记录。 */ /* Update action record in action table. */ - $this->dao->update(TABLE_ACTION)->set('extra')->eq(ACTIONMODEL::BE_UNDELETED)->where('id')->eq($actionID)->exec(); + $this->dao->update(TABLE_ACTION)->set('extra')->eq(actionModel::BE_UNDELETED)->where('id')->eq($actionID)->exec(); $this->create($action->objectType, $action->objectID, 'undeleted'); return true; @@ -2419,7 +2419,7 @@ class actionModel extends model { $deletedAction = $deletedActions[$stageID][0]; $this->dao->update(TABLE_EXECUTION)->set('deleted')->eq('0')->where('id')->eq($stageID)->exec(); - $this->dao->update(TABLE_ACTION)->set('extra')->eq(ACTIONMODEL::BE_UNDELETED)->where('id')->eq($deletedAction->id)->exec(); + $this->dao->update(TABLE_ACTION)->set('extra')->eq(actionModel::BE_UNDELETED)->where('id')->eq($deletedAction->id)->exec(); $this->create($deletedAction->objectType, $deletedAction->objectID, 'undeleted'); } } diff --git a/module/caselib/model.php b/module/caselib/model.php index 3fee960a41..2bd7e3fb39 100644 --- a/module/caselib/model.php +++ b/module/caselib/model.php @@ -132,7 +132,7 @@ class caselibModel extends model $this->dao->update(TABLE_TESTSUITE)->set('deleted')->eq(1)->where('id')->eq($libID)->exec(); $this->loadModel('action'); - $this->action->create('caselib', $libID, 'deleted', '', ACTIONMODEL::CAN_UNDELETED); + $this->action->create('caselib', $libID, 'deleted', '', actionModel::CAN_UNDELETED); } /** diff --git a/module/execution/control.php b/module/execution/control.php index 22a7c5db53..c7875d2093 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -1462,7 +1462,7 @@ class execution extends control { $this->loadModel('action'); $this->dao->update(TABLE_EXECUTION)->set('deleted')->eq(0)->where('id')->eq($executionID)->exec(); - $this->dao->update(TABLE_ACTION)->set('extra')->eq(ACTIONMODEL::BE_UNDELETED)->where('id')->eq($extra)->exec(); + $this->dao->update(TABLE_ACTION)->set('extra')->eq(actionModel::BE_UNDELETED)->where('id')->eq($extra)->exec(); $this->action->create($this->objectType, $executionID, 'undeleted'); } diff --git a/module/host/control.php b/module/host/control.php index 308969f63d..f8008285f8 100644 --- a/module/host/control.php +++ b/module/host/control.php @@ -152,7 +152,7 @@ class host extends control public function delete($id) { $this->dao->update(TABLE_HOST)->set('deleted')->eq(1)->where('id')->eq($id)->exec(); - $this->loadModel('action')->create('host', $id, 'deleted', '', ACTIONMODEL::CAN_UNDELETED); + $this->loadModel('action')->create('host', $id, 'deleted', '', actionModel::CAN_UNDELETED); if(dao::isError()) { diff --git a/module/program/control.php b/module/program/control.php index c188af4770..866b30f725 100644 --- a/module/program/control.php +++ b/module/program/control.php @@ -438,7 +438,7 @@ class program extends control $program = $this->dao->select('*')->from(TABLE_PROGRAM)->where('id')->eq($programID)->fetch(); $this->dao->update(TABLE_PROGRAM)->set('deleted')->eq(1)->where('id')->eq($programID)->exec(); - $this->loadModel('action')->create('program', $programID, 'deleted', '', ACTIONMODEL::CAN_UNDELETED); + $this->loadModel('action')->create('program', $programID, 'deleted', '', actionModel::CAN_UNDELETED); return $this->send(array('result' => 'success')); } diff --git a/module/project/zen.php b/module/project/zen.php index 63096014ea..89c87a7aa8 100644 --- a/module/project/zen.php +++ b/module/project/zen.php @@ -924,7 +924,7 @@ class projectZen extends project protected function removeAssociatedExecutions(array $executionIdList): void { $this->project->deleteByTableName(TABLE_EXECUTION, array_keys($executionIdList)); - foreach($executionIdList as $executionID => $execution) $this->loadModel('action')->create('execution', $executionID, 'deleted', '', ACTIONMODEL::CAN_UNDELETED); + foreach($executionIdList as $executionID => $execution) $this->loadModel('action')->create('execution', $executionID, 'deleted', '', actionModel::CAN_UNDELETED); $this->loadModel('user')->updateUserView($executionIdList, 'sprint'); } diff --git a/module/story/control.php b/module/story/control.php index 7b3eef771d..cd8cfeb725 100755 --- a/module/story/control.php +++ b/module/story/control.php @@ -793,7 +793,7 @@ class story extends control else { $this->dao->update(TABLE_STORY)->set('deleted')->eq(1)->where('id')->eq($storyID)->exec(); - $this->loadModel('action')->create($story->type, $storyID, 'deleted', '', ACTIONMODEL::CAN_UNDELETED); + $this->loadModel('action')->create($story->type, $storyID, 'deleted', '', actionModel::CAN_UNDELETED); if($story->parent > 0) { diff --git a/module/testcase/control.php b/module/testcase/control.php index d6da4b4454..70aadaf613 100644 --- a/module/testcase/control.php +++ b/module/testcase/control.php @@ -1491,7 +1491,7 @@ class testcase extends control $this->loadModel('action'); $scenes = $this->dao->select('id')->from(TABLE_SCENE)->where('deleted')->eq('0')->andWhere('path')->like($scene->path . '%')->fetchPairs(); $this->dao->update(TABLE_SCENE)->set('deleted')->eq('1')->where('deleted')->eq(0)->andWhere('path')->like($scene->path . '%')->exec(); - foreach($scenes as $sceneID) $this->action->create('scene', $sceneID, 'deleted', '', ACTIONMODEL::CAN_UNDELETED); + foreach($scenes as $sceneID) $this->action->create('scene', $sceneID, 'deleted', '', actionModel::CAN_UNDELETED); } else { diff --git a/module/testcase/model.php b/module/testcase/model.php index bbcf83d597..96474d14da 100644 --- a/module/testcase/model.php +++ b/module/testcase/model.php @@ -887,13 +887,13 @@ class testcaseModel extends model if($caseIdList) { $this->dao->update(TABLE_CASE)->set('deleted')->eq('1')->where('id')->in($caseIdList)->exec(); - foreach($caseIdList as $caseID) $this->action->create('case', $caseID, 'deleted', '', ACTIONMODEL::CAN_UNDELETED); + foreach($caseIdList as $caseID) $this->action->create('case', $caseID, 'deleted', '', actionModel::CAN_UNDELETED); } if($sceneIdList) { $this->dao->update(TABLE_SCENE)->set('deleted')->eq('1')->where('id')->in($sceneIdList)->exec(); - foreach($sceneIdList as $sceneID) $this->action->create('scene', $sceneID, 'deleted', '', ACTIONMODEL::CAN_UNDELETED); + foreach($sceneIdList as $sceneID) $this->action->create('scene', $sceneID, 'deleted', '', actionModel::CAN_UNDELETED); } return !dao::isError(); diff --git a/module/tree/model.php b/module/tree/model.php index 41a309ddd5..45cabbef4b 100644 --- a/module/tree/model.php +++ b/module/tree/model.php @@ -2076,7 +2076,7 @@ class treeModel extends model $this->dao->update(TABLE_MODULE)->set('deleted')->eq(1)->where('id')->in($childs)->exec(); foreach($childs as $childID) { - $this->loadModel('action')->create($objectType, $childID, 'deleted', '', ACTIONMODEL::CAN_UNDELETED); + $this->loadModel('action')->create($objectType, $childID, 'deleted', '', actionModel::CAN_UNDELETED); } $this->fixModulePath($module->root, $module->type); diff --git a/module/zahost/control.php b/module/zahost/control.php index d22c5ef8a3..ea7879721b 100644 --- a/module/zahost/control.php +++ b/module/zahost/control.php @@ -168,7 +168,7 @@ class zahost extends control } $this->dao->update(TABLE_ZAHOST)->set('deleted')->eq(1)->where('id')->eq($hostID)->exec(); - $this->loadModel('action')->create('zahost', $hostID, 'deleted', '', ACTIONMODEL::CAN_UNDELETED); + $this->loadModel('action')->create('zahost', $hostID, 'deleted', '', actionModel::CAN_UNDELETED); /* if ajax request, send result. */ if($this->server->ajax)