xref: /plugin/bez/ctl/start.php (revision eb2e6be9c74b2df263bd0a7ed247ee70c3d7cbd1)
1<?php
2/** @var action_plugin_bez $this */
3
4use \dokuwiki\plugin\bez;
5
6if ($this->model->get_level() < BEZ_AUTH_USER) {
7    throw new bez\meta\PermissionDeniedException();
8}
9
10$filter = array('state' => 'proposal');
11$proposals = $this->model->threadFactory->get_all($filter, 'id DESC');
12$this->tpl->set('proposals', $proposals);
13$this->tpl->set('proposals_count', $this->model->threadFactory->count($filter));
14
15$filter = array('state' => 'opened', 'coordinator' => $this->model->user_nick);
16$my_threads = $this->model->threadFactory->get_all($filter, 'last_activity_date DESC');
17$this->tpl->set('my_threads', $my_threads);
18$this->tpl->set('my_threads_count', $this->model->threadFactory->count($filter));
19
20$filter = array('state' => 'opened', 'assignee' => $this->model->user_nick);
21$my_tasks = $this->model->taskFactory->get_all($filter, 'plan_date DESC');
22$this->tpl->set('my_tasks', $my_tasks);
23$this->tpl->set('my_tasks_count', $this->model->taskFactory->count($filter));
24
25$filter = array('state' => 'opened', 'original_poster' => $this->model->user_nick);
26$reported_threads = $this->model->threadFactory->get_all($filter, 'last_activity_date DESC');
27$this->tpl->set('reported_threads', $reported_threads);
28$this->tpl->set('reported_threads_count', $this->model->threadFactory->count($filter));
29
30$filter = array('state' => 'opened', 'original_poster' => $this->model->user_nick);
31$reported_tasks = $this->model->taskFactory->get_all($filter, 'plan_date DESC');
32$this->tpl->set('reported_tasks', $reported_tasks);
33$this->tpl->set('reported_tasks_count', $this->model->taskFactory->count($filter));
34
35