summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2015-04-11 23:01:17 -0400
committerFrederic Guillot <fred@kanboard.net>2015-04-11 23:01:17 -0400
commit9ca2ba21272ddb1958e0b5b2f5842cde42508139 (patch)
treec6db297008d728a44040af5804386802b457219e /scripts
parent7df055aff1e1056d87bb720531d60cb079805f94 (diff)
Add burndown chart
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/create-sample-burndown.php55
1 files changed, 55 insertions, 0 deletions
diff --git a/scripts/create-sample-burndown.php b/scripts/create-sample-burndown.php
new file mode 100755
index 00000000..ae0b2627
--- /dev/null
+++ b/scripts/create-sample-burndown.php
@@ -0,0 +1,55 @@
+#!/usr/bin/env php
+<?php
+
+require __DIR__.'/../app/common.php';
+
+use Model\ProjectDailySummary;
+use Model\TaskCreation;
+use Model\TaskStatus;
+
+$pds = new ProjectDailySummary($container);
+$taskCreation = new TaskCreation($container);
+$taskStatus = new TaskStatus($container);
+
+for ($i = 1; $i <= 15; $i++) {
+
+ $task = array(
+ 'title' => 'Task #'.$i,
+ 'project_id' => 1,
+ 'column_id' => rand(1, 4),
+ 'score' => rand(1, 21)
+ );
+
+ $taskCreation->create($task);
+}
+
+$pds->updateTotals(1, date('Y-m-d', strtotime('-7 days')));
+
+$taskStatus->close(1);
+$pds->updateTotals(1, date('Y-m-d', strtotime('-6 days')));
+
+$taskStatus->close(2);
+$taskStatus->close(3);
+$pds->updateTotals(1, date('Y-m-d', strtotime('-5 days')));
+
+$taskStatus->close(4);
+$pds->updateTotals(1, date('Y-m-d', strtotime('-4 days')));
+
+$taskStatus->close(5);
+$pds->updateTotals(1, date('Y-m-d', strtotime('-3 days')));
+
+$taskStatus->close(6);
+$taskStatus->close(7);
+$taskStatus->close(8);
+$pds->updateTotals(1, date('Y-m-d', strtotime('-2 days')));
+
+$taskStatus->close(9);
+$taskStatus->close(10);
+$pds->updateTotals(1, date('Y-m-d', strtotime('-2 days')));
+
+$taskStatus->close(12);
+$taskStatus->close(13);
+$pds->updateTotals(1, date('Y-m-d', strtotime('-1 days')));
+
+$taskStatus->close(1);
+$pds->updateTotals(1, date('Y-m-d')); \ No newline at end of file