diff --git a/app/Controller/Config.php b/app/Controller/Config.php index 206237c0f..6f14cc31d 100644 --- a/app/Controller/Config.php +++ b/app/Controller/Config.php @@ -42,7 +42,7 @@ class Config extends Base switch ($redirect) { case 'project': - $values += array('subtask_restriction' => 0); + $values += array('subtask_restriction' => 0, 'subtask_time_tracking' => 0, 'cfd_include_closed_tasks' => 0); break; case 'integrations': $values += array('integration_slack_webhook' => 0, 'integration_hipchat' => 0, 'integration_gravatar' => 0, 'integration_jabber' => 0); diff --git a/app/Locale/cs_CZ/translations.php b/app/Locale/cs_CZ/translations.php index 480926898..d9d7b3aff 100644 --- a/app/Locale/cs_CZ/translations.php +++ b/app/Locale/cs_CZ/translations.php @@ -1003,4 +1003,12 @@ return array( // 'Expand sidebar' => '', // 'This feature does not work with all browsers.' => '', // 'There is no destination project available.' => '', + // 'Trigger automatically subtask time tracking' => '', + // 'Include closed tasks in the cumulative flow diagram' => '', + // 'Current swimlane: %s' => '', + // 'Current column: %s' => '', + // 'Current category: %s' => '', + // 'no category' => '', + // 'Current assignee: %s' => '', + // 'not assigned' => '', ); diff --git a/app/Locale/da_DK/translations.php b/app/Locale/da_DK/translations.php index 6916b84e7..0a9f0d9fa 100644 --- a/app/Locale/da_DK/translations.php +++ b/app/Locale/da_DK/translations.php @@ -1003,4 +1003,12 @@ return array( // 'Expand sidebar' => '', // 'This feature does not work with all browsers.' => '', // 'There is no destination project available.' => '', + // 'Trigger automatically subtask time tracking' => '', + // 'Include closed tasks in the cumulative flow diagram' => '', + // 'Current swimlane: %s' => '', + // 'Current column: %s' => '', + // 'Current category: %s' => '', + // 'no category' => '', + // 'Current assignee: %s' => '', + // 'not assigned' => '', ); diff --git a/app/Locale/de_DE/translations.php b/app/Locale/de_DE/translations.php index 1b381157d..259ebda3f 100644 --- a/app/Locale/de_DE/translations.php +++ b/app/Locale/de_DE/translations.php @@ -1003,4 +1003,12 @@ return array( // 'Expand sidebar' => '', // 'This feature does not work with all browsers.' => '', // 'There is no destination project available.' => '', + // 'Trigger automatically subtask time tracking' => '', + // 'Include closed tasks in the cumulative flow diagram' => '', + // 'Current swimlane: %s' => '', + // 'Current column: %s' => '', + // 'Current category: %s' => '', + // 'no category' => '', + // 'Current assignee: %s' => '', + // 'not assigned' => '', ); diff --git a/app/Locale/es_ES/translations.php b/app/Locale/es_ES/translations.php index 867cc3dba..104b1211d 100644 --- a/app/Locale/es_ES/translations.php +++ b/app/Locale/es_ES/translations.php @@ -1003,4 +1003,12 @@ return array( // 'Expand sidebar' => '', // 'This feature does not work with all browsers.' => '', // 'There is no destination project available.' => '', + // 'Trigger automatically subtask time tracking' => '', + // 'Include closed tasks in the cumulative flow diagram' => '', + // 'Current swimlane: %s' => '', + // 'Current column: %s' => '', + // 'Current category: %s' => '', + // 'no category' => '', + // 'Current assignee: %s' => '', + // 'not assigned' => '', ); diff --git a/app/Locale/fi_FI/translations.php b/app/Locale/fi_FI/translations.php index 79124b152..7c515917c 100644 --- a/app/Locale/fi_FI/translations.php +++ b/app/Locale/fi_FI/translations.php @@ -1003,4 +1003,12 @@ return array( // 'Expand sidebar' => '', // 'This feature does not work with all browsers.' => '', // 'There is no destination project available.' => '', + // 'Trigger automatically subtask time tracking' => '', + // 'Include closed tasks in the cumulative flow diagram' => '', + // 'Current swimlane: %s' => '', + // 'Current column: %s' => '', + // 'Current category: %s' => '', + // 'no category' => '', + // 'Current assignee: %s' => '', + // 'not assigned' => '', ); diff --git a/app/Locale/fr_FR/translations.php b/app/Locale/fr_FR/translations.php index 81159fcfe..e4ae6e53d 100644 --- a/app/Locale/fr_FR/translations.php +++ b/app/Locale/fr_FR/translations.php @@ -982,7 +982,7 @@ return array( 'Help on Google authentication' => 'Aide sur l\'authentification Google', 'Github Authentication' => 'Authentification Github', 'Help on Github authentication' => 'Aide sur l\'authentification Github', - 'Channel/Group/User (Optional)' => 'Cannal/Groupe/Utilisateur (Optionnel)', + 'Channel/Group/User (Optional)' => 'Canal/Groupe/Utilisateur (Optionnel)', 'Lead time: ' => 'Lead time : ', 'Cycle time: ' => 'Temps de cycle : ', 'Time spent into each column' => 'Temps passé dans chaque colonne', @@ -1005,4 +1005,12 @@ return array( 'Expand sidebar' => 'Déplier la barre latérale', 'This feature does not work with all browsers.' => 'Cette fonctionnalité n\'est pas compatible avec tous les navigateurs', 'There is no destination project available.' => 'Il n\'y a pas de projet de destination disponible.', + 'Trigger automatically subtask time tracking' => 'Déclencher automatiquement le suivi du temps pour les sous-tâches', + 'Include closed tasks in the cumulative flow diagram' => 'Inclure les tâches fermées dans le diagramme de flux cumulé', + 'Current swimlane: %s' => 'Swimlane actuelle : %s', + 'Current column: %s' => 'Colonne actuelle : %s', + 'Current category: %s' => 'Catégorie actuelle : %s', + 'no category' => 'aucune catégorie', + 'Current assignee: %s' => 'Assigné actuel : %s', + 'not assigned' => 'non assigné', ); diff --git a/app/Locale/hu_HU/translations.php b/app/Locale/hu_HU/translations.php index cd2bca0ae..7e8992604 100644 --- a/app/Locale/hu_HU/translations.php +++ b/app/Locale/hu_HU/translations.php @@ -1003,4 +1003,12 @@ return array( // 'Expand sidebar' => '', // 'This feature does not work with all browsers.' => '', // 'There is no destination project available.' => '', + // 'Trigger automatically subtask time tracking' => '', + // 'Include closed tasks in the cumulative flow diagram' => '', + // 'Current swimlane: %s' => '', + // 'Current column: %s' => '', + // 'Current category: %s' => '', + // 'no category' => '', + // 'Current assignee: %s' => '', + // 'not assigned' => '', ); diff --git a/app/Locale/it_IT/translations.php b/app/Locale/it_IT/translations.php index 353630c37..74b6b1c00 100644 --- a/app/Locale/it_IT/translations.php +++ b/app/Locale/it_IT/translations.php @@ -1003,4 +1003,12 @@ return array( // 'Expand sidebar' => '', // 'This feature does not work with all browsers.' => '', // 'There is no destination project available.' => '', + // 'Trigger automatically subtask time tracking' => '', + // 'Include closed tasks in the cumulative flow diagram' => '', + // 'Current swimlane: %s' => '', + // 'Current column: %s' => '', + // 'Current category: %s' => '', + // 'no category' => '', + // 'Current assignee: %s' => '', + // 'not assigned' => '', ); diff --git a/app/Locale/ja_JP/translations.php b/app/Locale/ja_JP/translations.php index 636df9a5f..390bc382b 100644 --- a/app/Locale/ja_JP/translations.php +++ b/app/Locale/ja_JP/translations.php @@ -1003,4 +1003,12 @@ return array( // 'Expand sidebar' => '', // 'This feature does not work with all browsers.' => '', // 'There is no destination project available.' => '', + // 'Trigger automatically subtask time tracking' => '', + // 'Include closed tasks in the cumulative flow diagram' => '', + // 'Current swimlane: %s' => '', + // 'Current column: %s' => '', + // 'Current category: %s' => '', + // 'no category' => '', + // 'Current assignee: %s' => '', + // 'not assigned' => '', ); diff --git a/app/Locale/nl_NL/translations.php b/app/Locale/nl_NL/translations.php index c0a6a0326..849467af6 100644 --- a/app/Locale/nl_NL/translations.php +++ b/app/Locale/nl_NL/translations.php @@ -1003,4 +1003,12 @@ return array( // 'Expand sidebar' => '', // 'This feature does not work with all browsers.' => '', // 'There is no destination project available.' => '', + // 'Trigger automatically subtask time tracking' => '', + // 'Include closed tasks in the cumulative flow diagram' => '', + // 'Current swimlane: %s' => '', + // 'Current column: %s' => '', + // 'Current category: %s' => '', + // 'no category' => '', + // 'Current assignee: %s' => '', + // 'not assigned' => '', ); diff --git a/app/Locale/pl_PL/translations.php b/app/Locale/pl_PL/translations.php index 9c4558d34..3685cba40 100644 --- a/app/Locale/pl_PL/translations.php +++ b/app/Locale/pl_PL/translations.php @@ -1003,4 +1003,12 @@ return array( // 'Expand sidebar' => '', // 'This feature does not work with all browsers.' => '', // 'There is no destination project available.' => '', + // 'Trigger automatically subtask time tracking' => '', + // 'Include closed tasks in the cumulative flow diagram' => '', + // 'Current swimlane: %s' => '', + // 'Current column: %s' => '', + // 'Current category: %s' => '', + // 'no category' => '', + // 'Current assignee: %s' => '', + // 'not assigned' => '', ); diff --git a/app/Locale/pt_BR/translations.php b/app/Locale/pt_BR/translations.php index b31f815c9..a2aba8114 100644 --- a/app/Locale/pt_BR/translations.php +++ b/app/Locale/pt_BR/translations.php @@ -1003,4 +1003,12 @@ return array( // 'Expand sidebar' => '', // 'This feature does not work with all browsers.' => '', // 'There is no destination project available.' => '', + // 'Trigger automatically subtask time tracking' => '', + // 'Include closed tasks in the cumulative flow diagram' => '', + // 'Current swimlane: %s' => '', + // 'Current column: %s' => '', + // 'Current category: %s' => '', + // 'no category' => '', + // 'Current assignee: %s' => '', + // 'not assigned' => '', ); diff --git a/app/Locale/ru_RU/translations.php b/app/Locale/ru_RU/translations.php index 9ce2ea6e6..9b4ee1e2c 100644 --- a/app/Locale/ru_RU/translations.php +++ b/app/Locale/ru_RU/translations.php @@ -1003,4 +1003,12 @@ return array( // 'Expand sidebar' => '', // 'This feature does not work with all browsers.' => '', // 'There is no destination project available.' => '', + // 'Trigger automatically subtask time tracking' => '', + // 'Include closed tasks in the cumulative flow diagram' => '', + // 'Current swimlane: %s' => '', + // 'Current column: %s' => '', + // 'Current category: %s' => '', + // 'no category' => '', + // 'Current assignee: %s' => '', + // 'not assigned' => '', ); diff --git a/app/Locale/sr_Latn_RS/translations.php b/app/Locale/sr_Latn_RS/translations.php index 7f90af2dc..479341172 100644 --- a/app/Locale/sr_Latn_RS/translations.php +++ b/app/Locale/sr_Latn_RS/translations.php @@ -1003,4 +1003,12 @@ return array( // 'Expand sidebar' => '', // 'This feature does not work with all browsers.' => '', // 'There is no destination project available.' => '', + // 'Trigger automatically subtask time tracking' => '', + // 'Include closed tasks in the cumulative flow diagram' => '', + // 'Current swimlane: %s' => '', + // 'Current column: %s' => '', + // 'Current category: %s' => '', + // 'no category' => '', + // 'Current assignee: %s' => '', + // 'not assigned' => '', ); diff --git a/app/Locale/sv_SE/translations.php b/app/Locale/sv_SE/translations.php index 67e071924..5e1efdf26 100644 --- a/app/Locale/sv_SE/translations.php +++ b/app/Locale/sv_SE/translations.php @@ -1003,4 +1003,12 @@ return array( // 'Expand sidebar' => '', // 'This feature does not work with all browsers.' => '', // 'There is no destination project available.' => '', + // 'Trigger automatically subtask time tracking' => '', + // 'Include closed tasks in the cumulative flow diagram' => '', + // 'Current swimlane: %s' => '', + // 'Current column: %s' => '', + // 'Current category: %s' => '', + // 'no category' => '', + // 'Current assignee: %s' => '', + // 'not assigned' => '', ); diff --git a/app/Locale/th_TH/translations.php b/app/Locale/th_TH/translations.php index a44d01167..f8b268261 100644 --- a/app/Locale/th_TH/translations.php +++ b/app/Locale/th_TH/translations.php @@ -1003,4 +1003,12 @@ return array( // 'Expand sidebar' => '', // 'This feature does not work with all browsers.' => '', // 'There is no destination project available.' => '', + // 'Trigger automatically subtask time tracking' => '', + // 'Include closed tasks in the cumulative flow diagram' => '', + // 'Current swimlane: %s' => '', + // 'Current column: %s' => '', + // 'Current category: %s' => '', + // 'no category' => '', + // 'Current assignee: %s' => '', + // 'not assigned' => '', ); diff --git a/app/Locale/tr_TR/translations.php b/app/Locale/tr_TR/translations.php index d394a67af..52ac11e1d 100644 --- a/app/Locale/tr_TR/translations.php +++ b/app/Locale/tr_TR/translations.php @@ -1003,4 +1003,12 @@ return array( // 'Expand sidebar' => '', // 'This feature does not work with all browsers.' => '', // 'There is no destination project available.' => '', + // 'Trigger automatically subtask time tracking' => '', + // 'Include closed tasks in the cumulative flow diagram' => '', + // 'Current swimlane: %s' => '', + // 'Current column: %s' => '', + // 'Current category: %s' => '', + // 'no category' => '', + // 'Current assignee: %s' => '', + // 'not assigned' => '', ); diff --git a/app/Locale/zh_CN/translations.php b/app/Locale/zh_CN/translations.php index 4de3aeafb..e5e54b59b 100644 --- a/app/Locale/zh_CN/translations.php +++ b/app/Locale/zh_CN/translations.php @@ -1003,4 +1003,12 @@ return array( // 'Expand sidebar' => '', // 'This feature does not work with all browsers.' => '', // 'There is no destination project available.' => '', + // 'Trigger automatically subtask time tracking' => '', + // 'Include closed tasks in the cumulative flow diagram' => '', + // 'Current swimlane: %s' => '', + // 'Current column: %s' => '', + // 'Current category: %s' => '', + // 'no category' => '', + // 'Current assignee: %s' => '', + // 'not assigned' => '', ); diff --git a/app/Model/ProjectDailyColumnStats.php b/app/Model/ProjectDailyColumnStats.php index 26e9d8b78..d5c72c126 100644 --- a/app/Model/ProjectDailyColumnStats.php +++ b/app/Model/ProjectDailyColumnStats.php @@ -32,6 +32,8 @@ class ProjectDailyColumnStats extends Base { return $this->db->transaction(function($db) use ($project_id, $date) { + $status = $this->config->get('cfd_include_closed_tasks') == 1 ? array(Task::STATUS_OPEN, Task::STATUS_CLOSED) : array(Task::STATUS_OPEN); + $column_ids = $db->table(Board::TABLE)->eq('project_id', $project_id)->findAllByColumn('id'); foreach ($column_ids as $column_id) { @@ -59,6 +61,7 @@ class ProjectDailyColumnStats extends Base 'total' => $db->table(Task::TABLE) ->eq('project_id', $project_id) ->eq('column_id', $column_id) + ->in('is_active', $status) ->count() )); } diff --git a/app/Schema/Mysql.php b/app/Schema/Mysql.php index c62f3a724..47fb806e5 100644 --- a/app/Schema/Mysql.php +++ b/app/Schema/Mysql.php @@ -6,7 +6,13 @@ use PDO; use Core\Security; use Model\Link; -const VERSION = 80; +const VERSION = 81; + +function version_81($pdo) +{ + $pdo->exec("INSERT INTO settings VALUES ('subtask_time_tracking', '1')"); + $pdo->exec("INSERT INTO settings VALUES ('cfd_include_closed_tasks', '1')"); +} function version_80($pdo) { diff --git a/app/Schema/Postgres.php b/app/Schema/Postgres.php index b436db1b2..6b85ff577 100644 --- a/app/Schema/Postgres.php +++ b/app/Schema/Postgres.php @@ -6,7 +6,13 @@ use PDO; use Core\Security; use Model\Link; -const VERSION = 60; +const VERSION = 61; + +function version_61($pdo) +{ + $pdo->exec("INSERT INTO settings VALUES ('subtask_time_tracking', '1')"); + $pdo->exec("INSERT INTO settings VALUES ('cfd_include_closed_tasks', '1')"); +} function version_60($pdo) { diff --git a/app/Schema/Sqlite.php b/app/Schema/Sqlite.php index 23097b551..9e0575cf2 100644 --- a/app/Schema/Sqlite.php +++ b/app/Schema/Sqlite.php @@ -6,7 +6,13 @@ use Core\Security; use PDO; use Model\Link; -const VERSION = 76; +const VERSION = 77; + +function version_77($pdo) +{ + $pdo->exec("INSERT INTO settings VALUES ('subtask_time_tracking', '1')"); + $pdo->exec("INSERT INTO settings VALUES ('cfd_include_closed_tasks', '1')"); +} function version_76($pdo) { diff --git a/app/Subscriber/SubtaskTimeTrackingSubscriber.php b/app/Subscriber/SubtaskTimeTrackingSubscriber.php index 02f14c40c..e45b2c935 100644 --- a/app/Subscriber/SubtaskTimeTrackingSubscriber.php +++ b/app/Subscriber/SubtaskTimeTrackingSubscriber.php @@ -28,7 +28,7 @@ class SubtaskTimeTrackingSubscriber extends \Core\Base implements EventSubscribe public function logStartEnd(SubtaskEvent $event) { - if (isset($event['status'])) { + if (isset($event['status']) && $this->config->get('subtask_time_tracking') == 1) { $subtask = $this->subtask->getById($event['id']); diff --git a/app/Template/config/project.php b/app/Template/config/project.php index b762de243..c58a7bac6 100644 --- a/app/Template/config/project.php +++ b/app/Template/config/project.php @@ -18,6 +18,8 @@
= t('Example: "Bug, Feature Request, Improvement"') ?>
= $this->form->checkbox('subtask_restriction', t('Allow only one subtask in progress at the same time for a user'), 1, $values['subtask_restriction'] == 1) ?> + = $this->form->checkbox('subtask_time_tracking', t('Trigger automatically subtask time tracking'), 1, $values['subtask_time_tracking'] == 1) ?> + = $this->form->checkbox('cfd_include_closed_tasks', t('Include closed tasks in the cumulative flow diagram'), 1, $values['cfd_include_closed_tasks'] == 1) ?>