diff --git a/lib/dao/dao.class.php b/lib/dao/dao.class.php index 25fcd2b9cd..db29797b18 100755 --- a/lib/dao/dao.class.php +++ b/lib/dao/dao.class.php @@ -242,19 +242,16 @@ class dao /** * The count method, call sql::select() and from(). - * use as $this->dao->count(TABLE_BUG)->where('')->fetch('count'); + * use as $this->dao->count()->from(TABLE_BUG)->where('')->fetch('count'); * - * @param int $tabel * @access public * @return void */ - public function count($table) + public function count() { $this->setMode('raw'); $this->setMethod('select'); $this->sqlobj = sql::select('count(*) as count'); - $this->setTable($table); - $this->sqlobj->from($table); return $this; } diff --git a/module/action/lang/en.php b/module/action/lang/en.php index 48e98de270..08a8ab5b64 100755 --- a/module/action/lang/en.php +++ b/module/action/lang/en.php @@ -95,9 +95,11 @@ $lang->action->desc->paused = '$date, paused by $actor. $lang->action->desc->diff1 = 'changed %s, old is "%s", new is "%s".
'; $lang->action->desc->diff2 = 'changed %s, the diff is:' . "\n" . "
%s
" . "\n"; $lang->action->desc->diff3 = "changed file's name %s to %s."; -$lang->action->desc->starttesttask = '$date, $actor start testtask $extra.' . "\n"; -$lang->action->desc->stoptesttask = '$date, $actor stop testtask $extra.' . "\n"; -$lang->action->desc->createbuild = '$date, $actor create build $extra.' . "\n"; + +$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(); diff --git a/module/action/lang/zh-cn.php b/module/action/lang/zh-cn.php index f9a5d114d9..d710127624 100755 --- a/module/action/lang/zh-cn.php +++ b/module/action/lang/zh-cn.php @@ -95,9 +95,11 @@ $lang->action->desc->paused = '$date, 由 $actor 暂停 $lang->action->desc->diff1 = '修改了 %s,旧值为 "%s",新值为 "%s"。
' . "\n"; $lang->action->desc->diff2 = '修改了 %s,区别为:' . "\n" . "
%s
" . "\n"; $lang->action->desc->diff3 = '将文件名 %s 改为 %s 。' . "\n"; -$lang->action->desc->starttesttask = '$date, 由 $actor 启动测试任务 $extra。' . "\n"; -$lang->action->desc->stoptesttask = '$date, 由 $actor 关闭测试任务 $extra。' . "\n"; -$lang->action->desc->createbuild = '$date, 由 $actor 创建版本 $extra。' . "\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(); diff --git a/module/action/model.php b/module/action/model.php index 1ddb410646..5441e92278 100755 --- a/module/action/model.php +++ b/module/action/model.php @@ -188,6 +188,9 @@ class actionModel extends model $actions = $this->dao->select('*')->from(TABLE_ACTION) ->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)); $this->loadModel('file'); @@ -314,6 +317,12 @@ class actionModel extends model { $desc = $action->extra ? $this->lang->action->desc->extra : $this->lang->action->desc->common; } + /* if module == 'project' and method == 'view', try to find special lang */ + if($this->app->getModuleName() == 'project' && $this->app->getMethodName() == 'view') + { + if(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)); diff --git a/module/build/control.php b/module/build/control.php index dadd3440bb..f255d7efbb 100644 --- a/module/build/control.php +++ b/module/build/control.php @@ -25,7 +25,6 @@ class build extends control $buildID = $this->build->create($projectID); if(dao::isError()) die(js::error(dao::getError())); $this->loadModel('action')->create('build', $buildID, 'opened'); - $actionID = $this->action->create('project', $projectID, 'createbuild', '', $buildID); die(js::locate($this->createLink('project', 'build', "project=$projectID"), 'parent')); } diff --git a/module/testtask/control.php b/module/testtask/control.php index fbd0f00a33..4ae736c513 100644 --- a/module/testtask/control.php +++ b/module/testtask/control.php @@ -438,9 +438,6 @@ class testtask extends control { $actionID = $this->action->create('testtask', $taskID, 'Started', $this->post->comment); $this->action->logHistory($actionID, $changes); - - $testtask = $this->testtask->getById($taskID); - $projectActionID = $this->action->create('project', $testtask->project, 'starttesttask', '', $taskID); } die(js::locate($this->createLink('testtask', 'view', "taskID=$taskID"), 'parent')); } @@ -480,9 +477,6 @@ class testtask extends control { $actionID = $this->action->create('testtask', $taskID, 'Closed', $this->post->comment); $this->action->logHistory($actionID, $changes); - - $testtask = $this->testtask->getById($taskID); - $projectActionID = $this->action->create('project', $testtask->project, 'stoptesttask', '', $taskID); } die(js::locate($this->createLink('testtask', 'view', "taskID=$taskID"), 'parent')); }