summaryrefslogtreecommitdiff
path: root/scripts/create-sample-cfd.php
blob: 5319a1ecb03a461a4564bef9423d0341931305d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/usr/bin/env php
<?php

require __DIR__.'/../app/common.php';

use Model\ProjectDailySummary;
use Model\Task;

$pds = new ProjectDailySummary($container);
$taskModel = new Task($container);

for ($i = 1; $i <= 15; $i++) {

    $task = array(
        'title' => 'Task #'.$i,
        'project_id' => 1,
        'column_id' => 1,
    );

    $taskModel->create($task);
}

$pds->updateTotals(1, date('Y-m-d', strtotime('-7 days')));

$taskModel->movePosition(1, 1, 2, 1);
$taskModel->movePosition(1, 2, 2, 1);
$taskModel->movePosition(1, 3, 2, 1);
$pds->updateTotals(1, date('Y-m-d', strtotime('-6 days')));

$taskModel->movePosition(1, 3, 3, 1);
$taskModel->movePosition(1, 4, 3, 1);
$taskModel->movePosition(1, 5, 3, 1);
$pds->updateTotals(1, date('Y-m-d', strtotime('-5 days')));

$taskModel->movePosition(1, 5, 4, 1);
$taskModel->movePosition(1, 6, 4, 1);
$pds->updateTotals(1, date('Y-m-d', strtotime('-4 days')));

$taskModel->movePosition(1, 7, 4, 1);
$taskModel->movePosition(1, 8, 4, 1);
$pds->updateTotals(1, date('Y-m-d', strtotime('-3 days')));

$taskModel->movePosition(1, 9, 3, 1);
$taskModel->movePosition(1, 10, 2, 1);
$pds->updateTotals(1, date('Y-m-d', strtotime('-2 days')));

$taskModel->create(array('title' => 'Random task', 'project_id' => 1));
$taskModel->movePosition(1, 11, 2, 1);
$taskModel->movePosition(1, 12, 4, 1);
$taskModel->movePosition(1, 13, 4, 1);
$pds->updateTotals(1, date('Y-m-d', strtotime('-2 days')));

$taskModel->movePosition(1, 14, 3, 1);
$pds->updateTotals(1, date('Y-m-d', strtotime('-1 days')));

$taskModel->movePosition(1, 15, 4, 1);
$taskModel->movePosition(1, 16, 4, 1);

$taskModel->create(array('title' => 'Random task', 'project_id' => 1));

$pds->updateTotals(1, date('Y-m-d'));