* Fix bug.
This commit is contained in:
@@ -293,6 +293,6 @@ class model extends baseModel
|
||||
}
|
||||
|
||||
$flow = $this->loadModel('workflow')->getByModule($moduleName);
|
||||
if($flow && $action) $this->loadModel('workflowhook')->execute($flow, $action, $objectID);
|
||||
if($flow && $action) return $this->loadModel('workflowhook')->execute($flow, $action, $objectID);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -397,7 +397,8 @@ class bug extends control
|
||||
$this->action->create('todo', $output['todoID'], 'finished', '', "BUG:$bugID");
|
||||
}
|
||||
|
||||
$this->executeHooks($bugID);
|
||||
$message = $this->executeHooks($bugID);
|
||||
if($message) $this->lang->saveSuccess = $message;
|
||||
|
||||
/* Return bug id when call the API. */
|
||||
if($this->viewType == 'json') return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'id' => $bugID));
|
||||
|
||||
@@ -38,7 +38,8 @@ class build extends control
|
||||
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
$this->loadModel('action')->create('build', $buildID, 'opened');
|
||||
|
||||
$this->executeHooks($buildID);
|
||||
$message = $this->executeHooks($buildID);
|
||||
if($message) $this->lang->saveSuccess = $message;
|
||||
|
||||
if($this->viewType == 'json') return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'id' => $buildID));
|
||||
if(isonlybody()) return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'closeModal' => true, 'callback' => "parent.loadExecutionBuilds($executionID, $buildID)")); // Code for task #5126.
|
||||
@@ -130,7 +131,8 @@ class build extends control
|
||||
if(!empty($changes)) $this->action->logHistory($actionID, $changes);
|
||||
}
|
||||
|
||||
$this->executeHooks($buildID);
|
||||
$message = $this->executeHooks($buildID);
|
||||
if($message) $this->lang->saveSuccess = $message;
|
||||
|
||||
return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('view', "buildID=$buildID")));
|
||||
}
|
||||
@@ -316,7 +318,8 @@ class build extends control
|
||||
$build = $this->build->getById($buildID);
|
||||
$this->build->delete(TABLE_BUILD, $buildID);
|
||||
|
||||
$this->executeHooks($buildID);
|
||||
$message = $this->executeHooks($buildID);
|
||||
if($message) $response['message'] = $message;
|
||||
|
||||
/* if ajax request, send result. */
|
||||
if($this->server->ajax)
|
||||
|
||||
@@ -92,7 +92,8 @@ class caselib extends control
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
}
|
||||
|
||||
$this->executeHooks($libID);
|
||||
$message = $this->executeHooks($libID);
|
||||
if($message) $response['message'] = $message;
|
||||
|
||||
$response['locate'] = inlink('view', "libID=$libID");
|
||||
return $this->send($response);
|
||||
@@ -130,7 +131,8 @@ class caselib extends control
|
||||
{
|
||||
$this->caselib->delete($libID);
|
||||
|
||||
$this->executeHooks($libID);
|
||||
$message = $this->executeHooks($libID);
|
||||
if($message) $response['message'] = $message;
|
||||
|
||||
/* if ajax request, send result. */
|
||||
if($this->server->ajax)
|
||||
|
||||
@@ -1379,7 +1379,8 @@ class execution extends control
|
||||
|
||||
$this->loadModel('action')->create($this->objectType, $executionID, 'opened', '', join(',', $_POST['products']));
|
||||
|
||||
$this->executeHooks($executionID);
|
||||
$message = $this->executeHooks($executionID);
|
||||
if($message) $this->lang->saveSuccess = $message;
|
||||
|
||||
if($this->viewType == 'json') return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'id' => $executionID));
|
||||
|
||||
@@ -1553,7 +1554,9 @@ class execution extends control
|
||||
$this->productplan->linkProject($projectID, $newPlans);
|
||||
}
|
||||
|
||||
$this->executeHooks($executionID);
|
||||
$message = $this->executeHooks($executionID);
|
||||
if($message) $this->lang->saveSuccess = $message;
|
||||
|
||||
if($_POST['status'] == 'doing') $this->loadModel('common')->syncPPEStatus($executionID);
|
||||
if($execution->type == 'kanban') return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'parent'));
|
||||
return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('view', "executionID=$executionID")));
|
||||
@@ -2549,7 +2552,8 @@ class execution extends control
|
||||
$this->execution->updateUserView($executionID);
|
||||
|
||||
$this->session->set('execution', '');
|
||||
$this->executeHooks($executionID);
|
||||
$message = $this->executeHooks($executionID);
|
||||
if($message) $this->lang->saveSuccess = $message;
|
||||
|
||||
if($this->viewType == 'json') return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess));
|
||||
return print(js::reload('parent'));
|
||||
|
||||
@@ -364,7 +364,8 @@ class product extends control
|
||||
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
$this->loadModel('action')->create('product', $productID, 'opened');
|
||||
|
||||
$this->executeHooks($productID);
|
||||
$message = $this->executeHooks($productID);
|
||||
if($message) $this->lang->saveSuccess = $message;
|
||||
if($this->viewType == 'json') return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'id' => $productID));
|
||||
|
||||
$tab = $this->app->tab;
|
||||
@@ -518,7 +519,8 @@ class product extends control
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
}
|
||||
|
||||
$this->executeHooks($productID);
|
||||
$message = $this->executeHooks($productID);
|
||||
if($message) $this->lang->saveSuccess = $message;
|
||||
|
||||
$moduleName = $programID ? 'program' : 'product';
|
||||
$methodName = $programID ? 'product' : 'view';
|
||||
@@ -778,7 +780,8 @@ 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', '');
|
||||
$this->executeHooks($productID);
|
||||
$message = $this->executeHooks($productID);
|
||||
if($message) $this->lang->saveSuccess = $message;
|
||||
|
||||
if($this->viewType == 'json') return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess));
|
||||
return print(js::locate($this->createLink('product', 'all'), 'parent'));
|
||||
|
||||
@@ -64,7 +64,8 @@ class productplan extends control
|
||||
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
$this->loadModel('action')->create('productplan', $planID, 'opened');
|
||||
|
||||
$this->executeHooks($planID);
|
||||
$message = $this->executeHooks($planID);
|
||||
if($message) $this->lang->saveSuccess = $message;
|
||||
|
||||
if($parent > 0) $this->productplan->updateParentStatus($parent);
|
||||
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
@@ -132,7 +133,8 @@ class productplan extends control
|
||||
$actionID = $this->loadModel('action')->create('productplan', $planID, 'edited');
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
}
|
||||
$this->executeHooks($planID);
|
||||
$message = $this->executeHooks($planID);
|
||||
if($message) $this->lang->saveSuccess = $message;
|
||||
return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('view', "planID=$planID")));
|
||||
}
|
||||
|
||||
@@ -246,7 +248,8 @@ class productplan extends control
|
||||
{
|
||||
$this->productplan->delete(TABLE_PRODUCTPLAN, $planID);
|
||||
if($plan->parent > 0) $this->productplan->changeParentField($planID);
|
||||
$this->executeHooks($planID);
|
||||
$message = $this->executeHooks($planID);
|
||||
if($message) $this->lang->saveSuccess = $message;
|
||||
|
||||
/* if ajax request, send result. */
|
||||
if($this->server->ajax)
|
||||
@@ -401,6 +404,7 @@ class productplan extends control
|
||||
$planStories = $this->story->getPlanStories($planID, 'all', $type == 'story' ? $sort : 'id_desc', $storyPager);
|
||||
|
||||
$this->executeHooks($planID);
|
||||
|
||||
if($plan->parent > 0) $this->view->parentPlan = $this->productplan->getById($plan->parent);
|
||||
if($plan->parent == '-1') $this->view->childrenPlans = $this->productplan->getChildren($plan->id);
|
||||
|
||||
|
||||
@@ -429,7 +429,9 @@ class project extends control
|
||||
}
|
||||
}
|
||||
|
||||
$this->executeHooks($projectID);
|
||||
$message = $this->executeHooks($projectID);
|
||||
if($message) $this->lang->saveSuccess = $message;
|
||||
|
||||
if($this->viewType == 'json') return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'id' => $projectID));
|
||||
|
||||
if($this->app->tab == 'program')
|
||||
@@ -588,7 +590,9 @@ class project extends control
|
||||
$this->loadModel('productplan')->linkProject($projectID, $newPlans);
|
||||
}
|
||||
|
||||
$this->executeHooks($projectID);
|
||||
$message = $this->executeHooks($projectID);
|
||||
if($message) $this->lang->saveSuccess = $message;
|
||||
|
||||
if(isonlybody()) return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'parent'));
|
||||
|
||||
$locateLink = ($this->session->projectList and $from != 'view') ? $this->session->projectList : inLink('view', "projectID=$projectID");
|
||||
@@ -1726,7 +1730,9 @@ class project extends control
|
||||
$url = $this->createLink('project', 'browse');
|
||||
if($this->app->tab == 'program') $url = $this->createLink('program', 'browse');
|
||||
|
||||
$this->executeHooks($projectID);
|
||||
$message = $this->executeHooks($projectID);
|
||||
if($message) $this->lang->saveSuccess = $message;
|
||||
|
||||
if(empty($executionIdList))
|
||||
{
|
||||
if($this->viewType == 'json') return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess));
|
||||
|
||||
@@ -109,7 +109,9 @@ class projectrelease extends control
|
||||
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
$this->loadModel('action')->create('release', $releaseID, 'opened');
|
||||
|
||||
$this->executeHooks($releaseID);
|
||||
$message = $this->executeHooks($releaseID);
|
||||
if($message) $this->lang->saveSuccess = $message;
|
||||
|
||||
if($this->viewType == 'json') return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'id' => $releaseID));
|
||||
|
||||
return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('view', "releaseID=$releaseID")));
|
||||
@@ -161,7 +163,10 @@ class projectrelease extends control
|
||||
$actionID = $this->loadModel('action')->create('release', $releaseID, 'Edited', $fileAction);
|
||||
if(!empty($changes)) $this->action->logHistory($actionID, $changes);
|
||||
}
|
||||
$this->executeHooks($releaseID);
|
||||
|
||||
$message = $this->executeHooks($releaseID);
|
||||
if($message) $this->lang->saveSuccess = $message;
|
||||
|
||||
return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('view', "releaseID=$releaseID")));
|
||||
}
|
||||
|
||||
@@ -328,7 +333,8 @@ class projectrelease extends control
|
||||
$build = $this->dao->select('*')->from(TABLE_BUILD)->where('id')->eq((int)$release->build)->fetch();
|
||||
if(empty($build->execution)) $this->loadModel('build')->delete(TABLE_BUILD, $build->id);
|
||||
|
||||
$this->executeHooks($releaseID);
|
||||
$message = $this->executeHooks($releaseID);
|
||||
if($message) $response['message'] = $message;
|
||||
|
||||
/* if ajax request, send result. */
|
||||
if($this->server->ajax)
|
||||
|
||||
@@ -72,7 +72,8 @@ class release extends control
|
||||
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
$this->loadModel('action')->create('release', $releaseID, 'opened');
|
||||
|
||||
$this->executeHooks($releaseID);
|
||||
$message = $this->executeHooks($releaseID);
|
||||
if($message) $this->lang->saveSuccess = $message;
|
||||
|
||||
if($this->viewType == 'json') return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'id' => $releaseID));
|
||||
if(isonlybody()) return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'closeModal' => true, 'callback' => "parent.loadProductBuilds($productID)"));
|
||||
@@ -126,7 +127,10 @@ class release extends control
|
||||
$actionID = $this->loadModel('action')->create('release', $releaseID, 'Edited', $fileAction);
|
||||
if(!empty($changes)) $this->action->logHistory($actionID, $changes);
|
||||
}
|
||||
$this->executeHooks($releaseID);
|
||||
|
||||
$message = $this->executeHooks($releaseID);
|
||||
if($message) $this->lang->saveSuccess = $message;
|
||||
|
||||
return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('view', "releaseID=$releaseID")));
|
||||
}
|
||||
$this->loadModel('story');
|
||||
@@ -285,7 +289,8 @@ class release extends control
|
||||
$build = $this->dao->select('*')->from(TABLE_BUILD)->where('id')->eq((int)$release->build)->fetch();
|
||||
if(empty($build->execution)) $this->loadModel('build')->delete(TABLE_BUILD, $build->id);
|
||||
|
||||
$this->executeHooks($releaseID);
|
||||
$message = $this->executeHooks($releaseID);
|
||||
if($message) $response['message'] = $message;
|
||||
|
||||
/* if ajax request, send result. */
|
||||
if($this->server->ajax)
|
||||
|
||||
@@ -178,7 +178,8 @@ class story extends control
|
||||
$this->action->create('todo', $todoID, 'finished', '', "STORY:$storyID");
|
||||
}
|
||||
|
||||
$this->executeHooks($storyID);
|
||||
$message = $this->executeHooks($storyID);
|
||||
if($message) $this->lang->saveSuccess = $message;
|
||||
|
||||
if($this->viewType == 'json') return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'id' => $storyID));
|
||||
|
||||
|
||||
@@ -162,7 +162,8 @@ class task extends control
|
||||
$this->action->create('todo', $todoID, 'finished', '', "TASK:$taskID");
|
||||
}
|
||||
|
||||
$this->executeHooks($taskID);
|
||||
$message = $this->executeHooks($taskID);
|
||||
if($message) $this->lang->saveSuccess = $message;
|
||||
|
||||
/* Return task id when call the API. */
|
||||
if($this->viewType == 'json' or (defined('RUN_MODE') && RUN_MODE == 'api')) return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'id' => $taskID));
|
||||
|
||||
@@ -343,7 +343,8 @@ class testcase extends control
|
||||
/* If the story is linked project, make the case link the project. */
|
||||
$this->testcase->syncCase2Project($caseResult['caseInfo'], $caseID);
|
||||
|
||||
$this->executeHooks($caseID);
|
||||
$message = $this->executeHooks($caseID);
|
||||
if($message) $this->lang->saveSuccess = $message;
|
||||
|
||||
if($this->viewType == 'json') return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'id' => $caseID));
|
||||
/* If link from no head then reload. */
|
||||
@@ -1173,7 +1174,8 @@ class testcase extends control
|
||||
$case = $this->testcase->getById($caseID);
|
||||
$this->testcase->delete(TABLE_CASE, $caseID);
|
||||
|
||||
$this->executeHooks($caseID);
|
||||
$message = $this->executeHooks($caseID);
|
||||
if($message) $response['message'] = $message;
|
||||
|
||||
/* if ajax request, send result. */
|
||||
if($this->server->ajax)
|
||||
|
||||
@@ -118,7 +118,8 @@ class testsuite extends control
|
||||
}
|
||||
$actionID = $this->loadModel('action')->create('testsuite', $suiteID, 'opened');
|
||||
|
||||
$this->executeHooks($suiteID);
|
||||
$message = $this->executeHooks($suiteID);
|
||||
if($message) $response['message'] = $message;
|
||||
|
||||
if($this->viewType == 'json') return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'id' => $suiteID));
|
||||
|
||||
@@ -221,7 +222,8 @@ class testsuite extends control
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
}
|
||||
|
||||
$this->executeHooks($suiteID);
|
||||
$messgae = $this->executeHooks($suiteID);
|
||||
if($message) $response['message'] = $message;
|
||||
|
||||
$response['locate'] = inlink('view', "suiteID=$suiteID");
|
||||
return $this->send($response);
|
||||
@@ -263,7 +265,8 @@ class testsuite extends control
|
||||
|
||||
$this->testsuite->delete($suiteID);
|
||||
|
||||
$this->executeHooks($suiteID);
|
||||
$message = $this->executeHooks($suiteID);
|
||||
if($message) $response['message'] = $message;
|
||||
|
||||
/* if ajax request, send result. */
|
||||
if($this->server->ajax)
|
||||
|
||||
@@ -217,7 +217,9 @@ class testtask extends control
|
||||
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
$this->loadModel('action')->create('testtask', $taskID, 'opened');
|
||||
|
||||
$this->executeHooks($taskID);
|
||||
$message = $this->executeHooks($taskID);
|
||||
if($message) $this->lang->saveSuccess = $message;
|
||||
|
||||
if($this->viewType == 'json') return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'id' => $taskID));
|
||||
|
||||
$task = $this->dao->findById($taskID)->from(TABLE_TESTTASK)->fetch();
|
||||
@@ -726,7 +728,8 @@ class testtask extends control
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
}
|
||||
|
||||
$this->executeHooks($taskID);
|
||||
$message = $this->executeHooks($taskID);
|
||||
if($message) $this->lang->saveSuccess = $message;
|
||||
|
||||
$link = isonlybody() ? 'parent' : $this->session->testtaskList;
|
||||
return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $link));
|
||||
@@ -788,7 +791,8 @@ class testtask extends control
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
}
|
||||
|
||||
$this->executeHooks($taskID);
|
||||
$message = $this->executeHooks($taskID);
|
||||
if($message) $this->lang->saveSuccess = $message;
|
||||
|
||||
if(isonlybody()) return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'parent'));
|
||||
return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $this->createLink('testtask', 'view', "taskID=$taskID")));
|
||||
@@ -830,7 +834,8 @@ class testtask extends control
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
}
|
||||
|
||||
$this->executeHooks($taskID);
|
||||
$message = $this->executeHooks($taskID);
|
||||
if($message) $this->lang->saveSuccess = $message;
|
||||
|
||||
if(isonlybody()) return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'parent'));
|
||||
return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $this->createLink('testtask', 'view', "taskID=$taskID")));
|
||||
@@ -872,7 +877,8 @@ class testtask extends control
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
}
|
||||
|
||||
$this->executeHooks($taskID);
|
||||
$message = $this->executeHooks($taskID);
|
||||
if($message) $this->lang->saveSuccess = $message;
|
||||
|
||||
if(isonlybody()) return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'parent.parent'));
|
||||
return $this->send(array('result' => 'success', 'message' => $this->lang->success, 'locate' => $this->createLink('testtask', 'view', "taskID=$taskID")));
|
||||
@@ -915,7 +921,8 @@ class testtask extends control
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
}
|
||||
|
||||
$this->executeHooks($taskID);
|
||||
$message = $this->executeHooks($taskID);
|
||||
if($message) $this->lang->saveSuccess = $message;
|
||||
|
||||
if(isonlybody()) return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'parent'));
|
||||
return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $this->createLink('testtask', 'view', "taskID=$taskID")));
|
||||
@@ -956,7 +963,8 @@ class testtask extends control
|
||||
$task = $this->testtask->getByID($taskID);
|
||||
$this->testtask->delete(TABLE_TESTTASK, $taskID);
|
||||
|
||||
$this->executeHooks($taskID);
|
||||
$message = $this->executeHooks($taskID);
|
||||
if($message) $response['message'] = $message;
|
||||
|
||||
/* if ajax request, send result. */
|
||||
if($this->server->ajax)
|
||||
|
||||
Reference in New Issue
Block a user