From f70eef7789f01f45a2e0ac3eeb036c552ba4e091 Mon Sep 17 00:00:00 2001 From: liugang Date: Wed, 24 Jul 2019 10:49:41 +0800 Subject: [PATCH] * Optimize function executeHooks. --- framework/control.class.php | 2 ++ module/bug/control.php | 16 ++++++++-------- module/build/control.php | 6 +++--- module/product/control.php | 8 ++++---- module/productplan/control.php | 6 +++--- module/project/control.php | 16 ++++++++-------- module/release/control.php | 6 +++--- module/story/control.php | 16 ++++++++-------- module/task/control.php | 26 +++++++++++++------------- module/testcase/control.php | 8 ++++---- module/testsuite/control.php | 6 +++--- module/testtask/control.php | 14 +++++++------- 12 files changed, 66 insertions(+), 64 deletions(-) diff --git a/framework/control.class.php b/framework/control.class.php index 9b9d950b35..6de7643ee7 100644 --- a/framework/control.class.php +++ b/framework/control.class.php @@ -205,6 +205,8 @@ class control extends baseControl */ public function executeHooks($methodName, $objectID) { + if(!isset($this->config->bizVersion)) return false; + $flowFile = $this->app->getModuleRoot() . 'workflow/model.php'; $actionFile = $this->app->getModuleRoot() . 'workflowaction/model.php'; $hookFile = $this->app->getModuleRoot() . 'workflowhook/model.php'; diff --git a/module/bug/control.php b/module/bug/control.php index cd6ab21937..2de97222e0 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -295,7 +295,7 @@ class bug extends control $this->action->create('todo', $output['todoID'], 'finished', '', "BUG:$bugID"); } - if(isset($this->config->bizVersion)) $this->executeHooks($this->methodName, $bugID); + $this->executeHooks($this->methodName, $bugID); if(defined('RUN_MODE') && RUN_MODE == 'api') $this->send(array('status' => 'success', 'data' => $bugID)); @@ -615,7 +615,7 @@ class bug extends control if(defined('RUN_MODE') && RUN_MODE == 'api') $this->send(array('status' => 'success', 'data' => $bugID)); $bug = $this->bug->getById($bugID); - if(isset($this->config->bizVersion)) $this->executeHooks($this->methodName, $bugID); + $this->executeHooks($this->methodName, $bugID); if($bug->toTask != 0) { @@ -832,7 +832,7 @@ class bug extends control $actionID = $this->action->create('bug', $bugID, 'Assigned', $this->post->comment, $this->post->assignedTo); $this->action->logHistory($actionID, $changes); - if(isset($this->config->bizVersion)) $this->executeHooks($this->methodName, $bugID); + $this->executeHooks($this->methodName, $bugID); if(isonlybody()) die(js::closeModal('parent.parent')); die(js::locate($this->createLink('bug', 'view', "bugID=$bugID"), 'parent')); @@ -947,7 +947,7 @@ class bug extends control $actionID = $this->action->create('bug', $bugID, 'bugConfirmed', $this->post->comment); $this->action->logHistory($actionID, $changes); - if(isset($this->config->bizVersion)) $this->executeHooks($this->methodName, $bugID); + $this->executeHooks($this->methodName, $bugID); if(isonlybody()) die(js::closeModal('parent.parent')); die(js::locate($this->createLink('bug', 'view', "bugID=$bugID"), 'parent')); @@ -1005,7 +1005,7 @@ class bug extends control $bug = $this->bug->getById($bugID); - if(isset($this->config->bizVersion)) $this->executeHooks($this->methodName, $bugID); + $this->executeHooks($this->methodName, $bugID); if($bug->toTask != 0) { @@ -1097,7 +1097,7 @@ class bug extends control $actionID = $this->action->create('bug', $bugID, 'Activated', $this->post->comment); $this->action->logHistory($actionID, $changes); - if(isset($this->config->bizVersion)) $this->executeHooks($this->methodName, $bugID); + $this->executeHooks($this->methodName, $bugID); if(isonlybody()) die(js::closeModal('parent.parent')); die(js::locate($this->createLink('bug', 'view', "bugID=$bugID"), 'parent')); @@ -1136,7 +1136,7 @@ class bug extends control $actionID = $this->action->create('bug', $bugID, 'Closed', $this->post->comment); $this->action->logHistory($actionID, $changes); - if(isset($this->config->bizVersion)) $this->executeHooks($this->methodName, $bugID); + $this->executeHooks($this->methodName, $bugID); if(isonlybody()) die(js::closeModal('parent.parent')); if(defined('RUN_MODE') && RUN_MODE == 'api') @@ -1304,7 +1304,7 @@ class bug extends control $this->bug->delete(TABLE_BUG, $bugID); if($bug->toTask != 0) echo js::alert($this->lang->bug->remindTask . $bug->toTask); - if(isset($this->config->bizVersion)) $this->executeHooks($this->methodName, $bugID); + $this->executeHooks($this->methodName, $bugID); die(js::locate($this->session->bugList, 'parent')); } diff --git a/module/build/control.php b/module/build/control.php index 2be54e5ad3..b5fe5d652a 100644 --- a/module/build/control.php +++ b/module/build/control.php @@ -26,7 +26,7 @@ class build extends control if(dao::isError()) $this->send(array('result' => 'fail', 'message' => dao::getError())); $this->loadModel('action')->create('build', $buildID, 'opened'); - if(isset($this->config->bizVersion)) $this->executeHooks($this->methodName, $buildID); + $this->executeHooks($this->methodName, $buildID); if(isonlybody()) $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'closeModal' => true, 'callback' => "parent.loadProjectBuilds($projectID)"));//Code for task #5126. $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $this->createLink('build', 'view', "buildID=$buildID"))); @@ -108,7 +108,7 @@ class build extends control if(!empty($changes)) $this->action->logHistory($actionID, $changes); } - if(isset($this->config->bizVersion)) $this->executeHooks($this->methodName, $buildID); + $this->executeHooks($this->methodName, $buildID); $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('view', "buildID=$buildID"))); } @@ -261,7 +261,7 @@ class build extends control $build = $this->build->getById($buildID); $this->build->delete(TABLE_BUILD, $buildID); - if(isset($this->config->bizVersion)) $this->executeHooks($this->methodName, $buildID); + $this->executeHooks($this->methodName, $buildID); /* if ajax request, send result. */ if($this->server->ajax) diff --git a/module/product/control.php b/module/product/control.php index eb6b138443..0c6321c3a8 100644 --- a/module/product/control.php +++ b/module/product/control.php @@ -210,7 +210,7 @@ class product extends control if(dao::isError()) $this->send(array('result' => 'fail', 'message' => dao::getError())); $this->loadModel('action')->create('product', $productID, 'opened'); - if(isset($this->config->bizVersion)) $this->executeHooks($this->methodName, $productID); + $this->executeHooks($this->methodName, $productID); $locate = $this->createLink($this->moduleName, 'browse', "productID=$productID"); if(isset($this->config->global->flow) and $this->config->global->flow == 'onlyTest') $locate = $this->createLink($this->moduleName, 'build', "productID=$productID"); @@ -260,7 +260,7 @@ class product extends control $this->action->logHistory($actionID, $changes); } - if(isset($this->config->bizVersion)) $this->executeHooks($this->methodName, $productID); + $this->executeHooks($this->methodName, $productID); $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('view', "product=$productID"))); } @@ -360,7 +360,7 @@ class product extends control $this->action->logHistory($actionID, $changes); } - if(isset($this->config->bizVersion)) $this->executeHooks($this->methodName, $productID); + $this->executeHooks($this->methodName, $productID); die(js::reload('parent.parent')); } @@ -428,7 +428,7 @@ class product extends control $this->product->delete(TABLE_PRODUCT, $productID); $this->dao->update(TABLE_DOCLIB)->set('deleted')->eq(1)->where('product')->eq($productID)->exec(); $this->session->set('product', ''); // 清除session。 - if(isset($this->config->bizVersion)) $this->executeHooks($this->methodName, $productID); + $this->executeHooks($this->methodName, $productID); die(js::locate($this->createLink('product', 'browse'), 'parent')); } } diff --git a/module/productplan/control.php b/module/productplan/control.php index 4b3ece83ab..59f3f2670f 100644 --- a/module/productplan/control.php +++ b/module/productplan/control.php @@ -50,7 +50,7 @@ class productplan extends control if(dao::isError()) $this->send(array('result' => 'fail', 'message' => dao::getError())); $this->loadModel('action')->create('productplan', $planID, 'opened'); - if(isset($this->config->bizVersion)) $this->executeHooks($this->methodName, $planID); + $this->executeHooks($this->methodName, $planID); if(isonlybody()) die(js::closeModal('parent.parent', '', "function(){parent.parent.$('a.refresh').click()}")); $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $this->createLink('productplan', 'browse', "productID=$product&branch=$branch"))); @@ -99,7 +99,7 @@ class productplan extends control $actionID = $this->loadModel('action')->create('productplan', $planID, 'edited'); $this->action->logHistory($actionID, $changes); } - if(isset($this->config->bizVersion)) $this->executeHooks($this->methodName, $planID); + $this->executeHooks($this->methodName, $planID); $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('view', "planID=$planID"))); } @@ -166,7 +166,7 @@ class productplan extends control $plan = $this->productplan->getById($planID); $this->productplan->delete(TABLE_PRODUCTPLAN, $planID); - if(isset($this->config->bizVersion)) $this->executeHooks($this->methodName, $planID); + $this->executeHooks($this->methodName, $planID); /* if ajax request, send result. */ if($this->server->ajax) diff --git a/module/project/control.php b/module/project/control.php index 46a43c86d1..ec341409ac 100644 --- a/module/project/control.php +++ b/module/project/control.php @@ -1055,7 +1055,7 @@ class project extends control $this->loadModel('action')->create('project', $projectID, 'opened', '', join(',', $_POST['products'])); - if(isset($this->config->bizVersion)) $this->executeHooks($this->methodName, $projectID); + $this->executeHooks($this->methodName, $projectID); $planID = reset($_POST['plans']); if(!empty($planID)) @@ -1124,7 +1124,7 @@ class project extends control $actionID = $this->loadModel('action')->create('project', $projectID, 'edited'); $this->action->logHistory($actionID, $changes); } - if(isset($this->config->bizVersion)) $this->executeHooks($this->methodName, $projectID); + $this->executeHooks($this->methodName, $projectID); $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('view', "projectID=$projectID"))); } @@ -1252,7 +1252,7 @@ class project extends control $actionID = $this->action->create('project', $projectID, 'Started', $this->post->comment); $this->action->logHistory($actionID, $changes); } - if(isset($this->config->bizVersion)) $this->executeHooks($this->methodName, $projectID); + $this->executeHooks($this->methodName, $projectID); die(js::reload('parent.parent')); } @@ -1287,7 +1287,7 @@ class project extends control $actionID = $this->action->create('project', $projectID, 'Delayed', $this->post->comment); $this->action->logHistory($actionID, $changes); } - if(isset($this->config->bizVersion)) $this->executeHooks($this->methodName, $projectID); + $this->executeHooks($this->methodName, $projectID); die(js::reload('parent.parent')); } @@ -1322,7 +1322,7 @@ class project extends control $actionID = $this->action->create('project', $projectID, 'Suspended', $this->post->comment); $this->action->logHistory($actionID, $changes); } - if(isset($this->config->bizVersion)) $this->executeHooks($this->methodName, $projectID); + $this->executeHooks($this->methodName, $projectID); die(js::reload('parent.parent')); } @@ -1357,7 +1357,7 @@ class project extends control $actionID = $this->action->create('project', $projectID, 'Activated', $this->post->comment); $this->action->logHistory($actionID, $changes); } - if(isset($this->config->bizVersion)) $this->executeHooks($this->methodName, $projectID); + $this->executeHooks($this->methodName, $projectID); die(js::reload('parent.parent')); } @@ -1399,7 +1399,7 @@ class project extends control $actionID = $this->action->create('project', $projectID, 'Closed', $this->post->comment); $this->action->logHistory($actionID, $changes); } - if(isset($this->config->bizVersion)) $this->executeHooks($this->methodName, $projectID); + $this->executeHooks($this->methodName, $projectID); die(js::reload('parent.parent')); } @@ -1708,7 +1708,7 @@ class project extends control $this->project->delete(TABLE_PROJECT, $projectID); $this->dao->update(TABLE_DOCLIB)->set('deleted')->eq(1)->where('project')->eq($projectID)->exec(); $this->session->set('project', ''); - if(isset($this->config->bizVersion)) $this->executeHooks($this->methodName, $projectID); + $this->executeHooks($this->methodName, $projectID); die(js::locate(inlink('index'), 'parent')); } } diff --git a/module/release/control.php b/module/release/control.php index 3b170919fa..534073a4fc 100644 --- a/module/release/control.php +++ b/module/release/control.php @@ -63,7 +63,7 @@ class release extends control if(dao::isError()) $this->send(array('result' => 'fail', 'message' => dao::getError())); $this->loadModel('action')->create('release', $releaseID, 'opened'); - if(isset($this->config->bizVersion)) $this->executeHooks($this->methodName, $releaseID); + $this->executeHooks($this->methodName, $releaseID); $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('view', "releaseID=$releaseID"))); } @@ -103,7 +103,7 @@ class release extends control $actionID = $this->loadModel('action')->create('release', $releaseID, 'Edited', $fileAction); if(!empty($changes)) $this->action->logHistory($actionID, $changes); } - if(isset($this->config->bizVersion)) $this->executeHooks($this->methodName, $releaseID); + $this->executeHooks($this->methodName, $releaseID); $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('view', "releaseID=$releaseID"))); } $this->loadModel('story'); @@ -200,7 +200,7 @@ class release extends control $build = $this->dao->select('*')->from(TABLE_BUILD)->where('id')->eq((int)$release->build)->fetch(); if(empty($build->project)) $this->loadModel('build')->delete(TABLE_BUILD, $build->id); - if(isset($this->config->bizVersion)) $this->executeHooks($this->methodName, $releaseID); + $this->executeHooks($this->methodName, $releaseID); /* if ajax request, send result. */ if($this->server->ajax) diff --git a/module/story/control.php b/module/story/control.php index 875b149ace..9c6e72bf22 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -113,7 +113,7 @@ class story extends control $this->action->create('todo', $todoID, 'finished', '', "STORY:$storyID"); } - if(isset($this->config->bizVersion)) $this->executeHooks($this->methodName, $storyID); + $this->executeHooks($this->methodName, $storyID); if($this->post->newStory) { @@ -436,7 +436,7 @@ class story extends control $this->action->logHistory($actionID, $changes); } - if(isset($this->config->bizVersion)) $this->executeHooks($this->methodName, $storyID); + $this->executeHooks($this->methodName, $storyID); if(defined('RUN_MODE') && RUN_MODE == 'api') { @@ -622,7 +622,7 @@ class story extends control $this->action->logHistory($actionID, $changes); } - if(isset($this->config->bizVersion)) $this->executeHooks($this->methodName, $storyID); + $this->executeHooks($this->methodName, $storyID); die(js::locate($this->createLink('story', 'view', "storyID=$storyID"), 'parent')); } @@ -657,7 +657,7 @@ class story extends control if(dao::isError()) die(js::error(dao::getError())); $actionID = $this->action->create('story', $storyID, 'Activated', $this->post->comment); - if(isset($this->config->bizVersion)) $this->executeHooks($this->methodName, $storyID); + $this->executeHooks($this->methodName, $storyID); if(isonlybody()) die(js::closeModal('parent.parent', 'this')); die(js::locate($this->createLink('story', 'view', "storyID=$storyID"), 'parent')); @@ -750,7 +750,7 @@ class story extends control { $this->story->delete(TABLE_STORY, $storyID); - if(isset($this->config->bizVersion)) $this->executeHooks($this->methodName, $storyID); + $this->executeHooks($this->methodName, $storyID); die(js::locate($this->session->storyList, 'parent')); } @@ -776,7 +776,7 @@ class story extends control $this->action->create('story', $storyID, 'Closed', '', ucfirst($this->post->closedReason)); } - if(isset($this->config->bizVersion)) $this->executeHooks($this->methodName, $storyID); + $this->executeHooks($this->methodName, $storyID); die(js::locate(inlink('view', "storyID=$storyID"), 'parent')); } @@ -847,7 +847,7 @@ class story extends control $actionID = $this->action->create('story', $storyID, 'Closed', $this->post->comment, ucfirst($this->post->closedReason) . ($this->post->duplicateStory ? ':' . (int)$this->post->duplicateStory : '')); $this->action->logHistory($actionID, $changes); - if(isset($this->config->bizVersion)) $this->executeHooks($this->methodName, $storyID); + $this->executeHooks($this->methodName, $storyID); if(isonlybody()) die(js::closeModal('parent.parent', 'this')); if(defined('RUN_MODE') && RUN_MODE == 'api') @@ -1076,7 +1076,7 @@ class story extends control $this->action->logHistory($actionID, $changes); } - if(isset($this->config->bizVersion)) $this->executeHooks($this->methodName, $storyID); + $this->executeHooks($this->methodName, $storyID); if(isonlybody()) die(js::closeModal('parent.parent', 'this')); die(js::locate($this->createLink('story', 'view', "storyID=$storyID"), 'parent')); diff --git a/module/task/control.php b/module/task/control.php index 09e7bd3d8d..cdda54f92a 100644 --- a/module/task/control.php +++ b/module/task/control.php @@ -127,7 +127,7 @@ class task extends control /* If link from no head then reload*/ if(isonlybody()) { - if(isset($this->config->bizVersion)) $this->executeHooks($this->methodName, $taskID); + $this->executeHooks($this->methodName, $taskID); $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'parent')); } @@ -137,7 +137,7 @@ class task extends control $this->action->create('todo', $todoID, 'finished', '', "TASK:$taskID"); } - if(isset($this->config->bizVersion)) $this->executeHooks($this->methodName, $taskID); + $this->executeHooks($this->methodName, $taskID); /* Locate the browser. */ if($this->app->getViewType() == 'xhtml') @@ -321,7 +321,7 @@ class task extends control if(!empty($changes)) $this->action->logHistory($actionID, $changes); } - if(isset($this->config->bizVersion)) $this->executeHooks($this->methodName, $taskID); + $this->executeHooks($this->methodName, $taskID); if($task->fromBug != 0) { @@ -485,7 +485,7 @@ class task extends control $actionID = $this->action->create('task', $taskID, 'Assigned', $this->post->comment, $this->post->assignedTo); $this->action->logHistory($actionID, $changes); - if(isset($this->config->bizVersion)) $this->executeHooks($this->methodName, $taskID); + $this->executeHooks($this->methodName, $taskID); if(isonlybody()) die(js::closeModal('parent.parent', 'this')); die(js::locate($this->createLink('task', 'view', "taskID=$taskID"), 'parent')); @@ -636,7 +636,7 @@ class task extends control $this->dao->update(TABLE_TASK)->set('storyVersion')->eq($task->latestStoryVersion)->where('id')->eq($taskID)->exec(); $this->loadModel('action')->create('task', $taskID, 'confirmed', '', $task->latestStoryVersion); - if(isset($this->config->bizVersion)) $this->executeHooks($this->methodName, $taskID); + $this->executeHooks($this->methodName, $taskID); die(js::reload('parent')); } @@ -668,7 +668,7 @@ class task extends control /* Remind whether to update status of the bug, if task which from that bug has been finished. */ $task = $this->task->getById($taskID); - if(isset($this->config->bizVersion)) $this->executeHooks($this->methodName, $taskID); + $this->executeHooks($this->methodName, $taskID); if($changes and $this->task->needUpdateBugStatus($task)) { @@ -820,7 +820,7 @@ class task extends control $this->action->logHistory($actionID, $changes); } - if(isset($this->config->bizVersion)) $this->executeHooks($this->methodName, $taskID); + $this->executeHooks($this->methodName, $taskID); if($this->task->needUpdateBugStatus($task)) { @@ -899,7 +899,7 @@ class task extends control $this->action->logHistory($actionID, $changes); } - if(isset($this->config->bizVersion)) $this->executeHooks($this->methodName, $taskID); + $this->executeHooks($this->methodName, $taskID); if(isonlybody()) die(js::closeModal('parent.parent', 'this')); die(js::locate($this->createLink('task', 'view', "taskID=$taskID"), 'parent')); @@ -936,7 +936,7 @@ class task extends control $this->action->logHistory($actionID, $changes); } - if(isset($this->config->bizVersion)) $this->executeHooks($this->methodName, $taskID); + $this->executeHooks($this->methodName, $taskID); if(isonlybody()) die(js::closeModal('parent.parent', 'this')); die(js::locate($this->createLink('task', 'view', "taskID=$taskID"), 'parent')); @@ -971,7 +971,7 @@ class task extends control $this->action->logHistory($actionID, $changes); } - if(isset($this->config->bizVersion)) $this->executeHooks($this->methodName, $taskID); + $this->executeHooks($this->methodName, $taskID); if(isonlybody()) die(js::closeModal('parent.parent', 'this')); if(defined('RUN_MODE') && RUN_MODE == 'api') @@ -1096,7 +1096,7 @@ class task extends control $this->action->logHistory($actionID, $changes); } - if(isset($this->config->bizVersion)) $this->executeHooks($this->methodName, $taskID); + $this->executeHooks($this->methodName, $taskID); if(isonlybody()) die(js::closeModal('parent.parent', 'this')); die(js::locate($this->createLink('task', 'view', "taskID=$taskID"), 'parent')); @@ -1132,7 +1132,7 @@ class task extends control $this->action->logHistory($actionID, $changes); } - if(isset($this->config->bizVersion)) $this->executeHooks($this->methodName, $taskID); + $this->executeHooks($this->methodName, $taskID); if(isonlybody()) die(js::closeModal('parent.parent', 'this')); die(js::locate($this->createLink('task', 'view', "taskID=$taskID"), 'parent')); @@ -1176,7 +1176,7 @@ class task extends control } } - if(isset($this->config->bizVersion)) $this->executeHooks($this->methodName, $taskID); + $this->executeHooks($this->methodName, $taskID); die(js::locate($this->session->taskList, 'parent')); } diff --git a/module/testcase/control.php b/module/testcase/control.php index 47e3e6c871..2e9ba9e197 100644 --- a/module/testcase/control.php +++ b/module/testcase/control.php @@ -238,7 +238,7 @@ class testcase extends control $this->loadModel('action'); $this->action->create('case', $caseID, 'Opened'); - if(isset($this->config->bizVersion)) $this->executeHooks($this->methodName, $caseID); + $this->executeHooks($this->methodName, $caseID); /* If link from no head then reload. */ if(isonlybody()) $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'closeModal' => true)); @@ -567,7 +567,7 @@ class testcase extends control $this->action->logHistory($actionID, $changes); } - if(isset($this->config->bizVersion)) $this->executeHooks($this->methodName, $caseID); + $this->executeHooks($this->methodName, $caseID); die(js::locate($this->createLink('testcase', 'view', "caseID=$caseID"), 'parent')); } @@ -779,7 +779,7 @@ class testcase extends control $result = $this->post->result; $this->loadModel('action')->create('case', $caseID, 'Reviewed', $this->post->comment, ucfirst($result)); - if(isset($this->config->bizVersion)) $this->executeHooks($this->methodName, $caseID); + $this->executeHooks($this->methodName, $caseID); die(js::reload('parent.parent')); } @@ -825,7 +825,7 @@ class testcase extends control { $this->testcase->delete(TABLE_CASE, $caseID); - if(isset($this->config->bizVersion)) $this->executeHooks($this->methodName, $caseID); + $this->executeHooks($this->methodName, $caseID); /* if ajax request, send result. */ if($this->server->ajax) diff --git a/module/testsuite/control.php b/module/testsuite/control.php index 3102cf641f..11f1887fa6 100644 --- a/module/testsuite/control.php +++ b/module/testsuite/control.php @@ -89,7 +89,7 @@ class testsuite extends control } $actionID = $this->loadModel('action')->create('testsuite', $suiteID, 'opened'); - if(isset($this->config->bizVersion)) $this->executeHooks($this->methodName, $suiteID); + $this->executeHooks($this->methodName, $suiteID); $response['locate'] = $this->createLink('testsuite', 'browse', "productID=$productID"); $response['message'] = $this->lang->testsuite->successSaved; @@ -188,7 +188,7 @@ class testsuite extends control $this->action->logHistory($actionID, $changes); } - if(isset($this->config->bizVersion)) $this->executeHooks($this->methodName, $suiteID); + $this->executeHooks($this->methodName, $suiteID); $method = $suite->type == 'library' ? 'libView' : 'view'; $response['locate'] = inlink($method, "suiteID=$suiteID"); @@ -250,7 +250,7 @@ class testsuite extends control $this->testsuite->delete($suiteID); - if(isset($this->config->bizVersion)) $this->executeHooks($this->methodName, $suiteID); + $this->executeHooks($this->methodName, $suiteID); /* if ajax request, send result. */ if($this->server->ajax) diff --git a/module/testtask/control.php b/module/testtask/control.php index 4b8f677d85..524615aadc 100644 --- a/module/testtask/control.php +++ b/module/testtask/control.php @@ -106,7 +106,7 @@ class testtask extends control if(dao::isError()) die(js::error(dao::getError())); $this->loadModel('action')->create('testtask', $taskID, 'opened'); - if(isset($this->config->bizVersion)) $this->executeHooks($this->methodName, $taskID); + $this->executeHooks($this->methodName, $taskID); die(js::locate($this->createLink('testtask', 'browse', "productID=$productID"), 'parent')); } @@ -462,7 +462,7 @@ class testtask extends control $this->action->logHistory($actionID, $changes); } - if(isset($this->config->bizVersion)) $this->executeHooks($this->methodName, $taskID); + $this->executeHooks($this->methodName, $taskID); die(js::locate(inlink('view', "taskID=$taskID"), 'parent')); } @@ -510,7 +510,7 @@ class testtask extends control $this->action->logHistory($actionID, $changes); } - if(isset($this->config->bizVersion)) $this->executeHooks($this->methodName, $taskID); + $this->executeHooks($this->methodName, $taskID); if(isonlybody()) $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'parent')); $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $this->createLink('testtask', 'view', "taskID=$taskID"))); @@ -553,7 +553,7 @@ class testtask extends control $this->action->logHistory($actionID, $changes); } - if(isset($this->config->bizVersion)) $this->executeHooks($this->methodName, $taskID); + $this->executeHooks($this->methodName, $taskID); if(isonlybody()) $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'parent')); $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $this->createLink('testtask', 'view', "taskID=$taskID"))); @@ -596,7 +596,7 @@ class testtask extends control $this->action->logHistory($actionID, $changes); } - if(isset($this->config->bizVersion)) $this->executeHooks($this->methodName, $taskID); + $this->executeHooks($this->methodName, $taskID); if(isonlybody()) $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'parent')); $this->send(array('result' => 'success', 'message' => $this->lang->success, 'locate' => $this->createLink('testtask', 'view', "taskID=$taskID"))); @@ -641,7 +641,7 @@ class testtask extends control $this->action->logHistory($actionID, $changes); } - if(isset($this->config->bizVersion)) $this->executeHooks($this->methodName, $taskID); + $this->executeHooks($this->methodName, $taskID); if(isonlybody()) $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'parent')); $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $this->createLink('testtask', 'view', "taskID=$taskID"))); @@ -681,7 +681,7 @@ class testtask extends control $task = $this->testtask->getByID($taskID); $this->testtask->delete(TABLE_TESTTASK, $taskID); - if(isset($this->config->bizVersion)) $this->executeHooks($this->methodName, $taskID); + $this->executeHooks($this->methodName, $taskID); /* if ajax request, send result. */ if($this->server->ajax)