Lines
100.00%
14 / 14
Functions and Methods
100.00%
1 / 1
Classes and Traits
100.00%
1 / 1
| Name | Lines | Functions and Methods | CRAP | Classes and Traits | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| SourceIndex | 100.00% | 14 / 14 | 100.00% | 1 / 1 | 2 | 100.00% | 1 / 1 | |||
| readResponse | 100.00% | 14 / 14 | 100.00% | 1 / 1 | 2 | |||||
| 1 | <?php | |
| 2 | ||
| 3 | /** | |
| 4 | * | |
| 5 | * @package Zmsadmin | |
| 6 | * @copyright BerlinOnline Stadtportal GmbH & Co. KG | |
| 7 | * | |
| 8 | */ | |
| 9 | ||
| 10 | namespace BO\Zmsadmin; | |
| 11 | ||
| 12 | use BO\Slim\Render; | |
| 13 | use BO\Zmsentities\Exception\UserAccountMissingRights; | |
| 14 | ||
| 15 | class SourceIndex extends BaseController | |
| 16 | { | |
| 17 | /** | |
| 18 | * @SuppressWarnings(Param) | |
| 19 | * @return \Psr\Http\Message\ResponseInterface | |
| 20 | */ | |
| 21 | #[\Override] | |
| 22 | public function readResponse( | |
| 23 | \Psr\Http\Message\RequestInterface $request, | |
| 24 | \Psr\Http\Message\ResponseInterface $response, | |
| 25 | array $args | |
| 26 | ): \Psr\Http\Message\ResponseInterface { | |
| 27 | $workstation = \App::$http->readGetResult('/workstation/', ['resolveReferences' => 1])->getEntity(); | |
| 28 | if (!$workstation->getUseraccount()->hasPermissions(['source'])) { | |
| 29 | throw new UserAccountMissingRights(); | |
| 30 | } | |
| 31 | $sourceList = \App::$http->readGetResult('/source/', ['resolveReferences' => 0])->getCollection(); | |
| 32 | ||
| 33 | return Render::withHtml( | |
| 34 | $response, | |
| 35 | 'page/sourceindex.twig', | |
| 36 | array( | |
| 37 | 'title' => 'Mandanten', | |
| 38 | 'menuActive' => 'source', | |
| 39 | 'workstation' => $workstation, | |
| 40 | 'sourceList' => $sourceList | |
| 41 | ) | |
| 42 | ); | |
| 43 | } | |
| 44 | } |