Merge branch 'master' of github.com:easysoft/zentaopms
This commit is contained in:
@@ -198,24 +198,17 @@ class control extends baseControl
|
||||
/**
|
||||
* Execute hooks of a method.
|
||||
*
|
||||
* @param string $methodName
|
||||
* @param int $objectID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function executeHooks($methodName, $objectID)
|
||||
public function executeHooks($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';
|
||||
if(is_file($flowFile) && is_file($actionFile) && is_file($hookFile))
|
||||
{
|
||||
$flow = $this->loadModel('workflow')->getByModule($this->moduleName);
|
||||
$action = $this->loadModel('workflowaction')->getByModuleAndAction($this->moduleName, $this->methodName);
|
||||
if($flow && $action) $this->loadModel('workflowhook')->execute($flow, $action, $objectID);
|
||||
}
|
||||
$flow = $this->loadModel('workflow')->getByModule($this->moduleName);
|
||||
$action = $this->loadModel('workflowaction')->getByModuleAndAction($this->moduleName, $this->methodName);
|
||||
if($flow && $action) $this->loadModel('workflowhook')->execute($flow, $action, $objectID);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+59
-13
@@ -233,9 +233,7 @@ class router extends baseRouter
|
||||
*/
|
||||
public function loadConfig($moduleName, $appName = '')
|
||||
{
|
||||
$appName = '';
|
||||
|
||||
return parent::loadModuleConfig($moduleName, $appName);
|
||||
return parent::loadModuleConfig($moduleName);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -278,16 +276,15 @@ class router extends baseRouter
|
||||
{
|
||||
if($flow->buildin && $this->methodName == 'browselabel')
|
||||
{
|
||||
$this->workflowModule = $this->moduleName;
|
||||
$this->workflowMethod = 'browse';
|
||||
$this->workflowModule = $this->moduleName;
|
||||
$this->workflowMethod = 'browse';
|
||||
|
||||
$this->loadModuleConfig('workflowaction');
|
||||
$this->loadModuleConfig('workflowaction');
|
||||
|
||||
$moduleName = 'flow';
|
||||
$methodName = 'browse';
|
||||
$moduleName = 'flow';
|
||||
$methodName = 'browse';
|
||||
|
||||
$this->setModuleName($moduleName);
|
||||
$this->setMethodName($methodName);
|
||||
$this->setFlowURI($moduleName, $methodName);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -302,8 +299,7 @@ class router extends baseRouter
|
||||
$moduleName = 'flow';
|
||||
$methodName = in_array($this->methodName, $this->config->workflowaction->default->actions) ? $this->methodName : 'operate';
|
||||
|
||||
$this->setModuleName($moduleName);
|
||||
$this->setMethodName($methodName);
|
||||
$this->setFlowURI($moduleName, $methodName);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -313,6 +309,56 @@ class router extends baseRouter
|
||||
return parent::setControlFile($exitIfNone);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset URI to flow's URI.
|
||||
*
|
||||
* @param string $moduleName
|
||||
* @param string $methodName
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function setFlowURI($moduleName, $methodName)
|
||||
{
|
||||
$this->setModuleName($moduleName);
|
||||
$this->setMethodName($methodName);
|
||||
if($this->config->requestType != 'GET')
|
||||
{
|
||||
$params = explode($this->config->requestFix, $this->URI);
|
||||
|
||||
/* Remove module and method. */
|
||||
$params = array_slice($params, 2);
|
||||
|
||||
/* Prepend other params. */
|
||||
if($methodName == 'operate') array_unshift($params, $this->workflowMethod);
|
||||
array_unshift($params, $this->workflowModule);
|
||||
array_unshift($params, $methodName);
|
||||
array_unshift($params, $moduleName);
|
||||
|
||||
$this->URI = implode($this->config->requestFix, $params);
|
||||
}
|
||||
else
|
||||
{
|
||||
$params = parse_url($this->URI);
|
||||
/* Extract $path and $query from $params. */
|
||||
extract($params);
|
||||
parse_str($query, $params);
|
||||
/* Remove module and method. */
|
||||
unset($params[$this->config->moduleVar]);
|
||||
unset($params[$this->config->methodVar]);
|
||||
|
||||
$params = array_reverse($params);
|
||||
|
||||
/* Prepend other params. */
|
||||
$params['module'] = $this->workflowModule;
|
||||
$params[$this->config->methodVar] = $methodName;
|
||||
$params[$this->config->moduleVar] = $moduleName;
|
||||
|
||||
$params = array_reverse($params);
|
||||
|
||||
$this->URI = $path . '?' . http_build_query($params);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* PATH_INFO方式解析,获取$URI和$viewType。
|
||||
* Parse PATH_INFO, get the $URI and $viewType.
|
||||
@@ -360,7 +406,7 @@ class router extends baseRouter
|
||||
$passedParams = array_reverse($passedParams);
|
||||
if(!in_array($this->workflowMethod, $this->config->workflowaction->default->actions))
|
||||
{
|
||||
$passedParams['method'] = $this->workflowMethod;
|
||||
$passedParams['action'] = $this->workflowMethod;
|
||||
}
|
||||
$passedParams['module'] = $this->workflowModule;
|
||||
|
||||
|
||||
@@ -20,6 +20,60 @@ helper::import(dirname(dirname(__FILE__)) . '/base/pager/pager.class.php');
|
||||
*/
|
||||
class pager extends basePager
|
||||
{
|
||||
/**
|
||||
* 设置模块名。
|
||||
* Set the $moduleName property.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function setModuleName()
|
||||
{
|
||||
if(isset($this->app->workflowModule))
|
||||
{
|
||||
$this->moduleName = $this->app->workflowModule;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->moduleName = $this->app->getModuleName();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置方法名。
|
||||
* Set the $methodName property.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function setMethodName()
|
||||
{
|
||||
if(isset($this->app->workflowMethod))
|
||||
{
|
||||
$this->methodName = $this->app->workflowMethod;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->methodName = $this->app->getMethodName();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 从请求网址中获取记录总数、每页记录数、页码。
|
||||
* Get recTotal, recPerpage, pageID from the request params, and add them to params.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function setParams()
|
||||
{
|
||||
parent::setParams();
|
||||
if(isset($this->app->workflowModule) && isset($this->app->workflowMethod))
|
||||
{
|
||||
unset($this->params['module']);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show pager.
|
||||
*
|
||||
|
||||
@@ -4,7 +4,6 @@ $(function()
|
||||
var preValue = '';
|
||||
$(document).on('change', '#blockParams #paramstype', function()
|
||||
{
|
||||
console.log(preValue);
|
||||
$title = $('#blockParams').find('#title');
|
||||
var value = $(this).find('option:selected').html();
|
||||
if($title.val().indexOf(blockTitle + ' - ' + preValue) >= 0) $title.val(blockTitle + ' - ' + value);
|
||||
|
||||
+10
-8
@@ -295,7 +295,7 @@ class bug extends control
|
||||
$this->action->create('todo', $output['todoID'], 'finished', '', "BUG:$bugID");
|
||||
}
|
||||
|
||||
$this->executeHooks($this->methodName, $bugID);
|
||||
$this->executeHooks($bugID);
|
||||
|
||||
if(defined('RUN_MODE') && RUN_MODE == 'api') $this->send(array('status' => 'success', 'data' => $bugID));
|
||||
|
||||
@@ -554,6 +554,8 @@ class bug extends control
|
||||
$productName = $this->products[$productID];
|
||||
$branches = $this->session->currentProductType == 'normal' ? array() : $this->loadModel('branch')->getPairs($bug->product);
|
||||
|
||||
$this->executeHooks($bugID);
|
||||
|
||||
/* Header and positon. */
|
||||
$this->view->title = "BUG #$bug->id $bug->title - " . $this->products[$productID];
|
||||
$this->view->position[] = html::a($this->createLink('bug', 'browse', "productID=$productID"), $productName);
|
||||
@@ -615,7 +617,7 @@ class bug extends control
|
||||
if(defined('RUN_MODE') && RUN_MODE == 'api') $this->send(array('status' => 'success', 'data' => $bugID));
|
||||
$bug = $this->bug->getById($bugID);
|
||||
|
||||
$this->executeHooks($this->methodName, $bugID);
|
||||
$this->executeHooks($bugID);
|
||||
|
||||
if($bug->toTask != 0)
|
||||
{
|
||||
@@ -832,7 +834,7 @@ class bug extends control
|
||||
$actionID = $this->action->create('bug', $bugID, 'Assigned', $this->post->comment, $this->post->assignedTo);
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
|
||||
$this->executeHooks($this->methodName, $bugID);
|
||||
$this->executeHooks($bugID);
|
||||
|
||||
if(isonlybody()) die(js::closeModal('parent.parent'));
|
||||
die(js::locate($this->createLink('bug', 'view', "bugID=$bugID"), 'parent'));
|
||||
@@ -947,7 +949,7 @@ class bug extends control
|
||||
$actionID = $this->action->create('bug', $bugID, 'bugConfirmed', $this->post->comment);
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
|
||||
$this->executeHooks($this->methodName, $bugID);
|
||||
$this->executeHooks($bugID);
|
||||
|
||||
if(isonlybody()) die(js::closeModal('parent.parent'));
|
||||
die(js::locate($this->createLink('bug', 'view', "bugID=$bugID"), 'parent'));
|
||||
@@ -1005,7 +1007,7 @@ class bug extends control
|
||||
|
||||
$bug = $this->bug->getById($bugID);
|
||||
|
||||
$this->executeHooks($this->methodName, $bugID);
|
||||
$this->executeHooks($bugID);
|
||||
|
||||
if($bug->toTask != 0)
|
||||
{
|
||||
@@ -1097,7 +1099,7 @@ class bug extends control
|
||||
$actionID = $this->action->create('bug', $bugID, 'Activated', $this->post->comment);
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
|
||||
$this->executeHooks($this->methodName, $bugID);
|
||||
$this->executeHooks($bugID);
|
||||
|
||||
if(isonlybody()) die(js::closeModal('parent.parent'));
|
||||
die(js::locate($this->createLink('bug', 'view', "bugID=$bugID"), 'parent'));
|
||||
@@ -1136,7 +1138,7 @@ class bug extends control
|
||||
$actionID = $this->action->create('bug', $bugID, 'Closed', $this->post->comment);
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
|
||||
$this->executeHooks($this->methodName, $bugID);
|
||||
$this->executeHooks($bugID);
|
||||
|
||||
if(isonlybody()) die(js::closeModal('parent.parent'));
|
||||
if(defined('RUN_MODE') && RUN_MODE == 'api')
|
||||
@@ -1304,7 +1306,7 @@ class bug extends control
|
||||
$this->bug->delete(TABLE_BUG, $bugID);
|
||||
if($bug->toTask != 0) echo js::alert($this->lang->bug->remindTask . $bug->toTask);
|
||||
|
||||
$this->executeHooks($this->methodName, $bugID);
|
||||
$this->executeHooks($bugID);
|
||||
|
||||
die(js::locate($this->session->bugList, 'parent'));
|
||||
}
|
||||
|
||||
@@ -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');
|
||||
|
||||
$this->executeHooks($this->methodName, $buildID);
|
||||
$this->executeHooks($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);
|
||||
}
|
||||
|
||||
$this->executeHooks($this->methodName, $buildID);
|
||||
$this->executeHooks($buildID);
|
||||
|
||||
$this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('view', "buildID=$buildID")));
|
||||
}
|
||||
@@ -230,6 +230,8 @@ class build extends control
|
||||
$this->view->type = $type;
|
||||
}
|
||||
|
||||
$this->executeHooks($buildID);
|
||||
|
||||
/* Assign. */
|
||||
$this->view->users = $this->loadModel('user')->getPairs('noletter');
|
||||
$this->view->build = $build;
|
||||
@@ -261,7 +263,7 @@ class build extends control
|
||||
$build = $this->build->getById($buildID);
|
||||
$this->build->delete(TABLE_BUILD, $buildID);
|
||||
|
||||
$this->executeHooks($this->methodName, $buildID);
|
||||
$this->executeHooks($buildID);
|
||||
|
||||
/* if ajax request, send result. */
|
||||
if($this->server->ajax)
|
||||
|
||||
@@ -1183,11 +1183,6 @@ EOD;
|
||||
$orderBy = $this->session->$orderBy;
|
||||
if(empty($queryCondition) or $this->session->$typeOnlyCondition)
|
||||
{
|
||||
if($type='story')
|
||||
{
|
||||
$queryCondition=false;
|
||||
$orderBy=false;
|
||||
}
|
||||
$queryObjects = $this->dao->select('*')->from($table)->where('id')->eq($objectID)
|
||||
->beginIF($queryCondition != false)->orWhere($queryCondition)->fi()
|
||||
->beginIF($orderBy != false)->orderBy($orderBy)->fi()
|
||||
|
||||
@@ -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');
|
||||
|
||||
$this->executeHooks($this->methodName, $productID);
|
||||
$this->executeHooks($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);
|
||||
}
|
||||
|
||||
$this->executeHooks($this->methodName, $productID);
|
||||
$this->executeHooks($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);
|
||||
}
|
||||
|
||||
$this->executeHooks($this->methodName, $productID);
|
||||
$this->executeHooks($productID);
|
||||
|
||||
die(js::reload('parent.parent'));
|
||||
}
|
||||
@@ -394,6 +394,8 @@ class product extends control
|
||||
$this->app->loadClass('pager', $static = true);
|
||||
$pager = new pager(0, 30, 1);
|
||||
|
||||
$this->executeHooks($productID);
|
||||
|
||||
$this->view->title = $product->name . $this->lang->colon . $this->lang->product->view;
|
||||
$this->view->position[] = html::a($this->createLink($this->moduleName, 'browse'), $product->name);
|
||||
$this->view->position[] = $this->lang->product->view;
|
||||
@@ -428,7 +430,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。
|
||||
$this->executeHooks($this->methodName, $productID);
|
||||
$this->executeHooks($productID);
|
||||
die(js::locate($this->createLink('product', 'browse'), 'parent'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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');
|
||||
|
||||
$this->executeHooks($this->methodName, $planID);
|
||||
$this->executeHooks($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);
|
||||
}
|
||||
$this->executeHooks($this->methodName, $planID);
|
||||
$this->executeHooks($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);
|
||||
|
||||
$this->executeHooks($this->methodName, $planID);
|
||||
$this->executeHooks($planID);
|
||||
|
||||
/* if ajax request, send result. */
|
||||
if($this->server->ajax)
|
||||
@@ -276,6 +276,8 @@ class productplan extends control
|
||||
$orderBy = str_replace('id', 'order', $orderBy);
|
||||
}
|
||||
|
||||
$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);
|
||||
|
||||
|
||||
@@ -1055,7 +1055,7 @@ class project extends control
|
||||
|
||||
$this->loadModel('action')->create('project', $projectID, 'opened', '', join(',', $_POST['products']));
|
||||
|
||||
$this->executeHooks($this->methodName, $projectID);
|
||||
$this->executeHooks($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);
|
||||
}
|
||||
$this->executeHooks($this->methodName, $projectID);
|
||||
$this->executeHooks($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);
|
||||
}
|
||||
$this->executeHooks($this->methodName, $projectID);
|
||||
$this->executeHooks($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);
|
||||
}
|
||||
$this->executeHooks($this->methodName, $projectID);
|
||||
$this->executeHooks($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);
|
||||
}
|
||||
$this->executeHooks($this->methodName, $projectID);
|
||||
$this->executeHooks($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);
|
||||
}
|
||||
$this->executeHooks($this->methodName, $projectID);
|
||||
$this->executeHooks($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);
|
||||
}
|
||||
$this->executeHooks($this->methodName, $projectID);
|
||||
$this->executeHooks($projectID);
|
||||
die(js::reload('parent.parent'));
|
||||
}
|
||||
|
||||
@@ -1441,6 +1441,8 @@ class project extends control
|
||||
$this->app->loadClass('pager', $static = true);
|
||||
$pager = new pager(0, 30, 1);
|
||||
|
||||
$this->executeHooks($projectID);
|
||||
|
||||
$this->view->title = $this->lang->project->view;
|
||||
$this->view->position[] = html::a($this->createLink('project', 'browse', "projectID=$projectID"), $project->name);
|
||||
$this->view->position[] = $this->view->title;
|
||||
@@ -1708,7 +1710,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', '');
|
||||
$this->executeHooks($this->methodName, $projectID);
|
||||
$this->executeHooks($projectID);
|
||||
die(js::locate(inlink('index'), 'parent'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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');
|
||||
|
||||
$this->executeHooks($this->methodName, $releaseID);
|
||||
$this->executeHooks($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);
|
||||
}
|
||||
$this->executeHooks($this->methodName, $releaseID);
|
||||
$this->executeHooks($releaseID);
|
||||
$this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('view', "releaseID=$releaseID")));
|
||||
}
|
||||
$this->loadModel('story');
|
||||
@@ -162,6 +162,8 @@ class release extends control
|
||||
$this->commonAction($release->product);
|
||||
$product = $this->product->getById($release->product);
|
||||
|
||||
$this->executeHooks($releaseID);
|
||||
|
||||
$this->view->title = "RELEASE #$release->id $release->name/" . $product->name;
|
||||
$this->view->position[] = $this->lang->release->view;
|
||||
$this->view->release = $release;
|
||||
@@ -200,7 +202,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);
|
||||
|
||||
$this->executeHooks($this->methodName, $releaseID);
|
||||
$this->executeHooks($releaseID);
|
||||
|
||||
/* if ajax request, send result. */
|
||||
if($this->server->ajax)
|
||||
|
||||
@@ -113,7 +113,7 @@ class story extends control
|
||||
$this->action->create('todo', $todoID, 'finished', '', "STORY:$storyID");
|
||||
}
|
||||
|
||||
$this->executeHooks($this->methodName, $storyID);
|
||||
$this->executeHooks($storyID);
|
||||
|
||||
if($this->post->newStory)
|
||||
{
|
||||
@@ -436,7 +436,7 @@ class story extends control
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
}
|
||||
|
||||
$this->executeHooks($this->methodName, $storyID);
|
||||
$this->executeHooks($storyID);
|
||||
|
||||
if(defined('RUN_MODE') && RUN_MODE == 'api')
|
||||
{
|
||||
@@ -622,7 +622,7 @@ class story extends control
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
}
|
||||
|
||||
$this->executeHooks($this->methodName, $storyID);
|
||||
$this->executeHooks($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);
|
||||
|
||||
$this->executeHooks($this->methodName, $storyID);
|
||||
$this->executeHooks($storyID);
|
||||
|
||||
if(isonlybody()) die(js::closeModal('parent.parent', 'this'));
|
||||
die(js::locate($this->createLink('story', 'view', "storyID=$storyID"), 'parent'));
|
||||
@@ -705,6 +705,8 @@ class story extends control
|
||||
if($project->status == 'done') $from = '';
|
||||
}
|
||||
|
||||
$this->executeHooks($storyID);
|
||||
|
||||
$title = "STORY #$story->id $story->title - $product->name";
|
||||
$position[] = html::a($this->createLink('product', 'browse', "product=$product->id&branch=$story->branch"), $product->name);
|
||||
$position[] = $this->lang->story->common;
|
||||
@@ -750,7 +752,7 @@ class story extends control
|
||||
{
|
||||
$this->story->delete(TABLE_STORY, $storyID);
|
||||
|
||||
$this->executeHooks($this->methodName, $storyID);
|
||||
$this->executeHooks($storyID);
|
||||
|
||||
die(js::locate($this->session->storyList, 'parent'));
|
||||
}
|
||||
@@ -776,7 +778,7 @@ class story extends control
|
||||
$this->action->create('story', $storyID, 'Closed', '', ucfirst($this->post->closedReason));
|
||||
}
|
||||
|
||||
$this->executeHooks($this->methodName, $storyID);
|
||||
$this->executeHooks($storyID);
|
||||
|
||||
die(js::locate(inlink('view', "storyID=$storyID"), 'parent'));
|
||||
}
|
||||
@@ -847,7 +849,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);
|
||||
|
||||
$this->executeHooks($this->methodName, $storyID);
|
||||
$this->executeHooks($storyID);
|
||||
|
||||
if(isonlybody()) die(js::closeModal('parent.parent', 'this'));
|
||||
if(defined('RUN_MODE') && RUN_MODE == 'api')
|
||||
@@ -1076,7 +1078,7 @@ class story extends control
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
}
|
||||
|
||||
$this->executeHooks($this->methodName, $storyID);
|
||||
$this->executeHooks($storyID);
|
||||
|
||||
if(isonlybody()) die(js::closeModal('parent.parent', 'this'));
|
||||
die(js::locate($this->createLink('story', 'view', "storyID=$storyID"), 'parent'));
|
||||
|
||||
@@ -1870,7 +1870,7 @@ class storyModel extends model
|
||||
->page($pager)
|
||||
->fetchAll();
|
||||
|
||||
$this->loadModel('common')->saveQueryCondition($this->dao->get(), 'story');
|
||||
$this->loadModel('common')->saveQueryCondition($this->dao->get(), 'story', false);
|
||||
$productIdList = array();
|
||||
foreach($stories as $story) $productIdList[$story->product] = $story->product;
|
||||
|
||||
|
||||
+15
-13
@@ -127,7 +127,7 @@ class task extends control
|
||||
/* If link from no head then reload*/
|
||||
if(isonlybody())
|
||||
{
|
||||
$this->executeHooks($this->methodName, $taskID);
|
||||
$this->executeHooks($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");
|
||||
}
|
||||
|
||||
$this->executeHooks($this->methodName, $taskID);
|
||||
$this->executeHooks($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);
|
||||
}
|
||||
|
||||
$this->executeHooks($this->methodName, $taskID);
|
||||
$this->executeHooks($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);
|
||||
|
||||
$this->executeHooks($this->methodName, $taskID);
|
||||
$this->executeHooks($taskID);
|
||||
|
||||
if(isonlybody()) die(js::closeModal('parent.parent', 'this'));
|
||||
die(js::locate($this->createLink('task', 'view', "taskID=$taskID"), 'parent'));
|
||||
@@ -606,6 +606,8 @@ class task extends control
|
||||
$project = $this->project->getById($task->project);
|
||||
$this->project->setMenu($this->project->getPairs(), $project->id);
|
||||
|
||||
$this->executeHooks($taskID);
|
||||
|
||||
$title = "TASK#$task->id $task->name / $project->name";
|
||||
$position[] = html::a($this->createLink('project', 'browse', "projectID=$task->project"), $project->name);
|
||||
$position[] = $this->lang->task->common;
|
||||
@@ -636,7 +638,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);
|
||||
|
||||
$this->executeHooks($this->methodName, $taskID);
|
||||
$this->executeHooks($taskID);
|
||||
|
||||
die(js::reload('parent'));
|
||||
}
|
||||
@@ -668,7 +670,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);
|
||||
|
||||
$this->executeHooks($this->methodName, $taskID);
|
||||
$this->executeHooks($taskID);
|
||||
|
||||
if($changes and $this->task->needUpdateBugStatus($task))
|
||||
{
|
||||
@@ -820,7 +822,7 @@ class task extends control
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
}
|
||||
|
||||
$this->executeHooks($this->methodName, $taskID);
|
||||
$this->executeHooks($taskID);
|
||||
|
||||
if($this->task->needUpdateBugStatus($task))
|
||||
{
|
||||
@@ -899,7 +901,7 @@ class task extends control
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
}
|
||||
|
||||
$this->executeHooks($this->methodName, $taskID);
|
||||
$this->executeHooks($taskID);
|
||||
|
||||
if(isonlybody()) die(js::closeModal('parent.parent', 'this'));
|
||||
die(js::locate($this->createLink('task', 'view', "taskID=$taskID"), 'parent'));
|
||||
@@ -936,7 +938,7 @@ class task extends control
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
}
|
||||
|
||||
$this->executeHooks($this->methodName, $taskID);
|
||||
$this->executeHooks($taskID);
|
||||
|
||||
if(isonlybody()) die(js::closeModal('parent.parent', 'this'));
|
||||
die(js::locate($this->createLink('task', 'view', "taskID=$taskID"), 'parent'));
|
||||
@@ -971,7 +973,7 @@ class task extends control
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
}
|
||||
|
||||
$this->executeHooks($this->methodName, $taskID);
|
||||
$this->executeHooks($taskID);
|
||||
|
||||
if(isonlybody()) die(js::closeModal('parent.parent', 'this'));
|
||||
if(defined('RUN_MODE') && RUN_MODE == 'api')
|
||||
@@ -1096,7 +1098,7 @@ class task extends control
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
}
|
||||
|
||||
$this->executeHooks($this->methodName, $taskID);
|
||||
$this->executeHooks($taskID);
|
||||
|
||||
if(isonlybody()) die(js::closeModal('parent.parent', 'this'));
|
||||
die(js::locate($this->createLink('task', 'view', "taskID=$taskID"), 'parent'));
|
||||
@@ -1132,7 +1134,7 @@ class task extends control
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
}
|
||||
|
||||
$this->executeHooks($this->methodName, $taskID);
|
||||
$this->executeHooks($taskID);
|
||||
|
||||
if(isonlybody()) die(js::closeModal('parent.parent', 'this'));
|
||||
die(js::locate($this->createLink('task', 'view', "taskID=$taskID"), 'parent'));
|
||||
@@ -1176,7 +1178,7 @@ class task extends control
|
||||
}
|
||||
}
|
||||
|
||||
$this->executeHooks($this->methodName, $taskID);
|
||||
$this->executeHooks($taskID);
|
||||
|
||||
die(js::locate($this->session->taskList, 'parent'));
|
||||
}
|
||||
|
||||
@@ -217,7 +217,7 @@
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<?php if(isset($this->config->bizVersion)) $this->loadModel('flow')->printFields($app->moduleName, $app->methodName, 'div', 'position=right&divCell=false');?>
|
||||
<?php $this->printExtendFields($task, 'div', 'position=right&divCell=false');?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -276,7 +276,7 @@
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
<?php if(isset($this->config->bizVersion)) $this->loadModel('flow')->printFields($app->moduleName, $app->methodName, 'div', 'position=left&divCell=false');?>
|
||||
<?php $this->printExtendFields($task, 'div', 'position=left&divCell=false');?>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@@ -238,7 +238,7 @@ class testcase extends control
|
||||
$this->loadModel('action');
|
||||
$this->action->create('case', $caseID, 'Opened');
|
||||
|
||||
$this->executeHooks($this->methodName, $caseID);
|
||||
$this->executeHooks($caseID);
|
||||
|
||||
/* If link from no head then reload. */
|
||||
if(isonlybody()) $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'closeModal' => true));
|
||||
@@ -516,6 +516,8 @@ class testcase extends control
|
||||
->fetch('count');
|
||||
$case->caseFails = $caseFails;
|
||||
|
||||
$this->executeHooks($caseID);
|
||||
|
||||
$this->view->position[] = $this->lang->testcase->common;
|
||||
$this->view->position[] = $this->lang->testcase->view;
|
||||
|
||||
@@ -567,7 +569,7 @@ class testcase extends control
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
}
|
||||
|
||||
$this->executeHooks($this->methodName, $caseID);
|
||||
$this->executeHooks($caseID);
|
||||
|
||||
die(js::locate($this->createLink('testcase', 'view', "caseID=$caseID"), 'parent'));
|
||||
}
|
||||
@@ -779,7 +781,7 @@ class testcase extends control
|
||||
$result = $this->post->result;
|
||||
$this->loadModel('action')->create('case', $caseID, 'Reviewed', $this->post->comment, ucfirst($result));
|
||||
|
||||
$this->executeHooks($this->methodName, $caseID);
|
||||
$this->executeHooks($caseID);
|
||||
|
||||
die(js::reload('parent.parent'));
|
||||
}
|
||||
@@ -825,7 +827,7 @@ class testcase extends control
|
||||
{
|
||||
$this->testcase->delete(TABLE_CASE, $caseID);
|
||||
|
||||
$this->executeHooks($this->methodName, $caseID);
|
||||
$this->executeHooks($caseID);
|
||||
|
||||
/* if ajax request, send result. */
|
||||
if($this->server->ajax)
|
||||
|
||||
@@ -247,7 +247,7 @@
|
||||
<?php endif;?>
|
||||
</table>
|
||||
</div>
|
||||
<?php if(isset($this->config->bizVersion)) $this->loadModel('flow')->printFields($app->moduleName, $app->methodName, 'div', 'position=right&divCell=false');?>
|
||||
<?php $this->printExtendFields($case, 'div', 'position=right&divCell=false');?>
|
||||
<div class='detail'>
|
||||
<div class='detail-title'><?php echo $lang->testcase->legendOpenAndEdit;?></div>
|
||||
<table class='table table-form'>
|
||||
|
||||
@@ -47,7 +47,7 @@ $lang->testreport->legendComment = '总结';
|
||||
$lang->testreport->legendMore = '更多功能';
|
||||
|
||||
$lang->testreport->bugSeverityGroups = 'Bug严重级别分布';
|
||||
$lang->testreport->bugTypeGroups = 'Bug类型别分布';
|
||||
$lang->testreport->bugTypeGroups = 'Bug类型分布';
|
||||
$lang->testreport->bugStatusGroups = 'Bug状态分布';
|
||||
$lang->testreport->bugOpenedByGroups = 'Bug创建者分布';
|
||||
$lang->testreport->bugResolvedByGroups = 'Bug解决者分布';
|
||||
|
||||
@@ -89,7 +89,7 @@ class testsuite extends control
|
||||
}
|
||||
$actionID = $this->loadModel('action')->create('testsuite', $suiteID, 'opened');
|
||||
|
||||
$this->executeHooks($this->methodName, $suiteID);
|
||||
$this->executeHooks($suiteID);
|
||||
|
||||
$response['locate'] = $this->createLink('testsuite', 'browse', "productID=$productID");
|
||||
$response['message'] = $this->lang->testsuite->successSaved;
|
||||
@@ -142,6 +142,8 @@ class testsuite extends control
|
||||
$this->app->loadClass('pager', $static = true);
|
||||
$pager = pager::init($recTotal, $recPerPage, $pageID);
|
||||
|
||||
$this->executeHooks($suiteID);
|
||||
|
||||
$this->view->title = "SUITE #$suite->id $suite->name/" . $this->products[$productID];
|
||||
$this->view->position[] = html::a($this->createLink('testsuite', 'browse', "productID=$productID"), $this->products[$productID]);
|
||||
$this->view->position[] = $this->lang->testsuite->common;
|
||||
@@ -188,7 +190,7 @@ class testsuite extends control
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
}
|
||||
|
||||
$this->executeHooks($this->methodName, $suiteID);
|
||||
$this->executeHooks($suiteID);
|
||||
|
||||
$method = $suite->type == 'library' ? 'libView' : 'view';
|
||||
$response['locate'] = inlink($method, "suiteID=$suiteID");
|
||||
@@ -250,7 +252,7 @@ class testsuite extends control
|
||||
|
||||
$this->testsuite->delete($suiteID);
|
||||
|
||||
$this->executeHooks($this->methodName, $suiteID);
|
||||
$this->executeHooks($suiteID);
|
||||
|
||||
/* if ajax request, send result. */
|
||||
if($this->server->ajax)
|
||||
|
||||
@@ -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,6 +216,8 @@ class testtask extends control
|
||||
|
||||
$this->testtask->setMenu($this->products, $productID, $task->branch, $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]);
|
||||
$this->view->position[] = $this->lang->testtask->common;
|
||||
@@ -462,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'));
|
||||
}
|
||||
@@ -510,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")));
|
||||
@@ -553,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")));
|
||||
@@ -596,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")));
|
||||
@@ -641,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")));
|
||||
@@ -681,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)
|
||||
|
||||
Reference in New Issue
Block a user