From b24b1e7e4e5ee0551ee56aa0f21c4425b479db2e Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Wed, 4 Feb 2015 22:19:32 -0500 Subject: Add subtasks restrictions and time tracking --- app/Controller/User.php | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) (limited to 'app/Controller/User.php') diff --git a/app/Controller/User.php b/app/Controller/User.php index a02da7a9..3d44f226 100644 --- a/app/Controller/User.php +++ b/app/Controller/User.php @@ -189,6 +189,29 @@ class User extends Base ))); } + /** + * Display timesheet + * + * @access public + */ + public function timesheet() + { + $user = $this->getUser(); + + $subtask_paginator = $this->paginator + ->setUrl('user', 'timesheet', array('user_id' => $user['id'], 'pagination' => 'subtasks')) + ->setMax(20) + ->setOrder('start') + ->setDirection('DESC') + ->setQuery($this->subtaskTimeTracking->getUserQuery($user['id'])) + ->calculateOnlyIf($this->request->getStringParam('pagination') === 'subtasks'); + + $this->response->html($this->layout('user/timesheet', array( + 'subtask_paginator' => $subtask_paginator, + 'user' => $user, + ))); + } + /** * Display last connections * @@ -450,7 +473,7 @@ class User extends Base * * @access public */ - public function gitHub() + public function github() { $code = $this->request->getStringParam('code'); @@ -494,7 +517,7 @@ class User extends Base * * @access public */ - public function unlinkGitHub() + public function unlinkGithub() { $this->checkCSRFParam(); -- cgit v1.2.3