diff --git a/module/story/control.php b/module/story/control.php index edc39c146c..5a29bfa7a6 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -1545,4 +1545,21 @@ class story extends control $this->view->customExport = true; $this->display(); } + + /** + * AJAX: get storys of a user in html select. + * + * @param string $account + * @param string $id the id of the select control. + * @access public + * @return string + */ + public function ajaxGetUserStorys($account = '', $id = '') + { + if($account == '') $account = $this->app->user->account; + $storys = $this->story->getUserStoryPairs($account); + + if($id) die(html::select("bugs[$id]", $storys, '', 'class="form-control"')); + die(html::select('bug', $storys, '', 'class=form-control')); + } } diff --git a/module/todo/js/common.js b/module/todo/js/common.js index d531b8d1f2..956e2254ff 100644 --- a/module/todo/js/common.js +++ b/module/todo/js/common.js @@ -33,8 +33,12 @@ function loadList(type, id) { link = createLink('task', 'ajaxGetUserTasks', param); } + else if(type == 'story') + { + link = createLink('story', 'ajaxGetUserStorys', param); + } - if(type == 'bug' || type == 'task') + if(type == 'bug' || type == 'task' || type == 'story') { $.get(link, function(data, status) {