* Optimize the function executeHooks.

This commit is contained in:
liugang
2019-07-25 13:02:18 +08:00
parent d5e9999636
commit 621f338faa
12 changed files with 79 additions and 86 deletions
+8 -8
View File
@@ -106,7 +106,7 @@ class testtask extends control
if(dao::isError()) die(js::error(dao::getError()));
$this->loadModel('action')->create('testtask', $taskID, 'opened');
$this->executeHooks($this->methodName, $taskID);
$this->executeHooks($taskID);
die(js::locate($this->createLink('testtask', 'browse', "productID=$productID"), 'parent'));
}
@@ -216,7 +216,7 @@ class testtask extends control
$this->testtask->setMenu($this->products, $productID, $task->branch, $taskID);
$this->executeHooks($this->methodName, $taskID);
$this->executeHooks($taskID);
$this->view->title = "TASK #$task->id $task->name/" . $this->products[$productID];
$this->view->position[] = html::a($this->createLink('testtask', 'browse', "productID=$productID"), $this->products[$productID]);
@@ -464,7 +464,7 @@ class testtask extends control
$this->action->logHistory($actionID, $changes);
}
$this->executeHooks($this->methodName, $taskID);
$this->executeHooks($taskID);
die(js::locate(inlink('view', "taskID=$taskID"), 'parent'));
}
@@ -512,7 +512,7 @@ class testtask extends control
$this->action->logHistory($actionID, $changes);
}
$this->executeHooks($this->methodName, $taskID);
$this->executeHooks($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")));
@@ -555,7 +555,7 @@ class testtask extends control
$this->action->logHistory($actionID, $changes);
}
$this->executeHooks($this->methodName, $taskID);
$this->executeHooks($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")));
@@ -598,7 +598,7 @@ class testtask extends control
$this->action->logHistory($actionID, $changes);
}
$this->executeHooks($this->methodName, $taskID);
$this->executeHooks($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")));
@@ -643,7 +643,7 @@ class testtask extends control
$this->action->logHistory($actionID, $changes);
}
$this->executeHooks($this->methodName, $taskID);
$this->executeHooks($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")));
@@ -683,7 +683,7 @@ class testtask extends control
$task = $this->testtask->getByID($taskID);
$this->testtask->delete(TABLE_TESTTASK, $taskID);
$this->executeHooks($this->methodName, $taskID);
$this->executeHooks($taskID);
/* if ajax request, send result. */
if($this->server->ajax)