xref: /plugin/bez/ctl/8d.php (revision a0cd8c785f18b483f73582b411767428d04a78f6)
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