diff --git a/module/issue/control.php b/module/issue/control.php index 653c4e5d67..93b159f048 100644 --- a/module/issue/control.php +++ b/module/issue/control.php @@ -455,6 +455,27 @@ class issue extends control } } + /** + * AJAX: return issues of a user in html select. + * + * @param int $userID + * @param string $id + * @param string $status + * @access public + * @return void + */ + public function ajaxGetUserIssues($userID = '', $id = '', $status = 'all') + { + if($userID == '') $userID = $this->app->user->id; + $user = $this->loadModel('user')->getById($userID, 'id'); + $account = $user->account; + + $issues = $this->issue->getUserIssuePairs($account, 0, $status); + + if($id) die(html::select("issues[$id]", $issues, '', 'class="form-control"')); + die(html::select('issue', $issues, '', 'class=form-control')); + } + /** * View an issue. * diff --git a/module/issue/model.php b/module/issue/model.php index b3c4087261..f7d6353554 100644 --- a/module/issue/model.php +++ b/module/issue/model.php @@ -186,10 +186,11 @@ class issueModel extends model * @param string $account * @param int $limit * @param string $status all|unconfirmed|active|suspended|resolved|closed|canceled + * @param array $skipProjectIDList * @access public * @return array */ - public function getUserIssuePairs($account, $limit = 0, $status = 'all') + public function getUserIssuePairs($account, $limit = 0, $status = 'all', $skipProjectIDList = array()) { $stmt = $this->dao->select('t1.id, t1.title, t2.name as project') ->from(TABLE_ISSUE)->alias('t1') @@ -197,6 +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() + ->beginIF(!empty($skipProjectIDList))->andWhere('t1.PRJ')->notin($skipProjectIDList)->fi() ->beginIF($limit)->limit($limit)->fi() ->query(); diff --git a/module/risk/control.php b/module/risk/control.php index c32cb823c1..f2dcb37ee1 100644 --- a/module/risk/control.php +++ b/module/risk/control.php @@ -389,7 +389,7 @@ class risk extends control $actionID = $this->loadModel('action')->create('risk', $riskID, 'Activated', $this->post->comment); $this->action->logHistory($actionID, $changes); } - + if(isonlybody()) die(js::closeModal('parent.parent', 'this')); die(js::locate($this->createLink('risk', 'browse'), 'parent')); } @@ -401,4 +401,26 @@ class risk extends control $this->view->risk = $this->risk->getById($riskID); $this->display(); } + + /** + * AJAX: return risks of a user in html select. + * + * @param int $userID + * @param string $id + * @param string $status + * @access public + * @return void + */ + public function ajaxGetUserRisks($userID = '', $id = '', $status = 'all') + { + if($userID == '') $userID = $this->app->user->id; + $user = $this->loadModel('user')->getById($userID, 'id'); + $account = $user->account; + + $risks = $this->risk->getUserRiskPairs($account, 0, $status); + + if($id) die(html::select("risks[$id]", $risks, '', 'class="form-control"')); + die(html::select('risk', $risks, '', 'class=form-control')); + } } + diff --git a/module/risk/model.php b/module/risk/model.php index 39e4277a44..ab35a41d89 100644 --- a/module/risk/model.php +++ b/module/risk/model.php @@ -260,10 +260,11 @@ class riskModel extends model * @param string $account * @param int $limit * @param string $status all|active|closed|hangup|canceled + * @param array $skipProjectIDList * @access public * @return array */ - public function getUserRiskPairs($account, $limit = 0, $status = 'all') + public function getUserRiskPairs($account, $limit = 0, $status = 'all', $skipProjectIDList = array()) { $stmt = $this->dao->select('t1.id, t1.name, t2.name as project') ->from(TABLE_RISK)->alias('t1') @@ -271,6 +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() + ->beginIF(!empty($skipProjectIDList))->andWhere('t1.PRJ')->notin($skipProjectIDList)->fi() ->beginIF($limit)->limit($limit)->fi() ->query(); diff --git a/module/testtask/control.php b/module/testtask/control.php index 4f9b1f3b57..1643ef32bc 100644 --- a/module/testtask/control.php +++ b/module/testtask/control.php @@ -1175,4 +1175,25 @@ class testtask extends control $this->view->productID = $productID; $this->display(); } + + /** + * AJAX: return test tasks of a user in html select. + * + * @param int $userID + * @param string $id + * @param string $status + * @access public + * @return void + */ + public function ajaxGetUserTestTasks($userID = '', $id = '', $status = 'all') + { + if($userID == '') $userID = $this->app->user->id; + $user = $this->loadModel('user')->getById($userID, 'id'); + $account = $user->account; + + $testTasks = $this->testtask->getUserTestTaskPairs($account, 0, $status); + + if($id) die(html::select("testTasks[$id]", $testTasks, '', 'class="form-control"')); + die(html::select('testTask', $testTasks, '', 'class=form-control')); + } } diff --git a/module/testtask/model.php b/module/testtask/model.php index e889d0efb0..1b2a6cd704 100644 --- a/module/testtask/model.php +++ b/module/testtask/model.php @@ -1085,11 +1085,12 @@ class testtaskModel extends model * @param string $account * @param int $limit * @param string $status all|wait|doing|done|blocked - * @param string $skipProjectIDList + * @param array $skipProductIDList + * @param array $skipProjectIDList * @access public * @return array */ - public function getUserTesttaskPairs($account, $limit = 0, $status = 'all', $skipProjectIDList = '') + public function getUserTestTaskPairs($account, $limit = 0, $status = 'all', $skipProductIDList = array(), $skipProjectIDList = array()) { $stmt = $this->dao->select('t1.id, t1.name, t2.name as project') ->from(TABLE_TESTTASK)->alias('t1') @@ -1097,7 +1098,8 @@ class testtaskModel extends model ->where('t1.owner')->eq($account) ->andWhere('t1.deleted')->eq(0) ->beginIF($status != 'all')->andWhere('t1.status')->in($status)->fi() - ->beginIF(!empty($skipProjectIDList))->andWhere('t1.project')->notin($skipProjectIDList)->fi() + ->beginIF(!empty($skipProductIDList))->andWhere('t1.product')->notin($skipProductIDList)->fi() + ->beginIF(!empty($skipProjectIDList))->andWhere('t1.PRJ')->notin($skipProjectIDList)->fi() ->beginIF($limit)->limit($limit)->fi() ->query(); diff --git a/module/todo/css/create.css b/module/todo/css/create.css index 8315b7741f..890160933b 100644 --- a/module/todo/css/create.css +++ b/module/todo/css/create.css @@ -5,3 +5,5 @@ .cycleConfig .tab-pane{padding:8px 0px;} .cycleConfig .tab-pane .input-group{width:380px} #name{height: 34px} +.nameBox{display: grid;} +.chosen-container-single .chosen-single{height: 34px;} diff --git a/module/todo/js/common.js b/module/todo/js/common.js index 73148b3405..65789831af 100644 --- a/module/todo/js/common.js +++ b/module/todo/js/common.js @@ -37,8 +37,24 @@ function loadList(type, id) { link = createLink('story', 'ajaxGetUserStories', param); } + else if(type == 'issue') + { + link = createLink('issue', 'ajaxGetUserIssues', param); + } + else if(type == 'risk') + { + link = createLink('risk', 'ajaxGetUserRisks', param); + } + else if(type == 'testtask') + { + link = createLink('testtask', 'ajaxGetUserTestTasks', param); + } + else if(type == 'review') + { + link = createLink('review', 'ajaxGetUserReviews', param); + } - if(type == 'bug' || type == 'task' || type == 'story') + if(type == 'bug' || type == 'task' || type == 'story' || type == 'issue' || type == 'risk' || type == 'testtask' || type == 'review' ) { $.get(link, function(data, status) { diff --git a/module/todo/view/create.html.php b/module/todo/view/create.html.php index dfb19c3c61..b23c7e7176 100644 --- a/module/todo/view/create.html.php +++ b/module/todo/view/create.html.php @@ -103,7 +103,7 @@ todo->beforeDays, html::input('config[beforeDays]', 0, "class='form-control'"));?> - + todo->deadline;?> @@ -111,7 +111,7 @@ todo->type;?> todo->typeList, '', 'onchange="loadList(this.value);" class="form-control"');?> - + todo->name;?> @@ -119,7 +119,7 @@
todo->pri;?> -
+
@@ -129,15 +129,15 @@
- + todo->desc;?> - + todo->status;?> todo->statusList, '', "class='form-control chosen'");?> - + todo->beginAndEnd;?> @@ -151,7 +151,7 @@
- + todo->private;?> @@ -160,7 +160,7 @@ - +