xref: /plugin/bez/ctl/8d.php (revision 2fef90f903459552b92673ecf9c2f6a06b8cde17)
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']), $this->page_id()))
9	header('Location: '.$uri.'?id='.$_GET['id'].'&t='.$toko->get($this->page_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    'state' => '1',
44    'issue' => $issue_id
45))->fetchAll(); //fetchAll becouse we need to count rows before displaying them
46
47$template['tasks']['5d'] =  $this->model->tasks->get_all(array(
48    'action'  => '1',
49    'state' => '1',
50    'issue' => $issue_id
51))->fetchAll(); //fetchAll becouse we need to count rows before displaying them
52
53
54$template['tasks']['7d'] =  $this->model->tasks->get_all(array(
55    'action'  => '2',
56    'state' => '1',
57    'issue' => $issue_id
58))->fetchAll(); //fetchAll becouse we need to count rows before displaying them
59
60$template['uri'] = $uri.'?'.$_SERVER['QUERY_STRING'];