Lines
93.75%
15 / 16
Functions and Methods
0.00%
0 / 1
Classes and Traits
0.00%
0 / 1
| Name | Lines | Functions and Methods | CRAP | Classes and Traits | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| 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\Zmsentities\Collection\RequestList; | |
| 7 | use BO\Zmsentities\Department as DepartmentEntity; | |
| 8 | use BO\Zmsentities\Collection\DepartmentList; | |
| 9 | use BO\Zmsentities\Exception\UserAccountMissingRights; | |
| 10 | ||
| 11 | class OverallCalendar extends BaseController | |
| 12 | { | |
| 13 | /** | |
| 14 | * @SuppressWarnings(Param) | |
| 15 | * @return \Psr\Http\Message\ResponseInterface | |
| 16 | */ | |
| 17 | #[\Override] | |
| 18 | public function readResponse( | |
| 19 | \Psr\Http\Message\RequestInterface $request, | |
| 20 | \Psr\Http\Message\ResponseInterface $response, | |
| 21 | array $args | |
| 22 | ): \Psr\Http\Message\ResponseInterface { | |
| 23 | $result = \App::$http->readGetResult('/workstation/', ['resolveReferences' => 3]); | |
| 24 | if (!$result) { | |
| 25 | throw new \Exception('Unable to retrieve workstation data'); | |
| 26 | } | |
| 27 | $workstation = $result->getEntity(); | |
| 28 | if (!$workstation->getUseraccount()->hasPermissions(['overviewcalendar'])) { | |
| 29 | throw new UserAccountMissingRights(); | |
| 30 | } | |
| 31 | ||
| 32 | return \BO\Slim\Render::withHtml( | |
| 33 | $response, | |
| 34 | 'page/overallCalendar.twig', | |
| 35 | array( | |
| 36 | 'title' => 'Gesamtübersicht', | |
| 37 | 'workstation' => $workstation, | |
| 38 | 'menuActive' => 'overallcalendar', | |
| 39 | 'hideNavigation' => true, | |
| 40 | ) | |
| 41 | ); | |
| 42 | } | |
| 43 | } |