xref: /plugin/bez/ctl/start.php (revision b05908268e37f14f59ea1bcf6b4807b5d0e822e3)
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$orderby = array('sort', 'priority DESC', 'create_date DESC');
10$filter = array('state' => 'proposal');
11$proposals = $this->model->threadFactory->get_all($filter, $orderby);
12$this->tpl->set('proposals', $proposals);
13$this->tpl->set('proposals_count', $this->model->threadFactory->count($filter));
14
15$orderby = array('sort', 'priority DESC', 'create_date DESC');
16$filter = array('state' => 'opened', 'coordinator' => $this->model->user_nick);
17$my_threads = $this->model->threadFactory->get_all($filter, $orderby);
18$this->tpl->set('my_threads', $my_threads);
19$this->tpl->set('my_threads_count', $this->model->threadFactory->count($filter));
20
21$orderby = array('priority DESC', 'plan_date');
22$filter = array('state' => 'opened', 'assignee' => $this->model->user_nick);
23$my_tasks = $this->model->taskFactory->get_all($filter, $orderby);
24$this->tpl->set('my_tasks', $my_tasks);
25$this->tpl->set('my_tasks_count', $this->model->taskFactory->count($filter));
26
27$orderby = array('sort', 'priority DESC', 'create_date DESC');
28$filter = array('state' => 'opened', 'original_poster' => $this->model->user_nick);
29$reported_threads = $this->model->threadFactory->get_all($filter, $orderby);
30$this->tpl->set('reported_threads', $reported_threads);
31$this->tpl->set('reported_threads_count', $this->model->threadFactory->count($filter));
32
33$orderby = array('priority DESC', 'plan_date');
34$filter = array('state' => 'opened', 'original_poster' => $this->model->user_nick);
35$reported_tasks = $this->model->taskFactory->get_all($filter, $orderby);
36$this->tpl->set('reported_tasks', $reported_tasks);
37$this->tpl->set('reported_tasks_count', $this->model->taskFactory->count($filter));
38
39