Add settings to disable subtask timer and another to not include closed tasks into CFD

This commit is contained in:
Frederic Guillot 2015-07-25 13:02:20 -04:00
parent 392a75fa0e
commit 8142d43057
25 changed files with 173 additions and 6 deletions

View File

@ -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);

View File

@ -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' => '',
);

View File

@ -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' => '',
);

View File

@ -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' => '',
);

View File

@ -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' => '',
);

View File

@ -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' => '',
);

View File

@ -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é',
);

View File

@ -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' => '',
);

View File

@ -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' => '',
);

View File

@ -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' => '',
);

View File

@ -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' => '',
);

View File

@ -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' => '',
);

View File

@ -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' => '',
);

View File

@ -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' => '',
);

View File

@ -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' => '',
);

View File

@ -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' => '',
);

View File

@ -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' => '',
);

View File

@ -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' => '',
);

View File

@ -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' => '',
);

View File

@ -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()
));
}

View File

@ -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)
{

View File

@ -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)
{

View File

@ -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)
{

View File

@ -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']);

View File

@ -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"/>