diff --git a/module/datatable/model.php b/module/datatable/model.php index 83ea48c3b1..dca133dd43 100644 --- a/module/datatable/model.php +++ b/module/datatable/model.php @@ -3,9 +3,9 @@ * The view file of datatable module of ZenTaoPMS. * * @copyright Copyright 2014-2014 青岛易软天创网络科技有限公司 (QingDao Nature Easy Soft Network Technology Co,LTD www.cnezsoft.com) - * @license business(商业软件) + * @license business(商业软件) * @author Hao sun - * @package datatable + * @package datatable * @version $Id$ * @link http://www.zentao.net */ @@ -15,8 +15,8 @@ class datatableModel extends model { /** * Get field list. - * - * @param string $module + * + * @param string $module * @access public * @return array */ @@ -41,7 +41,7 @@ class datatableModel extends model $fields = $this->loadModel('workflowfield')->getList($module); foreach($fields as $field) { - if($field->buildin) continue; + if($field->buildin) continue; $this->config->$module->datatable->fieldList[$field->field]['title'] = $field->name; $this->config->$module->datatable->fieldList[$field->field]['width'] = '120'; $this->config->$module->datatable->fieldList[$field->field]['fixed'] = 'no'; @@ -119,12 +119,12 @@ class datatableModel extends model /** * Sort cols. - * - * @param int $a - * @param int $b + * + * @param int $a + * @param int $b * @static * @access public - * @return void + * @return int */ public static function sortCols($a, $b) { @@ -134,10 +134,11 @@ class datatableModel extends model /** * Print table head. - * - * @param object $col - * @param string $orderBy - * @param string $vars + * + * @param object $col + * @param string $orderBy + * @param string $vars + * @param bool $checkBox * @access public * @return void */ @@ -173,11 +174,11 @@ class datatableModel extends model } /** - * Set fixed field width - * - * @param object $setting - * @param int $minLeftWidth - * @param int $minRightWidth + * Set fixed field width + * + * @param object $setting + * @param int $minLeftWidth + * @param int $minRightWidth * @access public * @return array */ diff --git a/module/issue/model.php b/module/issue/model.php index 1cc0be7a13..79138fa598 100644 --- a/module/issue/model.php +++ b/module/issue/model.php @@ -190,7 +190,7 @@ class issueModel extends model * @access public * @return array */ - public function getUserIssuePairs($account, $limit = 10, $status = 'all') + public function getUserIssuePairs($account, $limit = 0, $status = 'all') { $stmt = $this->dao->select('t1.id, t1.title, t2.name as project') ->from(TABLE_ISSUE)->alias('t1') @@ -198,7 +198,7 @@ class issueModel extends model ->where('t1.assignedTo')->eq($account) ->andWhere('t1.deleted')->eq(0) ->beginIF($status != 'all')->andWhere('t1.status')->in($status)->fi() - ->limit($limit) + ->beginIF($limit)->limit($limit)->fi() ->query(); $issues = array(); diff --git a/module/my/view/project.html.php b/module/my/view/project.html.php index 74b3a8fbf9..17b4e2d9af 100644 --- a/module/my/view/project.html.php +++ b/module/my/view/project.html.php @@ -68,7 +68,7 @@ diff --git a/module/risk/model.php b/module/risk/model.php index e440bb17d6..b0caf8a45c 100644 --- a/module/risk/model.php +++ b/module/risk/model.php @@ -264,7 +264,7 @@ class riskModel extends model * @access public * @return array */ - public function getUserRiskPairs($account, $limit = 10, $status = 'all') + public function getUserRiskPairs($account, $limit = 0, $status = 'all') { $stmt = $this->dao->select('t1.id, t1.name, t2.name as project') ->from(TABLE_RISK)->alias('t1') @@ -272,7 +272,7 @@ class riskModel extends model ->where('t1.assignedTo')->eq($account) ->andWhere('t1.deleted')->eq(0) ->beginIF($status != 'all')->andWhere('t1.status')->in($status)->fi() - ->limit($limit) + ->beginIF($limit)->limit($limit)->fi() ->query(); $risks = array(); diff --git a/module/testtask/model.php b/module/testtask/model.php index 5d3b0bff52..e889d0efb0 100644 --- a/module/testtask/model.php +++ b/module/testtask/model.php @@ -1089,7 +1089,7 @@ class testtaskModel extends model * @access public * @return array */ - public function getUserTesttaskPairs($account, $limit = 10, $status = 'all', $skipProjectIDList = '') + public function getUserTesttaskPairs($account, $limit = 0, $status = 'all', $skipProjectIDList = '') { $stmt = $this->dao->select('t1.id, t1.name, t2.name as project') ->from(TABLE_TESTTASK)->alias('t1') @@ -1098,7 +1098,7 @@ class testtaskModel extends model ->andWhere('t1.deleted')->eq(0) ->beginIF($status != 'all')->andWhere('t1.status')->in($status)->fi() ->beginIF(!empty($skipProjectIDList))->andWhere('t1.project')->notin($skipProjectIDList)->fi() - ->limit($limit) + ->beginIF($limit)->limit($limit)->fi() ->query(); $testtaskPairs = array(); diff --git a/module/todo/control.php b/module/todo/control.php index 521c59c40b..0523f090b4 100644 --- a/module/todo/control.php +++ b/module/todo/control.php @@ -24,6 +24,7 @@ class todo extends control $this->loadModel('task'); $this->loadModel('bug'); $this->loadModel('my')->setMenu(); + if(!isset($this->config->qcVersion)) unset($this->lang->todo->typeList['review']); } /** @@ -545,10 +546,15 @@ class todo extends control ->orderBy($orderBy)->fetchAll('id'); /* Get users, bugs, tasks and times. */ - $users = $this->loadModel('user')->getPairs('noletter'); - $bugs = $this->loadModel('bug')->getUserBugPairs($account); - $tasks = $this->loadModel('task')->getUserTaskPairs($account); - $times = date::buildTimeList($this->config->todo->times->begin, $this->config->todo->times->end, $this->config->todo->times->delta); + $users = $this->loadModel('user')->getPairs('noletter'); + $bugs = $this->loadModel('bug')->getUserBugPairs($account); + $stories = $this->loadModel('story')->getUserStoryPairs($account, 100, 'story'); + $tasks = $this->loadModel('task')->getUserTaskPairs($account); + $issues = $this->loadModel('issue')->getUserIssuePairs($account); + $risks = $this->loadModel('risk')->getUserRiskPairs($account); + $testTasks = $this->loadModel('testtask')->getUserTesttaskPairs($account); + if(isset($this->config->qcVersion)) $reviews = $this->loadModel('review')->getUserReviewPairs($account, 0, 'wait'); + $times = date::buildTimeList($this->config->todo->times->begin, $this->config->todo->times->end, $this->config->todo->times->delta); foreach($todos as $todo) { @@ -556,10 +562,17 @@ class todo extends control $todo->begin = $todo->begin == '2400' ? '' : (isset($times[$todo->begin]) ? $times[$todo->begin] : $todo->begin); $todo->end = $todo->end == '2400' ? '' : (isset($times[$todo->end]) ? $times[$todo->end] : $todo->end); - if(isset($users[$todo->account])) $todo->account = $users[$todo->account]; - if($todo->type == 'bug') $todo->name = isset($bugs[$todo->idvalue]) ? $bugs[$todo->idvalue] . "(#$todo->idvalue)" : ''; - if($todo->type == 'task') $todo->name = isset($tasks[$todo->idvalue]) ? $tasks[$todo->idvalue] . "(#$todo->idvalue)" : ''; - if(isset($todoLang->typeList[$todo->type])) $todo->type = $todoLang->typeList[$todo->type]; + $type = $todo->type; + if(isset($users[$todo->account])) $todo->account = $users[$todo->account]; + if($type == 'bug') $todo->name = isset($bugs[$todo->idvalue]) ? $bugs[$todo->idvalue] . "(#$todo->idvalue)" : ''; + if($type == 'story') $todo->name = isset($stories[$todo->idvalue]) ? $stories[$todo->idvalue] . "(#$todo->idvalue)" : ''; + if($type == 'task') $todo->name = isset($tasks[$todo->idvalue]) ? $tasks[$todo->idvalue] . "(#$todo->idvalue)" : ''; + if($type == 'issue') $todo->name = isset($issues[$todo->idvalue]) ? $issues[$todo->idvalue] . "(#$todo->idvalue)" : ''; + if($type == 'risk') $todo->name = isset($risks[$todo->idvalue]) ? $risks[$todo->idvalue] . "(#$todo->idvalue)" : ''; + if($type == 'testtask') $todo->name = isset($testTasks[$todo->idvalue]) ? $testTasks[$todo->idvalue] . "(#$todo->idvalue)" : ''; + if($type == 'review' && isset($this->config->qcVersion)) $todo->name = isset($reviews[$todo->idvalue]) ? $reviews[$todo->idvalue] . "(#$todo->idvalue)" : ''; + + if(isset($todoLang->typeList[$type])) $todo->type = $todoLang->typeList[$type]; if(isset($todoLang->priList[$todo->pri])) $todo->pri = $todoLang->priList[$todo->pri]; if(isset($todoLang->statusList[$todo->status])) $todo->status = $todoLang->statusList[$todo->status]; if($todo->private == 1) $todo->desc = $this->lang->todo->thisIsPrivate; diff --git a/www/js/zui/min.js b/www/js/zui/min.js index 084c57fb1b..308d484888 100644 --- a/www/js/zui/min.js +++ b/www/js/zui/min.js @@ -76,4 +76,4 @@ function(t){"function"==typeof define&&define.amd?define(["jquery"],t):"object"= */ function(t){function e(e){if("string"==typeof e.data){var i=e.handler,n=e.data.toLowerCase().split(" ");e.handler=function(e){if(this===e.target||!/textarea|select/i.test(e.target.nodeName)&&"text"!==e.target.type){var o="keypress"!==e.type&&t.hotkeys.specialKeys[e.which],a=String.fromCharCode(e.which).toLowerCase(),s="",r={};e.altKey&&"alt"!==o&&(s+="alt+"),e.ctrlKey&&"ctrl"!==o&&(s+="ctrl+"),e.metaKey&&!e.ctrlKey&&"meta"!==o&&(s+="meta+"),e.shiftKey&&"shift"!==o&&(s+="shift+"),o?r[s+o]=!0:(r[s+a]=!0,r[s+t.hotkeys.shiftNums[a]]=!0,"shift+"===s&&(r[t.hotkeys.shiftNums[a]]=!0));for(var l=0,h=n.length;l","/":"?","\\":"|"}},t.each(["keydown","keyup","keypress"],function(){t.event.special[this]={add:e}})}(jQuery),function(t){"use strict";function e(e,i){if(e===!1)return e;if(!e)return i;e===!0?e={add:!0,"delete":!0,edit:!0,sort:!0}:"string"==typeof e&&(e=e.split(","));var n;return Array.isArray(e)&&(n={},t.each(e,function(e,i){t.isPlainObject(i)?n[i.action]=i:n[i]=!0}),e=n),t.isPlainObject(e)&&(n={},t.each(e,function(e,i){i?n[e]=t.extend({type:e},s[e],t.isPlainObject(i)?i:null):n[e]=!1}),e=n),i?t.extend(!0,{},i,e):e}function i(e,i,n){return i=i||e.type,t(n||e.template).addClass("tree-action").attr(t.extend({"data-type":i,title:e.title||""},e.attr)).data("action",e)}var n="zui.tree",o=0,a=function(e,i){this.name=n,this.$=t(e),this.getOptions(i),this._init()},s={sort:{template:''},add:{template:''},edit:{template:''},"delete":{template:''}};a.DEFAULTS={animate:null,initialState:"normal",toggleTemplate:''},a.prototype.add=function(e,i,n,o,a){var s,r=t(e),l=this.options;if(r.is("li")?(s=r.children("ul"),s.length||(s=t("