* [perf story #75502] Adjust for printAssignToMeBlock.

This commit is contained in:
wangyidong
2025-09-29 21:35:40 +08:00
parent e267cad6ba
commit 431c5d285e
6 changed files with 39 additions and 13 deletions
+20
View File
@@ -0,0 +1,20 @@
<?php
if(in_array($config->edition, array('max', 'ipd')))
{
global $lang, $app;
$app->loadLang('reviewissue');
$config->block->reviewissue = new stdclass();
$config->block->reviewissue->dtable = new stdclass();
$config->block->reviewissue->dtable->fieldList = array();
$config->block->reviewissue->dtable->fieldList['id'] = array('name' => 'id', 'title' => $lang->idAB, 'type' => 'id' , 'sort' => 'number');
$config->block->reviewissue->dtable->fieldList['name'] = array('name' => 'title', 'title' => $lang->reviewissue->title, 'type' => 'title', 'sort' => true, 'flex' => 1, 'link' => array('module' => 'reviewissue', 'method' => 'view', 'params' => 'reviewissueID={id}'));
$config->block->reviewissue->dtable->fieldList['opinion'] = array('name' => 'opinion', 'title' => $lang->reviewissue->opinion, 'type' => 'text', 'sort' => true);
$config->block->reviewissue->dtable->fieldList['type'] = array('name' => 'type', 'title' => $lang->reviewissue->type, 'type' => 'category', 'map' => $lang->reviewissue->issueType, 'sort' => true);
$config->block->reviewissue->dtable->fieldList['status'] = array('name' => 'status', 'title' => $lang->reviewissue->status, 'type' => 'status', 'statusMap' => $lang->reviewissue->statusList, 'sort' => true);
$config->block->reviewissue->dtable->short = new stdclass();
$config->block->reviewissue->dtable->short->fieldList['id'] = $config->block->reviewissue->dtable->fieldList['id'];
$config->block->reviewissue->dtable->short->fieldList['name'] = $config->block->reviewissue->dtable->fieldList['name'];
$config->block->reviewissue->dtable->short->fieldList['status'] = $config->block->reviewissue->dtable->fieldList['status'];
}
+1
View File
@@ -234,6 +234,7 @@ $lang->block->availableBlocks['build'] = 'Builds';
$lang->block->availableBlocks['testcase'] = 'Testcase';
$lang->block->availableBlocks['testtask'] = 'Testtask';
$lang->block->availableBlocks['risk'] = 'Risks';
$lang->block->availableBlocks['reviewissue'] = 'Review Issue';
$lang->block->availableBlocks['issue'] = 'Issues';
$lang->block->availableBlocks['meeting'] = 'Meetings';
$lang->block->availableBlocks['feedback'] = 'Feedbacks';
+1
View File
@@ -234,6 +234,7 @@ $lang->block->availableBlocks['build'] = 'Builds';
$lang->block->availableBlocks['testcase'] = 'Testcase';
$lang->block->availableBlocks['testtask'] = 'Testtask';
$lang->block->availableBlocks['risk'] = 'Risks';
$lang->block->availableBlocks['reviewissue'] = 'Review Issue';
$lang->block->availableBlocks['issue'] = 'Issues';
$lang->block->availableBlocks['meeting'] = 'Meetings';
$lang->block->availableBlocks['feedback'] = 'Feedbacks';
+1
View File
@@ -234,6 +234,7 @@ $lang->block->availableBlocks['build'] = 'Builds';
$lang->block->availableBlocks['testcase'] = 'Testcase';
$lang->block->availableBlocks['testtask'] = 'Testtask';
$lang->block->availableBlocks['risk'] = 'Risks';
$lang->block->availableBlocks['reviewissue'] = 'Review Issue';
$lang->block->availableBlocks['issue'] = 'Issues';
$lang->block->availableBlocks['meeting'] = 'Meetings';
$lang->block->availableBlocks['feedback'] = 'Feedbacks';
+1
View File
@@ -234,6 +234,7 @@ $lang->block->availableBlocks['build'] = '构建列表';
$lang->block->availableBlocks['testcase'] = '用例';
$lang->block->availableBlocks['testtask'] = '测试单';
$lang->block->availableBlocks['risk'] = '风险';
$lang->block->availableBlocks['reviewissue'] = '评审意见';
$lang->block->availableBlocks['issue'] = '问题';
$lang->block->availableBlocks['meeting'] = '会议';
$lang->block->availableBlocks['feedback'] = '反馈';
+15 -13
View File
@@ -2098,13 +2098,14 @@ class blockZen extends block
if((common::hasPriv('task', 'view') && $this->config->vision == 'rnd') || (common::hasPriv('researchtask', 'view') && $this->config->vision == 'or')) $hasViewPriv['task'] = true;
if(common::hasPriv('story', 'view') && $this->config->vision != 'lite') $hasViewPriv['story'] = true;
if($this->config->URAndSR && common::hasPriv('story', 'view') && $this->config->vision != 'lite') $hasViewPriv['requirement'] = true;
if(common::hasPriv('bug', 'view') && !in_array($this->config->vision, array('lite', 'or'))) $hasViewPriv['bug'] = true;
if(common::hasPriv('testcase', 'view') && !in_array($this->config->vision, array('lite', 'or'))) $hasViewPriv['testcase'] = true;
if(common::hasPriv('testtask', 'cases') && !in_array($this->config->vision, array('lite', 'or'))) $hasViewPriv['testtask'] = true;
if(common::hasPriv('risk', 'view') && in_array($this->config->edition, array('max', 'ipd')) && !in_array($this->config->vision, array('lite', 'or')) && $hasRisk) $hasViewPriv['risk'] = true;
if(common::hasPriv('issue', 'view') && in_array($this->config->edition, array('max', 'ipd')) && !in_array($this->config->vision, array('lite', 'or')) && $hasIssue) $hasViewPriv['issue'] = true;
if(common::hasPriv('meeting', 'view') && in_array($this->config->edition, array('max', 'ipd')) && !in_array($this->config->vision, array('lite', 'or')) && $hasMeeting) $hasViewPriv['meeting'] = true;
if((common::hasPriv('feedback', 'view') || common::hasPriv('feedback', 'adminView')) && in_array($this->config->edition, array('max', 'biz', 'ipd'))) $hasViewPriv['feedback'] = true;
if(common::hasPriv('bug', 'view') && !in_array($this->config->vision, array('lite', 'or'))) $hasViewPriv['bug'] = true;
if(common::hasPriv('testcase', 'view') && !in_array($this->config->vision, array('lite', 'or'))) $hasViewPriv['testcase'] = true;
if(common::hasPriv('testtask', 'cases') && !in_array($this->config->vision, array('lite', 'or'))) $hasViewPriv['testtask'] = true;
if(common::hasPriv('risk', 'view') && in_array($this->config->edition, array('max', 'ipd')) && !in_array($this->config->vision, array('lite', 'or')) && $hasRisk) $hasViewPriv['risk'] = true;
if(common::hasPriv('reviewissue', 'view') && in_array($this->config->edition, array('max', 'ipd')) && !in_array($this->config->vision, array('lite', 'or')) && $hasRisk) $hasViewPriv['reviewissue'] = true;
if(common::hasPriv('issue', 'view') && in_array($this->config->edition, array('max', 'ipd')) && !in_array($this->config->vision, array('lite', 'or')) && $hasIssue) $hasViewPriv['issue'] = true;
if(common::hasPriv('meeting', 'view') && in_array($this->config->edition, array('max', 'ipd')) && !in_array($this->config->vision, array('lite', 'or')) && $hasMeeting) $hasViewPriv['meeting'] = true;
if((common::hasPriv('feedback', 'view') || common::hasPriv('feedback', 'adminView')) && in_array($this->config->edition, array('max', 'biz', 'ipd'))) $hasViewPriv['feedback'] = true;
if(common::hasPriv('ticket', 'view') && in_array($this->config->edition, array('max', 'biz', 'ipd')) && $this->config->vision != 'or') $hasViewPriv['ticket'] = true;
$objectList = array('todo' => 'todos', 'task' => 'tasks', 'bug' => 'bugs', 'story' => 'stories', 'requirement' => 'requirements');
@@ -2112,7 +2113,7 @@ class blockZen extends block
{
if($hasRisk) $objectList += array('risk' => 'risks');
if($hasIssue) $objectList += array('issue' => 'issues');
$objectList += array('feedback' => 'feedbacks', 'ticket' => 'tickets');
$objectList += array('feedback' => 'feedbacks', 'ticket' => 'tickets', 'reviewissue' => 'reviewissues');
if($this->config->edition == 'ipd' && $this->config->vision == 'or') $objectList += array('demand' => 'demands');
}
@@ -2129,7 +2130,7 @@ class blockZen extends block
->beginIF($objectType == 'story' || $objectType == 'requirement')->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product=t2.id')->fi()
->beginIF($objectType == 'bug')->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product=t2.id')->fi()
->beginIF($objectType == 'task')->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.execution=t2.id')->fi()
->beginIF($objectType == 'issue' || $objectType == 'risk')->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project=t2.id')->fi()
->beginIF(in_array($objectType, array('issue', 'risk', 'reviewissue')))->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project=t2.id')->fi()
->beginIF($objectType == 'ticket')->leftJoin(TABLE_USER)->alias('t2')->on('t1.openedBy = t2.account')->fi()
->beginIF($objectType == 'demand')->leftJoin(TABLE_DEMANDPOOL)->alias('t2')->on('t1.pool = t2.id')->fi()
->where('t1.deleted')->eq(0)
@@ -2141,7 +2142,7 @@ class blockZen extends block
->beginIF($objectType == 'todo')->andWhere('t1.cycle')->eq(0)->andWhere('t1.status')->eq('wait')->andWhere('t1.vision')->eq($this->config->vision)->fi()
->beginIF($objectType != 'todo')->andWhere('t1.status')->ne('closed')->fi()
->beginIF($objectType == 'feedback')->andWhere('t1.status')->in('wait, noreview')->fi()
->beginIF($objectType == 'issue' || $objectType == 'risk')->andWhere('t2.deleted')->eq(0)->fi()
->beginIF(in_array($objectType, array('issue', 'risk', 'reviewissue')))->andWhere('t2.deleted')->eq(0)->fi()
->beginIF($objectType == 'ticket')->andWhere('t1.status')->in('wait,doing,done')->fi()
->beginIF($objectType == 'demand')->andWhere('t2.deleted')->eq(0)->fi()
->orderBy($orderBy)
@@ -2196,9 +2197,10 @@ class blockZen extends block
}
}
if($objectType == 'bug') $this->app->loadLang('bug');
if($objectType == 'risk') $this->app->loadLang('risk');
if($objectType == 'issue') $this->app->loadLang('issue');
if($objectType == 'bug') $this->app->loadLang('bug');
if($objectType == 'risk') $this->app->loadLang('risk');
if($objectType == 'reviewissue') $this->app->loadLang('reviewissue');
if($objectType == 'issue') $this->app->loadLang('issue');
if($objectType == 'feedback' || $objectType == 'ticket')
{