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