summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2015-07-25 13:02:20 -0400
committerFrederic Guillot <fred@kanboard.net>2015-07-25 13:02:20 -0400
commit8142d43057939265d15317bc051ff149553ca727 (patch)
treeb4172f7dfd06702e9eac32b59a10a2f8669adbb4
parent392a75fa0e76530c176d78b4e17a2834286616e3 (diff)
Add settings to disable subtask timer and another to not include closed tasks into CFD
-rw-r--r--app/Controller/Config.php2
-rw-r--r--app/Locale/cs_CZ/translations.php8
-rw-r--r--app/Locale/da_DK/translations.php8
-rw-r--r--app/Locale/de_DE/translations.php8
-rw-r--r--app/Locale/es_ES/translations.php8
-rw-r--r--app/Locale/fi_FI/translations.php8
-rw-r--r--app/Locale/fr_FR/translations.php10
-rw-r--r--app/Locale/hu_HU/translations.php8
-rw-r--r--app/Locale/it_IT/translations.php8
-rw-r--r--app/Locale/ja_JP/translations.php8
-rw-r--r--app/Locale/nl_NL/translations.php8
-rw-r--r--app/Locale/pl_PL/translations.php8
-rw-r--r--app/Locale/pt_BR/translations.php8
-rw-r--r--app/Locale/ru_RU/translations.php8
-rw-r--r--app/Locale/sr_Latn_RS/translations.php8
-rw-r--r--app/Locale/sv_SE/translations.php8
-rw-r--r--app/Locale/th_TH/translations.php8
-rw-r--r--app/Locale/tr_TR/translations.php8
-rw-r--r--app/Locale/zh_CN/translations.php8
-rw-r--r--app/Model/ProjectDailyColumnStats.php3
-rw-r--r--app/Schema/Mysql.php8
-rw-r--r--app/Schema/Postgres.php8
-rw-r--r--app/Schema/Sqlite.php8
-rw-r--r--app/Subscriber/SubtaskTimeTrackingSubscriber.php2
-rw-r--r--app/Template/config/project.php2
25 files changed, 173 insertions, 6 deletions
diff --git a/app/Controller/Config.php b/app/Controller/Config.php
index 206237c0..6f14cc31 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 48092689..d9d7b3af 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 6916b84e..0a9f0d9f 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 1b381157..259ebda3 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 867cc3db..104b1211 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 79124b15..7c515917 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 81159fcf..e4ae6e53 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 cd2bca0a..7e899260 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 353630c3..74b6b1c0 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 636df9a5..390bc382 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 c0a6a032..849467af 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 9c4558d3..3685cba4 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 b31f815c..a2aba811 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 9ce2ea6e..9b4ee1e2 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 7f90af2d..47934117 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 67e07192..5e1efdf2 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 a44d0116..f8b26826 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 d394a67a..52ac11e1 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 4de3aeaf..e5e54b59 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 26e9d8b7..d5c72c12 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 c62f3a72..47fb806e 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 b436db1b..6b85ff57 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 23097b55..9e0575cf 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 02f14c40..e45b2c93 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 b762de24..c58a7bac 100644
--- a/app/Template/config/project.php
+++ b/app/Template/config/project.php
@@ -18,6 +18,8 @@
<p class="form-help"><?= t('Example: "Bug, Feature Request, Improvement"') ?></p>
<?= $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) ?>
<div class="form-actions">
<input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>