diff --git a/module/bug/control.php b/module/bug/control.php index 64570953fa..abd0afbd13 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -1941,12 +1941,12 @@ class bug extends control * @access public * @return string */ - public function ajaxGetUserBugs($userID = '', $id = '' , $appendID = '') + public function ajaxGetUserBugs($userID = '', $id = '' , $appendID = 0) { if($userID == '') $userID = $this->app->user->id; $user = $this->loadModel('user')->getById($userID, 'id'); $account = $user->account; - $bugs = $this->bug->getUserBugPairs($account, true, '', '', '', $appendID); + $bugs = $this->bug->getUserBugPairs($account, true, 0, '', '', $appendID); if($id) return print(html::select("bugs[$id]", $bugs, '', 'class="form-control"')); return print(html::select('bug', $bugs, '', 'class=form-control')); diff --git a/module/bug/model.php b/module/bug/model.php index 40a743a2d4..a146c38fdc 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -1558,16 +1558,16 @@ class bugModel extends model /** * Get bug pairs of a user. * - * @param int $account - * @param bool $appendProduct - * @param int $limit - * @param array $skipProductIDList - * @param array $skipExecutionIDList - * @param array $appendBugID + * @param int $account + * @param bool $appendProduct + * @param int $limit + * @param array $skipProductIDList + * @param array $skipExecutionIDList + * @param int|array $appendBugID * @access public * @return array */ - public function getUserBugPairs($account, $appendProduct = true, $limit = 0, $skipProductIDList = array(), $skipExecutionIDList = array(), $appendBugID = '') + public function getUserBugPairs($account, $appendProduct = true, $limit = 0, $skipProductIDList = array(), $skipExecutionIDList = array(), $appendBugID = 0) { $bugs = array(); $stmt = $this->dao->select('t1.id, t1.title, t2.name as product') diff --git a/module/story/control.php b/module/story/control.php index 200fe925eb..9fc20cfda8 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -2564,7 +2564,7 @@ class story extends control * @access public * @return string */ - public function ajaxGetUserStories($userID = '', $id = '', $appendID = '') + public function ajaxGetUserStories($userID = '', $id = '', $appendID = 0) { if($userID == '') $userID = $this->app->user->id; $user = $this->loadModel('user')->getById($userID, 'id'); diff --git a/module/story/model.php b/module/story/model.php index fcfdd4c647..abaf9ec3e4 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -3022,15 +3022,15 @@ class storyModel extends model /** * Get story pairs of a user. * - * @param string $account - * @param string $limit - * @param string $type requirement|story - * @param array $skipProductIDList - * @param int $appendStoryID + * @param string $account + * @param string $limit + * @param string $type requirement|story + * @param array $skipProductIDList + * @param int|array $appendStoryID * @access public * @return array */ - public function getUserStoryPairs($account, $limit = 10, $type = 'story', $skipProductIDList = array(), $appendStoryID = '') + public function getUserStoryPairs($account, $limit = 10, $type = 'story', $skipProductIDList = array(), $appendStoryID = 0) { return $this->dao->select('id, title') ->from(TABLE_STORY) diff --git a/module/task/control.php b/module/task/control.php index c08294c4ec..0d30f54b71 100644 --- a/module/task/control.php +++ b/module/task/control.php @@ -1649,7 +1649,7 @@ class task extends control * @access public * @return string */ - public function ajaxGetUserTasks($userID = '', $id = '', $status = '', $appendID = '') + public function ajaxGetUserTasks($userID = '', $id = '', $status = '', $appendID = 0) { if($userID == '') $userID = $this->app->user->id; $user = $this->loadModel('user')->getById($userID, 'id'); diff --git a/module/task/model.php b/module/task/model.php index d1bfc9427c..867c50b9c0 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -2330,14 +2330,14 @@ class taskModel extends model /** * Get tasks pairs of a user. * - * @param string $account - * @param string $status - * @param array $skipExecutionIDList - * @param int $appendTaskID + * @param string $account + * @param string $status + * @param array $skipExecutionIDList + * @param int|array $appendTaskID * @access public * @return array */ - public function getUserTaskPairs($account, $status = 'all', $skipExecutionIDList = array(), $appendTaskID = '') + public function getUserTaskPairs($account, $status = 'all', $skipExecutionIDList = array(), $appendTaskID = 0) { $stmt = $this->dao->select('t1.id, t1.name, t2.name as execution') ->from(TABLE_TASK)->alias('t1') diff --git a/module/testtask/control.php b/module/testtask/control.php index 15a8bc266c..0e791390bf 100644 --- a/module/testtask/control.php +++ b/module/testtask/control.php @@ -1428,7 +1428,7 @@ class testtask extends control * @access public * @return void */ - public function ajaxGetUserTestTasks($userID = '', $id = '', $status = '', $appendID = '') + public function ajaxGetUserTestTasks($userID = '', $id = '', $status = '', $appendID = 0) { if($userID == '') $userID = $this->app->user->id; $user = $this->loadModel('user')->getById($userID, 'id'); diff --git a/module/testtask/model.php b/module/testtask/model.php index 6e7989f684..00b3c6ccb1 100644 --- a/module/testtask/model.php +++ b/module/testtask/model.php @@ -1032,16 +1032,16 @@ class testtaskModel extends model /** * Get testtask pairs of a user. * - * @param string $account - * @param int $limit - * @param string $status all|wait|doing|done|blocked - * @param array $skipProductIDList - * @param array $skipExecutionIDList - * @param int $appendTestTaskID + * @param string $account + * @param int $limit + * @param string $status all|wait|doing|done|blocked + * @param array $skipProductIDList + * @param array $skipExecutionIDList + * @param int|array $appendTestTaskID * @access public * @return array */ - public function getUserTestTaskPairs($account, $limit = 0, $status = 'all', $skipProductIDList = array(), $skipExecutionIDList = array(), $appendTestTaskID = '') + public function getUserTestTaskPairs($account, $limit = 0, $status = 'all', $skipProductIDList = array(), $skipExecutionIDList = array(), $appendTestTaskID = 0) { $stmt = $this->dao->select('t1.id, t1.name, t2.name as execution') ->from(TABLE_TESTTASK)->alias('t1') diff --git a/module/todo/control.php b/module/todo/control.php index 3022c06dc5..9d7919bd7d 100644 --- a/module/todo/control.php +++ b/module/todo/control.php @@ -215,9 +215,9 @@ class todo extends control } } - $bugs = $this->bug->getUserBugPairs($account, true, '', '', '', isset($objectIDList['bug']) ? $objectIDList['bug'] : ''); - $tasks = $this->task->getUserTaskPairs($account, 'wait,doing', '', isset($objectIDList['task']) ? $objectIDList['task'] : ''); - $storys = $this->loadModel('story')->getUserStoryPairs($account, 10, 'story', '', isset($objectIDList['story']) ? $objectIDList['story'] : ''); + $bugs = $this->bug->getUserBugPairs($account, true, 0, '', '', isset($objectIDList['bug']) ? $objectIDList['bug'] : ''); + $tasks = $this->task->getUserTaskPairs($account, 'wait,doing', '', isset($objectIDList['task']) ? $objectIDList['task'] : ''); + $storys = $this->loadModel('story')->getUserStoryPairs($account, 10, 'story', '', isset($objectIDList['story']) ? $objectIDList['story'] : ''); if($this->config->edition != 'open') $this->view->feedbacks = $this->loadModel('feedback')->getUserFeedbackPairs($account); if($this->config->edition == 'max') { @@ -225,7 +225,7 @@ class todo extends control $risks = $this->loadmodel('risk')->getUserRiskPairs($account); $opportunities = $this->loadmodel('opportunity')->getUserOpportunityPairs($account); } - $testtasks = $this->loadModel('testtask')->getUserTestTaskPairs($account, '', '', '', '', isset($objectIDList['testtask']) ? $objectIDList['testtask'] : ''); + $testtasks = $this->loadModel('testtask')->getUserTestTaskPairs($account, 0, 'all', '', '', isset($objectIDList['testtask']) ? $objectIDList['testtask'] : ''); /* Judge whether the edited todos is too large. */ $countInputVars = count($editedTodos) * $columns; diff --git a/module/todo/js/common.js b/module/todo/js/common.js index 3cc442ac4c..dc71a10ae5 100644 --- a/module/todo/js/common.js +++ b/module/todo/js/common.js @@ -29,6 +29,7 @@ function loadList(type, id, defaultType, idvalue) divID = '#nameBox'; } + id = id ? id : ''; var param = 'userID=' + userID + '&id=' + id; if(type == "task" || type == "testtask") param += '&status='; if(type == defaultType && idvalue != 0) param += '&idvalue=' + idvalue;