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 @@ + +
block->emptyTip;?>
+ + +
+ '> + + + + + + + + + + + + + get->entry}'" : ''; + ?> + + + + + + + + + + +
idAB?>ticket->product;?>ticket->title?>ticket->type;?>ticket->createdBy;?>ticket->createdDate;?>
id);?>product);?>createLink('ticket', 'view', "ticketID=$ticket->id"), $ticket->title, '', "data-app='my'")?>ticket->typeList, $ticket->type)?>openedBy)?>openedDate;?>
+
+ diff --git a/module/my/control.php b/module/my/control.php index 203b6f9933..9ac679e02a 100755 --- a/module/my/control.php +++ b/module/my/control.php @@ -108,6 +108,7 @@ class my extends control $this->loadModel('bug'); $this->loadModel('testcase'); $this->loadModel('testtask'); + $this->loadModel('ticket'); /* Load pager. */ $this->app->loadClass('pager', $static = true); @@ -198,6 +199,9 @@ class my extends control /* Get the number of meetings assigned to me. */ $meetings = $this->meeting->getListByUser('futureMeeting', 'id_desc', 0, $pager); $meetingCount = $pager->recTotal; + + $ticketList = $this->ticket->getList('assignedtome', 'id_desc', $pager); + $ticketCount = $pager->recTotal; } echo << EOF; @@ -1208,6 +1213,38 @@ EOF; $this->display(); } + /** + * My ticket. + * + * @param string $browseType + * @param string $param + * @param string $orderBy + * @param int $recTotal + * @param int $recPerPage + * @param int $pageID + * @access public + * @return void + */ + public function ticket($browseType = 'assignedtome', $param = 0, $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1) + { + $this->loadModel('ticket'); + + $this->session->set('ticketList', $this->app->getURI(true), 'feedback'); + + $this->app->loadClass('pager', $static = true); + $pager = pager::init($recTotal, $recPerPage, $pageID); + $tickets = $this->ticket->getList($browseType, $orderBy, $pager); + + $this->view->title = $this->lang->ticket->browse; + $this->view->products = $this->loadModel('feedback')->getGrantProducts(); + $this->view->users = $this->loadModel('user')->getPairs('noclosed|nodeleted'); + $this->view->tickets = $tickets; + $this->view->orderBy = $orderBy; + $this->view->pager = $pager; + $this->view->browseType = $browseType; + $this->display(); + } + /** * My team. * diff --git a/module/my/js/common.js b/module/my/js/common.js index a99c6a1bca..00c8150eee 100644 --- a/module/my/js/common.js +++ b/module/my/js/common.js @@ -21,6 +21,7 @@ $(function() $("#subNavbar li[data-id='audit'] a").append('' + reviewCount + ''); $("#subNavbar li[data-id='nc'] a").append('' + qaCount + ''); $("#subNavbar li[data-id='myMeeting'] a").append('' + meetingCount + ''); + $("#subNavbar li[data-id='ticket'] a").append('' + ticketCount + ''); } } } diff --git a/module/my/view/ticket.html.php b/module/my/view/ticket.html.php new file mode 100644 index 0000000000..116c023c72 --- /dev/null +++ b/module/my/view/ticket.html.php @@ -0,0 +1,64 @@ + + * @package my + * @version $Id$ + * @link http://www.zentao.net + */ +?> +getModuleRoot() . 'common/view/header.html.php';?> + +rawMethod);?> + +
+ +
+

+ ticket->noTicket;?> + " . $lang->ticket->create, '', "class='btn btn-info'")?> +

+
+ +
+ + recTotal}&recPerPage={$pager->recPerPage}"; ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ticket->idAB);?>ticket->product);?>ticket->title);?>ticket->priAB);?>ticket->status);?>ticket->type);?>ticket->createdBy);?>ticket->createdDate);?>ticket->assignedTo);?>actions;?>
createLink('ticket', 'view', "id={$ticket->id}"), $ticket->id) : $ticket->id;?>product);?>createLink('ticket', 'view', "id={$ticket->id}"), $ticket->title) : $ticket->title;?>ticket->priList, $ticket->pri);?>ticket->statusList, $ticket->status);?>ticket->typeList, $ticket->type);?>openedBy);?>openedDate;?>assignedTo);?>ticket->buildOperateBrowseMenu($ticket->id);?>
+ +
+ +
+getModuleRoot() . 'common/view/footer.html.php';?>