diff --git a/module/action/lang/en.php b/module/action/lang/en.php
index 16046e5e25..84f70c98e8 100755
--- a/module/action/lang/en.php
+++ b/module/action/lang/en.php
@@ -97,11 +97,6 @@ $lang->action->desc->diff1 = 'changed %s, old i
$lang->action->desc->diff2 = 'changed %s, the diff is:' . "\n" . "
%s
" . "\n%s
";
$lang->action->desc->diff3 = "changed file's name %s to %s.";
-$lang->action->desc->project = new stdclass();
-$lang->action->desc->project->started = '$date, $actor started test task. $objectID。' . "\n";
-$lang->action->desc->project->closed = '$date, $actor closed test task. $objectID。' . "\n";
-$lang->action->desc->project->opened = '$date, $actor created build. $objectID。' . "\n";
-
/* The action labels. */
$lang->action->label = new stdclass();
$lang->action->label->created = 'created';
diff --git a/module/action/lang/zh-cn.php b/module/action/lang/zh-cn.php
index fa884d68cf..9a1439dc37 100755
--- a/module/action/lang/zh-cn.php
+++ b/module/action/lang/zh-cn.php
@@ -97,11 +97,6 @@ $lang->action->desc->diff1 = '修改了 %s,
$lang->action->desc->diff2 = '修改了 %s,区别为:' . "\n" . "%s
" . "\n%s
";
$lang->action->desc->diff3 = '将文件名 %s 改为 %s 。' . "\n";
-$lang->action->desc->project = new stdclass();
-$lang->action->desc->project->started = '$date, 由 $actor 启动测试任务 $objectID。' . "\n";
-$lang->action->desc->project->closed = '$date, 由 $actor 完成测试任务 $objectID。' . "\n";
-$lang->action->desc->project->opened = '$date, 由 $actor 创建版本 $objectID。' . "\n";
-
/* 用来显示动态信息。*/
$lang->action->label = new stdclass();
$lang->action->label->created = '创建';
diff --git a/module/action/model.php b/module/action/model.php
index 22a2db3fcd..8b00f09ef8 100755
--- a/module/action/model.php
+++ b/module/action/model.php
@@ -186,10 +186,13 @@ class actionModel extends model
{
$commiters = $this->loadModel('user')->getCommiters();
$actions = $this->dao->select('*')->from(TABLE_ACTION)
+ ->beginIF($objectType == 'project')
+ ->where("objectType IN('project', 'testtask', 'build')")
+ ->andWhere('project')->eq($objectID)
+ ->fi()
+ ->beginIF($objectType != 'project')
->where('objectType')->eq($objectType)
->andWhere('objectID')->eq($objectID)
- ->beginIF($objectType == 'project')
- ->orWhere("project = $objectID AND ((objectType = 'testtask' AND action IN('started','closed')) OR (objectType = 'build' AND action = 'opened'))")
->fi()
->orderBy('date, id')->fetchAll('id');
$histories = $this->getHistory(array_keys($actions));
@@ -202,9 +205,51 @@ class actionModel extends model
$action->comment = $this->file->setImgSize($action->comment, $this->config->action->commonImgSize);
$actions[$actionID] = $action;
}
+
+ if($objectType == 'project')
+ {
+ $this->app->loadLang('build');
+ $this->app->loadLang('testtask');
+ return $this->processProjectActions($actions);
+ }
+
return $actions;
}
+ public function processProjectActions($actions)
+ {
+ $newActions = array();
+ foreach($actions as $action)
+ {
+ if($action->objectType == 'project')
+ {
+ $newActions[] = $action;
+ }
+ elseif($action->objectType == 'testtask')
+ {
+ if($action->action == 'started')
+ {
+ $action->action = 'testtaskstarted';
+ $newActions[] = $action;
+ }
+ elseif($action->action == 'closed')
+ {
+ $action->action = 'testtaskclosed';
+ $newActions[] = $action;
+ }
+ }
+ elseif($action->objectType == 'build')
+ {
+ if($action->action == 'opened')
+ {
+ $action->action = 'buildopened';
+ $newActions[] = $action;
+ }
+ }
+ }
+ return $newActions;
+ }
+
/**
* Get an action record.
*
@@ -318,13 +363,6 @@ class actionModel extends model
$desc = $action->extra ? $this->lang->action->desc->extra : $this->lang->action->desc->common;
}
- /* if module == 'project' and method == 'view' and objectType in 'testtask, build', try to find special lang */
- if($this->app->getModuleName() == 'project' && $this->app->getMethodName() == 'view')
- {
- if(($objectType == 'testtask' || $objectType == 'build') && isset($this->lang->action->desc->project->$actionType))
- $desc = $this->lang->action->desc->project->$actionType;
- }
-
if($this->app->getViewType() == 'mhtml') $action->date = date('m-d H:i', strtotime($action->date));
/* Cycle actions, replace vars. */
diff --git a/module/build/lang/en.php b/module/build/lang/en.php
index f23ded2ac2..0d6244af80 100644
--- a/module/build/lang/en.php
+++ b/module/build/lang/en.php
@@ -45,3 +45,6 @@ $lang->build->resolvedBugs = 'The total solution of bug%s';
$lang->build->placeholder = new stdclass();
$lang->build->placeholder->scmPath = 'Software source code repository, such as Subversion or Git';
$lang->build->placeholder->filePath = 'The path of this build package to download';
+
+$lang->build->action = new stdclass();
+$lang->build->action->buildopened = '$date, $actor created build. $objectID。' . "\n";
diff --git a/module/build/lang/zh-cn.php b/module/build/lang/zh-cn.php
index d460db18a6..e2bfc28c2f 100644
--- a/module/build/lang/zh-cn.php
+++ b/module/build/lang/zh-cn.php
@@ -45,3 +45,6 @@ $lang->build->resolvedBugs = '本次共解决Bug%s个';
$lang->build->placeholder = new stdclass();
$lang->build->placeholder->scmPath = ' 软件源代码库,如Subversion、Git库地址';
$lang->build->placeholder->filePath = ' 该版本软件包下载存储地址';
+
+$lang->build->action = new stdclass();
+$lang->build->action->buildopened = '$date, 由 $actor 创建版本 $objectID。' . "\n";
diff --git a/module/testtask/lang/en.php b/module/testtask/lang/en.php
index c1a8afa874..2a87f8756c 100644
--- a/module/testtask/lang/en.php
+++ b/module/testtask/lang/en.php
@@ -103,3 +103,7 @@ $lang->testtask->mail->create->title = "%s created testtask #%s:%s";
$lang->testtask->mail->edit->title = "%s finished testtask #%s:%s";
$lang->testtask->testScope = 'Test scope';
+
+$lang->testtask->action = new stdclass();
+$lang->testtask->action->testtaskstarted = '$date, 由 $actor started test task. $objectID。' . "\n";
+$lang->testtask->action->testtaskclosed = '$date, 由 $actor finished test task. $objectID。' . "\n";
diff --git a/module/testtask/lang/zh-cn.php b/module/testtask/lang/zh-cn.php
index 178d5070e1..ec4361026d 100644
--- a/module/testtask/lang/zh-cn.php
+++ b/module/testtask/lang/zh-cn.php
@@ -103,3 +103,7 @@ $lang->testtask->mail->create->title = "%s创建了测试任务 #%s:%s";
$lang->testtask->mail->edit->title = "%s编辑了测试任务 #%s:%s";
$lang->testtask->testScope = '测试范畴';
+
+$lang->testtask->action = new stdclass();
+$lang->testtask->action->testtaskstarted = '$date, 由 $actor 启动测试任务 $objectID。' . "\n";
+$lang->testtask->action->testtaskclosed = '$date, 由 $actor 完成测试任务 $objectID。' . "\n";