xref: /plugin/bez/ctl/8d.php (revision e8827d732aaeeee6f7b703c5654f86ca97056383)
1<?php
2
3//if we don't have a token, generate a new one and redirect
4if (!isset($_GET['t'])) {
5    $token = $this->model->authentication_tokenFactory->get_token($this->id());
6    header('Location: ' . $this->url() . '&t=' . $token);
7}
8
9/** @var bez\mdl\Thread $thread */
10$thread = $this->model->threadFactory->get_one($this->get_param('id'));
11$this->tpl->set('thread', $thread);
12$this->tpl->set('causes_real',
13        $this->model->thread_commentFactory->get_from_thread($thread, array('type' => 'cause_real'))->fetchAll());
14$this->tpl->set('causes_potential',
15    $this->model->thread_commentFactory->get_from_thread($thread, array('type' => 'cause_potential'))->fetchAll());
16$tasks = $this->model->taskFactory->get_by_type($thread);
17$this->tpl->set('8d_tasks', $tasks);
18
19
20/*jeżeli nie mamy tokenu generujemy nowy i przekierowujemy*/
21//$toko = new Tokens();
22//if ($this->model->acl->get_level() >= BEZ_AUTH_USER &&
23//    (!isset($_GET['t']) || ! $toko->check(trim($_GET['t']), $this->page_id()))) {
24//	header('Location: '.$uri.'?id='.$_GET['id'].'&t='.$toko->get($this->page_id()));
25//}
26//
27//$issue_id = $nparams['id'];
28//
29////$isso = new Issues();
30////$causo = new Causes();
31////$tasko = new Tasks();
32////
33////$template['issue'] = $isso->get($issue_id);
34////$template['team'] = $isso->get_team($issue_id);
35////
36////$template['real_causes'] = $causo->get_real($issue_id);
37////$template['potential_causes'] = $causo->get_potential($issue_id);
38////
39////
40////$template['tasks'] = $tasko->get_by_8d($issue_id);
41////$template['cost_total'] = $tasko->get_total_cost($issue_id);
42//
43//$template['issue'] = $this->model->issues->get_one($issue_id);
44//$template['total_cost'] = $template['issue']->total_cost();
45//
46//$template['real_causes'] = $this->model->commcauses->get_all(array(
47//    'type'  => '1',
48//    'issue' => $issue_id
49//))->fetchAll(); //fetchAll becouse we need to count rows before displaying them
50//
51//$template['potential_causes'] = $this->model->commcauses->get_all(array(
52//    'type'  => '2',
53//    'issue' => $issue_id
54//))->fetchAll(); //fetchAll becouse we need to count rows before displaying them
55//
56//$template['tasks'] = array();
57//$template['tasks']['3d'] =  $this->model->tasks->get_all(array(
58//    'action'  => '0',
59//    'state' => array('!=', '2'),
60//    'issue' => $issue_id
61//))->fetchAll(); //fetchAll becouse we need to count rows before displaying them
62//
63//$template['tasks']['5d'] =  $this->model->tasks->get_all(array(
64//    'action'  => '1',
65//    'state' => array('!=', '2'),
66//    'issue' => $issue_id
67//))->fetchAll(); //fetchAll becouse we need to count rows before displaying them
68//
69//
70//$template['tasks']['7d'] =  $this->model->tasks->get_all(array(
71//    'action'  => '2',
72//    'state' => array('!=', '2'),
73//    'issue' => $issue_id
74//))->fetchAll(); //fetchAll becouse we need to count rows before displaying them
75//
76//$template['uri'] = $uri.'?'.$_SERVER['QUERY_STRING'];
77