diff --git a/module/action/lang/zh-cn.php b/module/action/lang/zh-cn.php
index caa6578310..13e034b34c 100755
--- a/module/action/lang/zh-cn.php
+++ b/module/action/lang/zh-cn.php
@@ -180,7 +180,7 @@ $lang->action->desc->diff2 = '修改了 %saction->desc->diff3 = '将文件名 %s 改为 %s 。' . "\n";
$lang->action->desc->linked2bug = '$date 由 $actor 关联到版本 $extra';
$lang->action->desc->linked2testtask = '$date 由 $actor 关联到测试单 $extra';
-$lang->action->desc->unlinkedfromtesttask = '$date 由 $actor 从测试单 $extra 中移除';
+$lang->action->desc->unlinkedfromtesttask = '$date 由 $actor 从测试单 $extra 中移除';
$lang->action->desc->resolved = '$date, 由 $actor 解决。' . "\n";
$lang->action->desc->managed = '$date, 由 $actor 维护。' . "\n";
$lang->action->desc->estimated = '$date, 由 $actor 估算。' . "\n";
diff --git a/module/action/model.php b/module/action/model.php
index 9cb6b0ca03..20778d1b2f 100755
--- a/module/action/model.php
+++ b/module/action/model.php
@@ -381,6 +381,11 @@ class actionModel extends model
$name = $this->dao->select('name')->from(TABLE_RELEASE)->where('id')->eq($action->extra)->fetch('name');
if($name) $action->extra = common::hasPriv('release', 'view') ? html::a(helper::createLink('release', 'view', "releaseID=$action->extra&type={$action->objectType}"), $name) : $name;
}
+ elseif($actionName == 'linked2testtask')
+ {
+ $name = $this->dao->select('name')->from(TABLE_TESTTASK)->where('id')->eq($action->extra)->fetch('name');
+ if($name) $action->extra = common::hasPriv('testtask', 'view') ? html::a(helper::createLink('testtask', 'view', "taskID=$action->extra"), $name) : $name;
+ }
elseif($actionName == 'moved')
{
$name = $this->dao->select('name')->from(TABLE_PROJECT)->where('id')->eq($action->extra)->fetch('name');
@@ -416,6 +421,11 @@ class actionModel extends model
$title = $this->dao->select('title')->from(TABLE_PRODUCTPLAN)->where('id')->eq($action->extra)->fetch('title');
if($title) $action->extra = common::hasPriv('productplan', 'view') ? html::a(helper::createLink('productplan', 'view', "planID=$action->extra"), "#$action->extra " . $title) : "#$action->extra " . $title;
}
+ elseif($actionName == 'unlinkedfromtesttask')
+ {
+ $name = $this->dao->select('name')->from(TABLE_TESTTASK)->where('id')->eq($action->extra)->fetch('name');
+ if($name) $action->extra = common::hasPriv('testtask', 'view') ? html::a(helper::createLink('testtask', 'view', "taskID=$action->extra"), $name) : $name;
+ }
elseif($actionName == 'tostory')
{
$title = $this->dao->select('title')->from(TABLE_STORY)->where('id')->eq($action->extra)->fetch('title');
diff --git a/module/testtask/control.php b/module/testtask/control.php
index 721045aa73..5322cf2772 100644
--- a/module/testtask/control.php
+++ b/module/testtask/control.php
@@ -1086,15 +1086,14 @@ class testtask extends control
$response['result'] = 'success';
$response['message'] = '';
- $testRun = $this->dao->select('task, `case`, t2.name')->from(TABLE_TESTRUN)->alias('t1')->LeftJoin(TABLE_TESTTASK)->alias('t2')->on('t1.task = t2.id')->where('t1.id')->eq((int)
-$rowID)->fetch();
+ $testRun = $this->dao->select('task,`case`')->from(TABLE_TESTRUN)->where('id')->eq((int)$rowID)->fetch();
$this->dao->delete()->from(TABLE_TESTRUN)->where('id')->eq((int)$rowID)->exec();
if(dao::isError())
{
$response['result'] = 'fail';
$response['message'] = dao::getError();
}
- $this->loadModel('action')->create('case' ,$testRun->case, 'unlinkedfromtesttask', '', $testRun->name);
+ $this->loadModel('action')->create('case' ,$testRun->case, 'unlinkedfromtesttask', '', $testRun->task);
return $this->send($response);
}
}
diff --git a/module/testtask/model.php b/module/testtask/model.php
index 0816e41505..b72a34b67c 100644
--- a/module/testtask/model.php
+++ b/module/testtask/model.php
@@ -893,7 +893,6 @@ class testtaskModel extends model
if($type == 'bybuild') $row->assignedTo = zget($assignedToPairs, $caseID, '');
$this->dao->replace(TABLE_TESTRUN)->data($row)->exec();
- $task = $this->getById($taskID);
/* When the cases linked the testtask, the cases link to the project. */
if($this->app->tab != 'qa')
{
@@ -907,7 +906,7 @@ class testtaskModel extends model
$data->version = 1;
$data->order = ++ $lastOrder;
$this->dao->replace(TABLE_PROJECTCASE)->data($data)->exec();
- $this->loadModel('action')->create('case', $caseID, 'linked2testtask', '', $task->name);
+ $this->loadModel('action')->create('case', $caseID, 'linked2testtask', '', $taskID);
}
}
}