1<?php
2
3use \dokuwiki\plugin\bez;
4
5if ($this->model->get_level() < BEZ_AUTH_USER) {
6    throw new bez\meta\PermissionDeniedException();
7}
8
9$period = NULL;
10if(count($_POST) > 0 && ($_POST['from'] != '' || $_POST['to'] != '')) {
11    $from = new DateTime($_POST['from']);
12    $to = new DateTime($_POST['to']);
13
14    $this->tpl->set_values(array(
15                               'from' => $from->format('Y-m-d'),
16                               'to' => $to->format('Y-m-d')));
17
18    $to->modify('+1 day');//add one day extra
19    $period = new DatePeriod($from, new DateInterval('P1D'), $to);
20}
21
22$this->tpl->set('issues', $this->model->threadFactory->report_issue($period)->fetchAll(PDO::FETCH_ASSOC));
23$this->tpl->set('projects', $this->model->threadFactory->report_project($period)->fetchAll(PDO::FETCH_ASSOC));
24$this->tpl->set('tasks', $this->model->taskFactory->report($period)->fetchAll(PDO::FETCH_ASSOC));
25$this->tpl->set('comments', $this->model->thread_commentFactory->report($period));
26