summaryrefslogtreecommitdiff
path: root/scripts/create-sample-lead-time.php
diff options
context:
space:
mode:
authorLesstat <florianbarth@gmx.de>2015-07-11 11:44:26 +0200
committerLesstat <florianbarth@gmx.de>2015-07-11 11:44:26 +0200
commita85a1c613239c20fe72eb96c2921f4c220ec156b (patch)
treed032b4591e518cbbbfaa8886f8f5d98a6ea2efb7 /scripts/create-sample-lead-time.php
parent5101eaa8060ce3c75a81a26f6e47aae40e3d4ac3 (diff)
parent7e94d0ca233d15d6124c0adf3f956a119c82ccae (diff)
Merged branch 'master' of https://github.com/fguillot/kanboard
only imports conflicted
Diffstat (limited to 'scripts/create-sample-lead-time.php')
-rwxr-xr-xscripts/create-sample-lead-time.php70
1 files changed, 70 insertions, 0 deletions
diff --git a/scripts/create-sample-lead-time.php b/scripts/create-sample-lead-time.php
new file mode 100755
index 00000000..d4d82006
--- /dev/null
+++ b/scripts/create-sample-lead-time.php
@@ -0,0 +1,70 @@
+#!/usr/bin/env php
+<?php
+
+require __DIR__.'/../app/common.php';
+
+use Model\Project;
+use Model\ProjectDailyStats;
+
+$p = new Project($container);
+$pds = new ProjectDailyStats($container);
+
+$p->create(array('name' => 'Test Lead/Cycle time'));
+
+$container['db']->table('tasks')->insert(array(
+ 'title' => 'Lead time = 4d | Cycle time = 3d',
+ 'date_creation' => strtotime('-7 days'),
+ 'date_started' => strtotime('-6 days'),
+ 'date_completed' => strtotime('-3 days'),
+ 'is_active' => 0,
+ 'project_id' => 1,
+ 'column_id' => 1,
+));
+
+$container['db']->table('tasks')->insert(array(
+ 'title' => 'Lead time = 1d | Cycle time = 1d',
+ 'date_creation' => strtotime('-7 days'),
+ 'date_started' => strtotime('-7 days'),
+ 'date_completed' => strtotime('-6 days'),
+ 'is_active' => 0,
+ 'project_id' => 1,
+ 'column_id' => 1,
+));
+
+$pds->updateTotals(1, date('Y-m-d', strtotime('-6 days')));
+
+$container['db']->table('tasks')->insert(array(
+ 'title' => 'Lead time = 7d | Cycle time = 5d',
+ 'date_creation' => strtotime('-7 days'),
+ 'date_started' => strtotime('-5 days'),
+ 'date_completed' => strtotime('today'),
+ 'is_active' => 0,
+ 'project_id' => 1,
+ 'column_id' => 1,
+));
+
+$pds->updateTotals(1, date('Y-m-d', strtotime('-5 days')));
+
+$container['db']->table('tasks')->insert(array(
+ 'title' => 'Lead time = 1d | Cycle time = 0',
+ 'date_creation' => strtotime('-3 days'),
+ 'date_started' => 0,
+ 'date_completed' => 0,
+ 'is_active' => 0,
+ 'project_id' => 1,
+ 'column_id' => 1,
+));
+
+$pds->updateTotals(1, date('Y-m-d', strtotime('-4 days')));
+
+$container['db']->table('tasks')->insert(array(
+ 'title' => 'Lead time = 1d | Cycle time = 1d',
+ 'date_creation' => strtotime('-3 days'),
+ 'date_started' => strtotime('-3 days'),
+ 'date_completed' => 0,
+ 'is_active' => 0,
+ 'project_id' => 1,
+ 'column_id' => 1,
+));
+
+$pds->updateTotals(1, date('Y-m-d', strtotime('-3 days')));