diff --git a/app/Controller/App.php b/app/Controller/App.php index 9f8ded199..993149c5e 100644 --- a/app/Controller/App.php +++ b/app/Controller/App.php @@ -3,6 +3,7 @@ namespace Controller; use Model\Project as ProjectModel; +use Model\SubTask; /** * Application controller @@ -27,6 +28,7 @@ class App extends Base 'board_selector' => $this->projectPermission->getAllowedProjects($user_id), 'events' => $this->projectActivity->getProjects($project_ids, 10), 'tasks' => $this->taskFinder->getAllTasksByUser($user_id), + 'subtasks' => $this->subTask->getAllByUser($user_id, array(SubTask::STATUS_TODO, SubTask::STATUS_INPROGRESS)), 'projects' => $this->project->getSummary($project_ids), 'title' => t('Dashboard'), ))); diff --git a/app/Locale/da_DK/translations.php b/app/Locale/da_DK/translations.php index 590f25121..2cb772402 100644 --- a/app/Locale/da_DK/translations.php +++ b/app/Locale/da_DK/translations.php @@ -571,4 +571,6 @@ return array( // 'Reportings' => '', // 'Task repartition for "%s"' => '', // 'Analytics' => '', + // 'Subtask' => '', + // 'My subtasks' => '', ); diff --git a/app/Locale/de_DE/translations.php b/app/Locale/de_DE/translations.php index 807118d8f..fb03b6164 100644 --- a/app/Locale/de_DE/translations.php +++ b/app/Locale/de_DE/translations.php @@ -571,4 +571,6 @@ return array( // 'Reportings' => '', // 'Task repartition for "%s"' => '', // 'Analytics' => '', + // 'Subtask' => '', + // 'My subtasks' => '', ); diff --git a/app/Locale/es_ES/translations.php b/app/Locale/es_ES/translations.php index 25df8acf4..c54267ffc 100644 --- a/app/Locale/es_ES/translations.php +++ b/app/Locale/es_ES/translations.php @@ -571,4 +571,6 @@ return array( // 'Reportings' => '', // 'Task repartition for "%s"' => '', // 'Analytics' => '', + // 'Subtask' => '', + // 'My subtasks' => '', ); diff --git a/app/Locale/fi_FI/translations.php b/app/Locale/fi_FI/translations.php index 517430ea6..59cea9f76 100644 --- a/app/Locale/fi_FI/translations.php +++ b/app/Locale/fi_FI/translations.php @@ -571,4 +571,6 @@ return array( // 'Reportings' => '', // 'Task repartition for "%s"' => '', // 'Analytics' => '', + // 'Subtask' => '', + // 'My subtasks' => '', ); diff --git a/app/Locale/fr_FR/translations.php b/app/Locale/fr_FR/translations.php index 3afa53ce9..d36b0e934 100644 --- a/app/Locale/fr_FR/translations.php +++ b/app/Locale/fr_FR/translations.php @@ -571,4 +571,6 @@ return array( 'Reportings' => 'Rapports', 'Task repartition for "%s"' => 'Répartition des tâches pour « %s »', 'Analytics' => 'Analytique', + 'Subtask' => 'Sous-tâche', + 'My subtasks' => 'Mes sous-tâches', ); diff --git a/app/Locale/it_IT/translations.php b/app/Locale/it_IT/translations.php index 81ccbd863..e4f9fc8b0 100644 --- a/app/Locale/it_IT/translations.php +++ b/app/Locale/it_IT/translations.php @@ -571,4 +571,6 @@ return array( // 'Reportings' => '', // 'Task repartition for "%s"' => '', // 'Analytics' => '', + // 'Subtask' => '', + // 'My subtasks' => '', ); diff --git a/app/Locale/ja_JP/translations.php b/app/Locale/ja_JP/translations.php index 2fdfb3d6f..0e75fc237 100644 --- a/app/Locale/ja_JP/translations.php +++ b/app/Locale/ja_JP/translations.php @@ -571,4 +571,6 @@ return array( // 'Reportings' => '', // 'Task repartition for "%s"' => '', // 'Analytics' => '', + // 'Subtask' => '', + // 'My subtasks' => '', ); diff --git a/app/Locale/pl_PL/translations.php b/app/Locale/pl_PL/translations.php index 45253fe1e..f02774297 100644 --- a/app/Locale/pl_PL/translations.php +++ b/app/Locale/pl_PL/translations.php @@ -571,4 +571,6 @@ return array( // 'Reportings' => '', // 'Task repartition for "%s"' => '', // 'Analytics' => '', + // 'Subtask' => '', + // 'My subtasks' => '', ); diff --git a/app/Locale/pt_BR/translations.php b/app/Locale/pt_BR/translations.php index 778bfd3a6..fd1fc1cfd 100644 --- a/app/Locale/pt_BR/translations.php +++ b/app/Locale/pt_BR/translations.php @@ -571,4 +571,6 @@ return array( // 'Reportings' => '', // 'Task repartition for "%s"' => '', // 'Analytics' => '', + // 'Subtask' => '', + // 'My subtasks' => '', ); diff --git a/app/Locale/ru_RU/translations.php b/app/Locale/ru_RU/translations.php index f2eaca630..9c486ff4a 100644 --- a/app/Locale/ru_RU/translations.php +++ b/app/Locale/ru_RU/translations.php @@ -571,4 +571,6 @@ return array( // 'Reportings' => '', // 'Task repartition for "%s"' => '', // 'Analytics' => '', + // 'Subtask' => '', + // 'My subtasks' => '', ); diff --git a/app/Locale/sv_SE/translations.php b/app/Locale/sv_SE/translations.php index 4f9d815a5..a56c7db58 100644 --- a/app/Locale/sv_SE/translations.php +++ b/app/Locale/sv_SE/translations.php @@ -571,4 +571,6 @@ return array( // 'Reportings' => '', // 'Task repartition for "%s"' => '', // 'Analytics' => '', + // 'Subtask' => '', + // 'My subtasks' => '', ); diff --git a/app/Locale/th_TH/translations.php b/app/Locale/th_TH/translations.php index 8a1c8b357..f2e51d125 100644 --- a/app/Locale/th_TH/translations.php +++ b/app/Locale/th_TH/translations.php @@ -571,4 +571,6 @@ return array( // 'Reportings' => '', // 'Task repartition for "%s"' => '', // 'Analytics' => '', + // 'Subtask' => '', + // 'My subtasks' => '', ); diff --git a/app/Locale/zh_CN/translations.php b/app/Locale/zh_CN/translations.php index 3d45532a6..4b86a7e13 100644 --- a/app/Locale/zh_CN/translations.php +++ b/app/Locale/zh_CN/translations.php @@ -571,4 +571,6 @@ return array( // 'Reportings' => '', // 'Task repartition for "%s"' => '', // 'Analytics' => '', + // 'Subtask' => '', + // 'My subtasks' => '', ); diff --git a/app/Model/SubTask.php b/app/Model/SubTask.php index 886ad1f3f..f414da7fa 100644 --- a/app/Model/SubTask.php +++ b/app/Model/SubTask.php @@ -92,6 +92,38 @@ class SubTask extends Base return $subtasks; } + /** + * Get all subtasks assigned to a user + * + * @access public + * @param integer $user_id User id + * @param array $status List of status + * @return array + */ + public function getAllByUser($user_id, array $status) + { + $status_list = $this->getStatusList(); + $subtasks = $this->db->table(self::TABLE) + ->columns( + self::TABLE.'.*', + Task::TABLE.'.project_id', + Task::TABLE.'.color_id', + Project::TABLE.'.name AS project_name' + ) + ->eq('user_id', $user_id) + ->in(self::TABLE.'.status', $status) + ->join(Task::TABLE, 'id', 'task_id') + ->join(Project::TABLE, 'id', 'project_id', Task::TABLE) + ->asc(Task::TABLE.'.id') + ->findAll(); + + foreach ($subtasks as &$subtask) { + $subtask['status_name'] = $status_list[$subtask['status']]; + } + + return $subtasks; + } + /** * Get a subtask by the id * diff --git a/app/Template/app/index.php b/app/Template/app/index.php index 89550e055..637bc4028 100644 --- a/app/Template/app/index.php +++ b/app/Template/app/index.php @@ -75,6 +75,37 @@ + +

+ +

+ + + + + + + + + + + + + + + + +
 
+ $subtask['task_id'])) ?> + + $subtask['project_id'])) ?> + + + + $subtask['task_id'])) ?> +
+ +

diff --git a/assets/css/app.css b/assets/css/app.css index a23fca2d2..0e031e28c 100644 --- a/assets/css/app.css +++ b/assets/css/app.css @@ -130,6 +130,10 @@ th a:hover { width: 10%; } +.column-15 { + width: 15%; +} + .column-20 { width: 20%; } diff --git a/assets/css/table.css b/assets/css/table.css index c5ddb4c04..1a1e52a76 100644 --- a/assets/css/table.css +++ b/assets/css/table.css @@ -66,6 +66,10 @@ th a:hover { width: 10%; } +.column-15 { + width: 15%; +} + .column-20 { width: 20%; }