* Finish task #71836.

This commit is contained in:
zhouxin
2022-10-10 15:23:22 +08:00
parent f9f49755c1
commit 0cfb69ac5b
6 changed files with 152 additions and 8 deletions
+12 -8
View File
@@ -1734,10 +1734,11 @@ class block extends control
if(common::hasPriv('bug', 'view') and $this->config->vision != 'lite') $hasViewPriv['bug'] = true;
if($this->config->URAndSR and common::hasPriv('story', 'view') and $this->config->vision != 'lite') $hasViewPriv['requirement'] = true;
if(common::hasPriv('story', 'view') and $this->config->vision != 'lite') $hasViewPriv['story'] = true;
if(common::hasPriv('risk', 'view') and $this->config->edition == 'max' and $this->config->vision != 'lite') $hasViewPriv['risk'] = true;
if(common::hasPriv('issue', 'view') and $this->config->edition == 'max' and $this->config->vision != 'lite') $hasViewPriv['issue'] = true;
if(common::hasPriv('meeting', 'view') and $this->config->edition == 'max' and $this->config->vision != 'lite') $hasViewPriv['meeting'] = true;
if(common::hasPriv('risk', 'view') and $this->config->edition == 'max' and $this->config->vision != 'lite') $hasViewPriv['risk'] = true;
if(common::hasPriv('issue', 'view') and $this->config->edition == 'max' and $this->config->vision != 'lite') $hasViewPriv['issue'] = true;
if(common::hasPriv('meeting', 'view') and $this->config->edition == 'max' and $this->config->vision != 'lite') $hasViewPriv['meeting'] = true;
if(common::hasPriv('feedback', 'view') and in_array($this->config->edition, array('max', 'biz'))) $hasViewPriv['feedback'] = true;
if(common::hasPriv('ticket', 'view') and in_array($this->config->edition, array('max', 'biz'))) $hasViewPriv['ticket'] = true;
$params = $this->get->param;
$params = json_decode(base64_decode($params));
@@ -1746,14 +1747,14 @@ class block extends control
$objectCountList = array('todo' => 'todoCount', 'task' => 'taskCount', 'bug' => 'bugCount', 'story' => 'storyCount', 'requirement' => 'requirementCount');
if($this->config->edition == 'max')
{
$objectList += array('risk' => 'risks', 'issue' => 'issues', 'feedback' => 'feedbacks');
$objectCountList += array('risk' => 'riskCount', 'issue' => 'issueCount', 'feedback' => 'feedbackCount');
$objectList += array('risk' => 'risks', 'issue' => 'issues', 'feedback' => 'feedbacks', 'ticket' => 'tickets');
$objectCountList += array('risk' => 'riskCount', 'issue' => 'issueCount', 'feedback' => 'feedbackCount', 'ticket' => 'ticketCount');
}
if($this->config->edition == 'biz')
{
$objectList += array('feedback' => 'feedbacks');
$objectCountList += array('feedback' => 'feedbackCount');
$objectList += array('feedback' => 'feedbacks', 'ticket' => 'tickets');
$objectCountList += array('feedback' => 'feedbackCount', 'ticket' => 'ticketCount');
}
$tasks = $this->loadModel('task')->getUserSuspendedTasks($this->app->user->account);
@@ -1769,6 +1770,7 @@ class block extends control
->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' or $objectType == 'risk')->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()
->where('t1.deleted')->eq(0)
->andWhere('t1.assignedTo')->eq($this->app->user->account)->fi()
->beginIF($objectType == 'story')->andWhere('t1.type')->eq('story')->andWhere('t2.deleted')->eq('0')->fi()
@@ -1779,6 +1781,7 @@ class block extends control
->beginIF($objectType != 'todo')->andWhere('t1.status')->ne('closed')->fi()
->beginIF($objectType == 'feedback')->andWhere('t1.status')->in('wait, noreview')->fi()
->beginIF($objectType == 'issue' or $objectType == 'risk')->andWhere('t2.deleted')->eq(0)->fi()
->beginIF($objectType == 'ticket')->andWhere('t1.status')->in('wait,doing')->fi()
->orderBy($orderBy)
->beginIF($limitCount)->limit($limitCount)->fi()
->fetchAll();
@@ -1823,9 +1826,10 @@ class block extends control
if($objectType == 'risk') $this->app->loadLang('risk');
if($objectType == 'issue') $this->app->loadLang('issue');
if($objectType == 'feedback')
if($objectType == 'feedback' or $objectType == 'ticket')
{
$this->app->loadLang('feedback');
$this->app->loadLang('ticket');
$this->view->users = $this->loadModel('user')->getPairs('all,noletter');
$this->view->products = $this->dao->select('id, name')->from(TABLE_PRODUCT)->where('deleted')->eq('0')->fetchPairs('id', 'name');
}