diff --git a/codepot/src/codepot/controllers/user.php b/codepot/src/codepot/controllers/user.php index 91f719ef..74d74992 100644 --- a/codepot/src/codepot/controllers/user.php +++ b/codepot/src/codepot/controllers/user.php @@ -5,6 +5,7 @@ class User extends Controller var $VIEW_ERROR = 'error'; var $VIEW_LOG = 'log'; var $VIEW_HOME = 'user_home'; + var $VIEW_ISSUE = 'user_issue'; var $VIEW_SETTINGS = 'user_settings'; function User () @@ -66,6 +67,43 @@ class User extends Controller } } + function issue () + { + $login = $this->login->getUser (); + if (CODEPOT_SIGNIN_COMPULSORY && $login['id'] == '') + redirect ('main/signin'); + + if ($login['id'] == '') + { + redirect ('site/home'); + return; + } + + $this->load->library ('IssueHelper', 'issuehelper'); + $this->lang->load ('issue', CODEPOT_LANG); + + $this->load->model ('ProjectModel', 'projects'); + $this->load->model ('IssueModel', 'issues'); + + $issues = $this->issues->getMyIssues ( + $login['id'], $this->issuehelper->_get_open_status_array($this->lang)); + if ($issues === FALSE) + { + $data['login'] = $login; + $data['message'] = 'DATABASE ERROR'; + $this->load->view ($this->VIEW_ERROR, $data); + } + else + { + $data['login'] = $login; + $data['issues'] = $issues; + $data['issue_type_array'] = $this->issuehelper->_get_type_array($this->lang); + $data['issue_status_array'] = $this->issuehelper->_get_status_array($this->lang); + $data['issue_priority_array'] = $this->issuehelper->_get_priority_array($this->lang); + $this->load->view ($this->VIEW_ISSUE, $data); + } + } + function log ($offset = 0) { $login = $this->login->getUser (); diff --git a/codepot/src/codepot/views/Makefile.am b/codepot/src/codepot/views/Makefile.am index ee5bcdff..2edfde34 100644 --- a/codepot/src/codepot/views/Makefile.am +++ b/codepot/src/codepot/views/Makefile.am @@ -30,6 +30,7 @@ www_DATA = \ site_show.php \ taskbar.php \ user_home.php \ + user_issue.php \ user_settings.php \ wiki_edit.php \ wiki_editx.php \ diff --git a/codepot/src/codepot/views/Makefile.in b/codepot/src/codepot/views/Makefile.in index 43ee5023..275fc6dc 100644 --- a/codepot/src/codepot/views/Makefile.in +++ b/codepot/src/codepot/views/Makefile.in @@ -175,6 +175,7 @@ www_DATA = \ site_show.php \ taskbar.php \ user_home.php \ + user_issue.php \ user_settings.php \ wiki_edit.php \ wiki_editx.php \ diff --git a/codepot/src/codepot/views/site_home.php b/codepot/src/codepot/views/site_home.php index 15251aa1..52f1c8dd 100644 --- a/codepot/src/codepot/views/site_home.php +++ b/codepot/src/codepot/views/site_home.php @@ -293,8 +293,8 @@ foreach ($latest_projects as $project)