Merge branch 'sprint/182_songchenxuan_action_lang' into 'master'

*Case action lang.

See merge request easycorp/zentaopms!1322
This commit is contained in:
孙广明
2022-01-11 00:36:32 +00:00
4 changed files with 14 additions and 6 deletions
+1 -1
View File
@@ -180,7 +180,7 @@ $lang->action->desc->diff2 = '修改了 <strong><i>%s</i></strong
$lang->action->desc->diff3 = '将文件名 %s 改为 %s 。' . "\n"; $lang->action->desc->diff3 = '将文件名 %s 改为 %s 。' . "\n";
$lang->action->desc->linked2bug = '$date 由 <strong>$actor</strong> 关联到版本 <strong>$extra</strong>'; $lang->action->desc->linked2bug = '$date 由 <strong>$actor</strong> 关联到版本 <strong>$extra</strong>';
$lang->action->desc->linked2testtask = '$date 由 <strong>$actor</strong> 关联到测试单 <strong>$extra</strong>'; $lang->action->desc->linked2testtask = '$date 由 <strong>$actor</strong> 关联到测试单 <strong>$extra</strong>';
$lang->action->desc->unlinkedfromtesttask = '$date 由 $actor 从测试单 <strong>$extra</strong> 中移除'; $lang->action->desc->unlinkedfromtesttask = '$date 由 <strong>$actor</strong> 从测试单 <strong>$extra</strong> 中移除';
$lang->action->desc->resolved = '$date, 由 <strong>$actor</strong> 解决。' . "\n"; $lang->action->desc->resolved = '$date, 由 <strong>$actor</strong> 解决。' . "\n";
$lang->action->desc->managed = '$date, 由 <strong>$actor</strong> 维护。' . "\n"; $lang->action->desc->managed = '$date, 由 <strong>$actor</strong> 维护。' . "\n";
$lang->action->desc->estimated = '$date, 由 <strong>$actor</strong> 估算。' . "\n"; $lang->action->desc->estimated = '$date, 由 <strong>$actor</strong> 估算。' . "\n";
+10
View File
@@ -381,6 +381,11 @@ class actionModel extends model
$name = $this->dao->select('name')->from(TABLE_RELEASE)->where('id')->eq($action->extra)->fetch('name'); $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; 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') elseif($actionName == 'moved')
{ {
$name = $this->dao->select('name')->from(TABLE_PROJECT)->where('id')->eq($action->extra)->fetch('name'); $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'); $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; 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') elseif($actionName == 'tostory')
{ {
$title = $this->dao->select('title')->from(TABLE_STORY)->where('id')->eq($action->extra)->fetch('title'); $title = $this->dao->select('title')->from(TABLE_STORY)->where('id')->eq($action->extra)->fetch('title');
+2 -3
View File
@@ -1086,15 +1086,14 @@ class testtask extends control
$response['result'] = 'success'; $response['result'] = 'success';
$response['message'] = ''; $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) $testRun = $this->dao->select('task,`case`')->from(TABLE_TESTRUN)->where('id')->eq((int)$rowID)->fetch();
$rowID)->fetch();
$this->dao->delete()->from(TABLE_TESTRUN)->where('id')->eq((int)$rowID)->exec(); $this->dao->delete()->from(TABLE_TESTRUN)->where('id')->eq((int)$rowID)->exec();
if(dao::isError()) if(dao::isError())
{ {
$response['result'] = 'fail'; $response['result'] = 'fail';
$response['message'] = dao::getError(); $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); return $this->send($response);
} }
} }
+1 -2
View File
@@ -893,7 +893,6 @@ class testtaskModel extends model
if($type == 'bybuild') $row->assignedTo = zget($assignedToPairs, $caseID, ''); if($type == 'bybuild') $row->assignedTo = zget($assignedToPairs, $caseID, '');
$this->dao->replace(TABLE_TESTRUN)->data($row)->exec(); $this->dao->replace(TABLE_TESTRUN)->data($row)->exec();
$task = $this->getById($taskID);
/* When the cases linked the testtask, the cases link to the project. */ /* When the cases linked the testtask, the cases link to the project. */
if($this->app->tab != 'qa') if($this->app->tab != 'qa')
{ {
@@ -907,7 +906,7 @@ class testtaskModel extends model
$data->version = 1; $data->version = 1;
$data->order = ++ $lastOrder; $data->order = ++ $lastOrder;
$this->dao->replace(TABLE_PROJECTCASE)->data($data)->exec(); $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);
} }
} }
} }