xref: /plugin/bez/ctl/8d.php (revision 60c2063d146ee3f9fbe85de8801c33f2a5bd12ed)
1<?php
2include_once DOKU_PLUGIN."bez/models/issues.php";
3include_once DOKU_PLUGIN."bez/models/causes.php";
4include_once DOKU_PLUGIN."bez/models/tokens.php";
5
6/*jeżeli nie mamy tokenu generujemy nowy i przekierowujemy*/
7$toko = new Tokens();
8if (!isset($_GET['t']) || ! $toko->check(trim($_GET['t']), $ID))
9	header('Location: '.$uri.'?id='.$_GET['id'].'&t='.$toko->get($ID));
10
11$issue_id = $nparams['id'];
12
13//$isso = new Issues();
14//$causo = new Causes();
15//$tasko = new Tasks();
16//
17//$template['issue'] = $isso->get($issue_id);
18//$template['team'] = $isso->get_team($issue_id);
19//
20//$template['real_causes'] = $causo->get_real($issue_id);
21//$template['potential_causes'] = $causo->get_potential($issue_id);
22//
23//
24//$template['tasks'] = $tasko->get_by_8d($issue_id);
25//$template['cost_total'] = $tasko->get_total_cost($issue_id);
26
27$template['issue'] = $this->model->issues->get_one($issue_id);
28$template['total_cost'] = $template['issue']->total_cost();
29
30$template['real_causes'] = $this->model->commcauses->get_all(array(
31    'type'  => '1',
32    'issue' => $issue_id
33))->fetchAll(); //fetchAll becouse we need to count rows before displaying them
34
35$template['potential_causes'] = $this->model->commcauses->get_all(array(
36    'type'  => '2',
37    'issue' => $issue_id
38))->fetchAll(); //fetchAll becouse we need to count rows before displaying them
39
40$template['tasks'] = array();
41$template['tasks']['3d'] =  $this->model->tasks->get_all(array(
42    'action'  => '0',
43    'issue' => $issue_id
44))->fetchAll(); //fetchAll becouse we need to count rows before displaying them
45
46$template['tasks']['5d'] =  $this->model->tasks->get_all(array(
47    'action'  => '1',
48    'issue' => $issue_id
49))->fetchAll(); //fetchAll becouse we need to count rows before displaying them
50
51
52$template['tasks']['7d'] =  $this->model->tasks->get_all(array(
53    'action'  => '2',
54    'issue' => $issue_id
55))->fetchAll(); //fetchAll becouse we need to count rows before displaying them
56
57$template['uri'] = $uri.'?'.$_SERVER['QUERY_STRING'];