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