* Code for task #8278 of inner backyard pms.

This commit is contained in:
chenfei
2019-07-13 13:31:44 +08:00
parent b570abd5b6
commit 90014ee5cc
11 changed files with 148 additions and 1 deletions
+20
View File
@@ -295,6 +295,8 @@ class bug extends control
$this->action->create('todo', $output['todoID'], 'finished', '', "BUG:$bugID");
}
if(isset($this->config->bizVersion)) $this->loadModel('workflowResult')->execute($this->moduleName, $this->methodName, $this->bug->getById($bugID));
if(defined('RUN_MODE') && RUN_MODE == 'api') $this->send(array('status' => 'success', 'data' => $bugID));
setcookie('bugModule', (int)$this->post->module, 0, $this->config->webRoot);
@@ -612,6 +614,9 @@ 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->loadModel('workflowResult')->execute($this->moduleName, $this->methodName, $bug);
if($bug->toTask != 0)
{
foreach($changes as $change)
@@ -827,6 +832,8 @@ 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->loadModel('workflowResult')->execute($this->moduleName, $this->methodName, $this->bug->getById($bugID));
if(isonlybody()) die(js::closeModal('parent.parent'));
die(js::locate($this->createLink('bug', 'view', "bugID=$bugID"), 'parent'));
}
@@ -939,6 +946,9 @@ class bug extends control
if(dao::isError()) die(js::error(dao::getError()));
$actionID = $this->action->create('bug', $bugID, 'bugConfirmed', $this->post->comment);
$this->action->logHistory($actionID, $changes);
if(isset($this->config->bizVersion)) $this->loadModel('workflowResult')->execute($this->moduleName, $this->methodName, $this->bug->getById($bugID));
if(isonlybody()) die(js::closeModal('parent.parent'));
die(js::locate($this->createLink('bug', 'view', "bugID=$bugID"), 'parent'));
}
@@ -994,6 +1004,9 @@ class bug extends control
$this->action->logHistory($actionID, $changes);
$bug = $this->bug->getById($bugID);
if(isset($this->config->bizVersion)) $this->loadModel('workflowResult')->execute($this->moduleName, $this->methodName, $bug);
if($bug->toTask != 0)
{
/* If task is not finished, update it's status. */
@@ -1084,6 +1097,8 @@ 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->loadModel('workflowResult')->execute($this->moduleName, $this->methodName, $this->bug->getById($bugID));
if(isonlybody()) die(js::closeModal('parent.parent'));
die(js::locate($this->createLink('bug', 'view', "bugID=$bugID"), 'parent'));
}
@@ -1121,6 +1136,8 @@ 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->loadModel('workflowResult')->execute($this->moduleName, $this->methodName, $this->bug->getById($bugID));
if(isonlybody()) die(js::closeModal('parent.parent'));
if(defined('RUN_MODE') && RUN_MODE == 'api')
{
@@ -1286,6 +1303,9 @@ 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->loadModel('workflowResult')->execute($this->moduleName, $this->methodName, $this->bug->getById($bugID));
die(js::locate($this->session->bugList, 'parent'));
}
}
+8
View File
@@ -25,6 +25,9 @@ class build extends control
$buildID = $this->build->create($projectID);
if(dao::isError()) $this->send(array('result' => 'fail', 'message' => dao::getError()));
$this->loadModel('action')->create('build', $buildID, 'opened');
if(isset($this->config->bizVersion)) $this->loadModel('workflowResult')->execute($this->moduleName, $this->methodName, $this->build->getById($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")));
}
@@ -104,6 +107,9 @@ class build extends control
$actionID = $this->loadModel('action')->create('build', $buildID, 'Edited', $fileAction);
if(!empty($changes)) $this->action->logHistory($actionID, $changes);
}
if(isset($this->config->bizVersion)) $this->loadModel('workflowResult')->execute($this->moduleName, $this->methodName, $this->build->getById($buildID));
$this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('view', "buildID=$buildID")));
}
@@ -255,6 +261,8 @@ class build extends control
$build = $this->build->getById($buildID);
$this->build->delete(TABLE_BUILD, $buildID);
if(isset($this->config->bizVersion)) $this->loadModel('workflowResult')->execute($this->moduleName, $this->methodName, $this->build->getById($buildID));
/* if ajax request, send result. */
if($this->server->ajax)
{
+7
View File
@@ -210,6 +210,8 @@ 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->loadModel('workflowResult')->execute($this->moduleName, $this->methodName, $this->product->getById($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");
$this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $locate));
@@ -258,6 +260,7 @@ class product extends control
$this->action->logHistory($actionID, $changes);
}
if(isset($this->config->bizVersion)) $this->loadModel('workflowResult')->execute($this->moduleName, $this->methodName, $this->product->getById($productID));
$this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('view', "product=$productID")));
}
@@ -356,6 +359,9 @@ class product extends control
$actionID = $this->action->create('product', $productID, 'Closed', $this->post->comment);
$this->action->logHistory($actionID, $changes);
}
if(isset($this->config->bizVersion)) $this->loadModel('workflowResult')->execute($this->moduleName, $this->methodName, $product);
die(js::reload('parent.parent'));
}
@@ -422,6 +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->loadModel('workflowResult')->execute($this->moduleName, $this->methodName, $this->product->getById($productID));
die(js::locate($this->createLink('product', 'browse'), 'parent'));
}
}
+6
View File
@@ -49,6 +49,9 @@ class productplan extends control
$planID = $this->productplan->create();
if(dao::isError()) $this->send(array('result' => 'fail', 'message' => dao::getError()));
$this->loadModel('action')->create('productplan', $planID, 'opened');
if(isset($this->config->bizVersion)) $this->loadModel('workflowResult')->execute($this->moduleName, $this->methodName, $this->productplan->getById($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")));
}
@@ -96,6 +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->loadModel('workflowResult')->execute($this->moduleName, $this->methodName, $this->productplan->getById($planID));
$this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('view', "planID=$planID")));
}
@@ -162,6 +166,8 @@ class productplan extends control
$plan = $this->productplan->getById($planID);
$this->productplan->delete(TABLE_PRODUCTPLAN, $planID);
if(isset($this->config->bizVersion)) $this->loadModel('workflowResult')->execute($this->moduleName, $this->methodName, $this->productplan->getById($planID));
/* if ajax request, send result. */
if($this->server->ajax)
{
+9
View File
@@ -1055,6 +1055,8 @@ class project extends control
$this->loadModel('action')->create('project', $projectID, 'opened', '', join(',', $_POST['products']));
if(isset($this->config->bizVersion)) $this->loadModel('workflowResult')->execute($this->moduleName, $this->methodName, $this->project->getById($projectID));
$planID = reset($_POST['plans']);
if(!empty($planID))
{
@@ -1122,6 +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->loadModel('workflowResult')->execute($this->moduleName, $this->methodName, $this->project->getById($projectID));
$this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('view', "projectID=$projectID")));
}
@@ -1249,6 +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->loadModel('workflowResult')->execute($this->moduleName, $this->methodName, $project);
die(js::reload('parent.parent'));
}
@@ -1283,6 +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->loadModel('workflowResult')->execute($this->moduleName, $this->methodName, $project);
die(js::reload('parent.parent'));
}
@@ -1317,6 +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->loadModel('workflowResult')->execute($this->moduleName, $this->methodName, $project);
die(js::reload('parent.parent'));
}
@@ -1351,6 +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->loadModel('workflowResult')->execute($this->moduleName, $this->methodName, $project);
die(js::reload('parent.parent'));
}
@@ -1392,6 +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->loadModel('workflowResult')->execute($this->moduleName, $this->methodName, $project);
die(js::reload('parent.parent'));
}
@@ -1700,6 +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->loadModel('workflowResult')->execute($this->moduleName, $this->methodName, $this->project->getById($projectID));
die(js::locate(inlink('index'), 'parent'));
}
}
+6
View File
@@ -62,6 +62,9 @@ class release extends control
$releaseID = $this->release->create($productID, $branch);
if(dao::isError()) $this->send(array('result' => 'fail', 'message' => dao::getError()));
$this->loadModel('action')->create('release', $releaseID, 'opened');
if(isset($this->config->bizVersion)) $this->loadModel('workflowResult')->execute($this->moduleName, $this->methodName, $this->release->getById($releaseID));
$this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('view', "releaseID=$releaseID")));
}
@@ -100,6 +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->loadModel('workflowResult')->execute($this->moduleName, $this->methodName, $this->release->getById($releaseID));
$this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('view', "releaseID=$releaseID")));
}
$this->loadModel('story');
@@ -196,6 +200,8 @@ 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->loadModel('workflowResult')->execute($this->moduleName, $this->methodName, $this->release->getById($releaseID));
/* if ajax request, send result. */
if($this->server->ajax)
{
+21
View File
@@ -113,6 +113,8 @@ class story extends control
$this->action->create('todo', $todoID, 'finished', '', "STORY:$storyID");
}
if(isset($this->config->bizVersion)) $this->loadModel('workflowResult')->execute($this->moduleName, $this->methodName, $this->story->getById($storyID));
if($this->post->newStory)
{
$response['message'] = $this->lang->story->successSaved . $this->lang->story->newStory;
@@ -433,6 +435,9 @@ class story extends control
$actionID = $this->action->create('story', $storyID, $action, $this->post->comment);
$this->action->logHistory($actionID, $changes);
}
if(isset($this->config->bizVersion)) $this->loadModel('workflowResult')->execute($this->moduleName, $this->methodName, $this->story->getById($storyID));
if(defined('RUN_MODE') && RUN_MODE == 'api')
{
die(array('status' => 'success', 'data' => $storyID));
@@ -616,6 +621,9 @@ class story extends control
$actionID = $this->action->create('story', $storyID, $action, $fileAction . $this->post->comment);
$this->action->logHistory($actionID, $changes);
}
if(isset($this->config->bizVersion)) $this->loadModel('workflowResult')->execute($this->moduleName, $this->methodName, $this->story->getById($storyID));
die(js::locate($this->createLink('story', 'view', "storyID=$storyID"), 'parent'));
}
@@ -649,6 +657,8 @@ 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->loadModel('workflowResult')->execute($this->moduleName, $this->methodName, $this->story->getById($storyID));
if(isonlybody()) die(js::closeModal('parent.parent', 'this'));
die(js::locate($this->createLink('story', 'view', "storyID=$storyID"), 'parent'));
}
@@ -739,6 +749,9 @@ class story extends control
else
{
$this->story->delete(TABLE_STORY, $storyID);
if(isset($this->config->bizVersion)) $this->loadModel('workflowResult')->execute($this->moduleName, $this->methodName, $this->story->getById($storyID));
die(js::locate($this->session->storyList, 'parent'));
}
}
@@ -762,6 +775,9 @@ class story extends control
{
$this->action->create('story', $storyID, 'Closed', '', ucfirst($this->post->closedReason));
}
if(isset($this->config->bizVersion)) $this->loadModel('workflowResult')->execute($this->moduleName, $this->methodName, $this->story->getById($storyID));
die(js::locate(inlink('view', "storyID=$storyID"), 'parent'));
}
@@ -830,6 +846,9 @@ class story extends control
if(dao::isError()) die(js::error(dao::getError()));
$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->loadModel('workflowResult')->execute($this->moduleName, $this->methodName, $this->story->getById($storyID));
if(isonlybody()) die(js::closeModal('parent.parent', 'this'));
if(defined('RUN_MODE') && RUN_MODE == 'api')
{
@@ -1057,6 +1076,8 @@ class story extends control
$this->action->logHistory($actionID, $changes);
}
if(isset($this->config->bizVersion)) $this->loadModel('workflowResult')->execute($this->moduleName, $this->methodName, $this->story->getById($storyID));
if(isonlybody()) die(js::closeModal('parent.parent', 'this'));
die(js::locate($this->createLink('story', 'view', "storyID=$storyID"), 'parent'));
}
+36 -1
View File
@@ -125,7 +125,11 @@ class task extends control
}
/* If link from no head then reload*/
if(isonlybody()) $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'parent'));
if(isonlybody())
{
if(isset($this->config->bizVersion)) $this->loadModel('workflowResult')->execute($this->moduleName, $this->methodName, $this->task->getById($taskID));
$this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'parent'));
}
if($todoID > 0)
{
@@ -133,6 +137,8 @@ class task extends control
$this->action->create('todo', $todoID, 'finished', '', "TASK:$taskID");
}
if(isset($this->config->bizVersion)) $this->loadModel('workflowResult')->execute($this->moduleName, $this->methodName, $this->task->getById($taskID));
/* Locate the browser. */
if($this->app->getViewType() == 'xhtml')
{
@@ -315,6 +321,8 @@ class task extends control
if(!empty($changes)) $this->action->logHistory($actionID, $changes);
}
if(isset($this->config->bizVersion)) $this->loadModel('workflowResult')->execute($this->moduleName, $this->methodName, $this->task->getById($taskID));
if($task->fromBug != 0)
{
foreach($changes as $change)
@@ -477,6 +485,8 @@ 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->loadModel('workflowResult')->execute($this->moduleName, $this->methodName, $this->task->getById($taskID));
if(isonlybody()) die(js::closeModal('parent.parent', 'this'));
die(js::locate($this->createLink('task', 'view', "taskID=$taskID"), 'parent'));
}
@@ -625,6 +635,9 @@ class task extends control
$task = $this->task->getById($taskID);
$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->loadModel('workflowResult')->execute($this->moduleName, $this->methodName, $this->task->getById($taskID));
die(js::reload('parent'));
}
@@ -654,6 +667,9 @@ 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->loadModel('workflowResult')->execute($this->moduleName, $this->methodName, $task);
if($changes and $this->task->needUpdateBugStatus($task))
{
foreach($changes as $change)
@@ -804,6 +820,8 @@ class task extends control
$this->action->logHistory($actionID, $changes);
}
if(isset($this->config->bizVersion)) $this->loadModel('workflowResult')->execute($this->moduleName, $this->methodName, $task);
if($this->task->needUpdateBugStatus($task))
{
foreach($changes as $change)
@@ -880,6 +898,9 @@ class task extends control
$actionID = $this->action->create('task', $taskID, 'Paused', $this->post->comment);
$this->action->logHistory($actionID, $changes);
}
if(isset($this->config->bizVersion)) $this->loadModel('workflowResult')->execute($this->moduleName, $this->methodName, $this->task->getById($taskID));
if(isonlybody()) die(js::closeModal('parent.parent', 'this'));
die(js::locate($this->createLink('task', 'view', "taskID=$taskID"), 'parent'));
}
@@ -914,6 +935,9 @@ class task extends control
$actionID = $this->action->create('task', $taskID, $act, $this->post->comment);
$this->action->logHistory($actionID, $changes);
}
if(isset($this->config->bizVersion)) $this->loadModel('workflowResult')->execute($this->moduleName, $this->methodName, $this->task->getById($taskID));
if(isonlybody()) die(js::closeModal('parent.parent', 'this'));
die(js::locate($this->createLink('task', 'view', "taskID=$taskID"), 'parent'));
}
@@ -946,6 +970,9 @@ class task extends control
$actionID = $this->action->create('task', $taskID, 'Closed', $this->post->comment);
$this->action->logHistory($actionID, $changes);
}
if(isset($this->config->bizVersion)) $this->loadModel('workflowResult')->execute($this->moduleName, $this->methodName, $this->task->getById($taskID));
if(isonlybody()) die(js::closeModal('parent.parent', 'this'));
if(defined('RUN_MODE') && RUN_MODE == 'api')
{
@@ -1068,6 +1095,9 @@ class task extends control
$actionID = $this->action->create('task', $taskID, 'Canceled', $this->post->comment);
$this->action->logHistory($actionID, $changes);
}
if(isset($this->config->bizVersion)) $this->loadModel('workflowResult')->execute($this->moduleName, $this->methodName, $this->task->getById($taskID));
if(isonlybody()) die(js::closeModal('parent.parent', 'this'));
die(js::locate($this->createLink('task', 'view', "taskID=$taskID"), 'parent'));
}
@@ -1101,6 +1131,9 @@ class task extends control
$actionID = $this->action->create('task', $taskID, 'Activated', $this->post->comment);
$this->action->logHistory($actionID, $changes);
}
if(isset($this->config->bizVersion)) $this->loadModel('workflowResult')->execute($this->moduleName, $this->methodName, $this->task->getById($taskID));
if(isonlybody()) die(js::closeModal('parent.parent', 'this'));
die(js::locate($this->createLink('task', 'view', "taskID=$taskID"), 'parent'));
}
@@ -1143,6 +1176,8 @@ class task extends control
}
}
if(isset($this->config->bizVersion)) $this->loadModel('workflowResult')->execute($this->moduleName, $this->methodName, $task);
die(js::locate($this->session->taskList, 'parent'));
}
}
+11
View File
@@ -238,6 +238,8 @@ class testcase extends control
$this->loadModel('action');
$this->action->create('case', $caseID, 'Opened');
if(isset($this->config->bizVersion)) $this->loadModel('workflowResult')->execute($this->moduleName, $this->methodName, $this->testcase->getById($caseID));
/* If link from no head then reload. */
if(isonlybody()) $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'closeModal' => true));
@@ -564,6 +566,9 @@ class testcase extends control
$actionID = $this->action->create('case', $caseID, $action, $fileAction . $this->post->comment);
$this->action->logHistory($actionID, $changes);
}
if(isset($this->config->bizVersion)) $this->loadModel('workflowResult')->execute($this->moduleName, $this->methodName, $this->testcase->getById($caseID));
die(js::locate($this->createLink('testcase', 'view', "caseID=$caseID"), 'parent'));
}
@@ -773,6 +778,9 @@ class testcase extends control
if(dao::isError()) die(js::error(dao::getError()));
$result = $this->post->result;
$this->loadModel('action')->create('case', $caseID, 'Reviewed', $this->post->comment, ucfirst($result));
if(isset($this->config->bizVersion)) $this->loadModel('workflowResult')->execute($this->moduleName, $this->methodName, $this->testcase->getById($caseID));
die(js::reload('parent.parent'));
}
@@ -816,6 +824,9 @@ class testcase extends control
else
{
$this->testcase->delete(TABLE_CASE, $caseID);
if(isset($this->config->bizVersion)) $this->loadModel('workflowResult')->execute($this->moduleName, $this->methodName, $this->testcase->getById($caseID));
/* if ajax request, send result. */
if($this->server->ajax)
{
+8
View File
@@ -88,6 +88,9 @@ class testsuite extends control
$this->send($response);
}
$actionID = $this->loadModel('action')->create('testsuite', $suiteID, 'opened');
if(isset($this->config->bizVersion)) $this->loadModel('workflowResult')->execute($this->moduleName, $this->methodName, $this->testsuite->getById($suiteID));
$response['locate'] = $this->createLink('testsuite', 'browse', "productID=$productID");
$response['message'] = $this->lang->testsuite->successSaved;
$this->send($response);
@@ -184,6 +187,9 @@ class testsuite extends control
$actionID = $this->loadModel('action')->create($objectType, $suiteID, 'edited');
$this->action->logHistory($actionID, $changes);
}
if(isset($this->config->bizVersion)) $this->loadModel('workflowResult')->execute($this->moduleName, $this->methodName, $this->testsuite->getById($suiteID));
$method = $suite->type == 'library' ? 'libView' : 'view';
$response['locate'] = inlink($method, "suiteID=$suiteID");
$response['message'] = $this->lang->testsuite->successSaved;
@@ -244,6 +250,8 @@ class testsuite extends control
$this->testsuite->delete($suiteID);
if(isset($this->config->bizVersion)) $this->loadModel('workflowResult')->execute($this->moduleName, $this->methodName, $this->testsuite->getById($suiteID));
/* if ajax request, send result. */
if($this->server->ajax)
{
+16
View File
@@ -105,6 +105,9 @@ class testtask extends control
$taskID = $this->testtask->create();
if(dao::isError()) die(js::error(dao::getError()));
$this->loadModel('action')->create('testtask', $taskID, 'opened');
if(isset($this->config->bizVersion)) $this->loadModel('workflowResult')->execute($this->moduleName, $this->methodName, $this->testtask->getById($taskID));
die(js::locate($this->createLink('testtask', 'browse', "productID=$productID"), 'parent'));
}
@@ -458,6 +461,9 @@ class testtask extends control
$actionID = $this->loadModel('action')->create('testtask', $taskID, 'edited', $this->post->comment);
$this->action->logHistory($actionID, $changes);
}
if(isset($this->config->bizVersion)) $this->loadModel('workflowResult')->execute($this->moduleName, $this->methodName, $this->testtask->getById($taskID));
die(js::locate(inlink('view', "taskID=$taskID"), 'parent'));
}
@@ -504,6 +510,8 @@ class testtask extends control
$this->action->logHistory($actionID, $changes);
}
if(isset($this->config->bizVersion)) $this->loadModel('workflowResult')->execute($this->moduleName, $this->methodName, $this->testtask->getById($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")));
}
@@ -545,6 +553,8 @@ class testtask extends control
$this->action->logHistory($actionID, $changes);
}
if(isset($this->config->bizVersion)) $this->loadModel('workflowResult')->execute($this->moduleName, $this->methodName, $this->testtask->getById($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")));
}
@@ -586,6 +596,8 @@ class testtask extends control
$this->action->logHistory($actionID, $changes);
}
if(isset($this->config->bizVersion)) $this->loadModel('workflowResult')->execute($this->moduleName, $this->methodName, $this->testtask->getById($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")));
}
@@ -629,6 +641,8 @@ class testtask extends control
$this->action->logHistory($actionID, $changes);
}
if(isset($this->config->bizVersion)) $this->loadModel('workflowResult')->execute($this->moduleName, $this->methodName, $this->testtask->getById($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")));
}
@@ -667,6 +681,8 @@ class testtask extends control
$task = $this->testtask->getByID($taskID);
$this->testtask->delete(TABLE_TESTTASK, $taskID);
if(isset($this->config->bizVersion)) $this->loadModel('workflowResult')->execute($this->moduleName, $this->methodName, $task);
/* if ajax request, send result. */
if($this->server->ajax)
{