Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
93.75% covered (success)
93.75%
15 / 16
0.00% covered (danger)
0.00%
0 / 1
CRAP
0.00% covered (danger)
0.00%
0 / 1
OverallCalendar
93.75% covered (success)
93.75%
15 / 16
0.00% covered (danger)
0.00%
0 / 1
3.00
0.00% covered (danger)
0.00%
0 / 1
 readResponse
93.75% covered (success)
93.75%
15 / 16
0.00% covered (danger)
0.00%
0 / 1
3.00
1<?php
2
3namespace BO\Zmsadmin;
4
5use BO\Mellon\Validator;
6use BO\Zmsdb\Request;
7use BO\Zmsentities\Collection\RequestList;
8use BO\Zmsentities\Department as DepartmentEntity;
9use BO\Zmsentities\Collection\DepartmentList;
10
11class OverallCalendar extends BaseController
12{
13    /**
14     * @SuppressWarnings(Param)
15     * @return String
16     */
17    public function readResponse(
18        \Psr\Http\Message\RequestInterface $request,
19        \Psr\Http\Message\ResponseInterface $response,
20        array $args
21    ) {
22        $result = \App::$http->readGetResult('/workstation/', ['resolveReferences' => 3]);
23        if (!$result) {
24            throw new \Exception('Unable to retrieve workstation data');
25        }
26        $workstation = $result->getEntity();
27        if (!$workstation->getUseraccount()->hasRights(['useraccount'])) {
28            throw new \BO\Zmsentities\Exception\UserAccountMissingRights();
29        }
30
31        return \BO\Slim\Render::withHtml(
32            $response,
33            'page/overallCalendar.twig',
34            array(
35                'title' => 'Wochenkalender',
36                'workstation' => $workstation,
37                'menuActive' => 'overallcalendar',
38                'hideNavigation' => true,
39            )
40        );
41    }
42}