diff --git a/module/block/control.php b/module/block/control.php index 668d64ac3a..38de9a0d06 100755 --- a/module/block/control.php +++ b/module/block/control.php @@ -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'); } diff --git a/module/block/lang/zh-cn.php b/module/block/lang/zh-cn.php index adcf517d1d..219eac049d 100644 --- a/module/block/lang/zh-cn.php +++ b/module/block/lang/zh-cn.php @@ -358,6 +358,7 @@ $lang->block->availableBlocks->risk = '风险'; $lang->block->availableBlocks->issue = '问题'; $lang->block->availableBlocks->meeting = '会议'; $lang->block->availableBlocks->feedback = '反馈'; +$lang->block->availableBlocks->ticket = '工单'; if($config->systemMode == 'new') $lang->block->moduleList['project'] = '项目'; $lang->block->moduleList['product'] = $lang->productCommon; @@ -478,6 +479,7 @@ $lang->block->issueCount = '问题数'; $lang->block->storyCount = '需求数'; $lang->block->meetingCount = '会议数'; $lang->block->feedbackCount = '反馈数'; +$lang->block->ticketCount = '工单数'; $lang->block->typeList = new stdclass(); diff --git a/module/block/view/ticketblock.html.php b/module/block/view/ticketblock.html.php new file mode 100644 index 0000000000..2adf8a7a39 --- /dev/null +++ b/module/block/view/ticketblock.html.php @@ -0,0 +1,36 @@ + +
+ ticket->noTicket;?> + " . $lang->ticket->create, '', "class='btn btn-info'")?> +
+