Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
93.75% |
15 / 16 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
OverallCalendar | |
93.75% |
15 / 16 |
|
0.00% |
0 / 1 |
3.00 | |
0.00% |
0 / 1 |
readResponse | |
93.75% |
15 / 16 |
|
0.00% |
0 / 1 |
3.00 |
1 | <?php |
2 | |
3 | namespace BO\Zmsadmin; |
4 | |
5 | use BO\Mellon\Validator; |
6 | use BO\Zmsdb\Request; |
7 | use BO\Zmsentities\Collection\RequestList; |
8 | use BO\Zmsentities\Department as DepartmentEntity; |
9 | use BO\Zmsentities\Collection\DepartmentList; |
10 | |
11 | class 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 | } |