Lines
100.00%
20 / 20
Functions and Methods
100.00%
1 / 1
Classes and Traits
100.00%
1 / 1
| Name | Lines | Functions and Methods | CRAP | Classes and Traits | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| OwnerOverview | 100.00% | 20 / 20 | 100.00% | 1 / 1 | 2 | 100.00% | 1 / 1 | |||
| readResponse | 100.00% | 20 / 20 | 100.00% | 1 / 1 | 2 | |||||
| 1 | <?php | |
| 2 | ||
| 3 | /** | |
| 4 | * @package Zmsadmin | |
| 5 | * @copyright BerlinOnline Stadtportal GmbH & Co. KG | |
| 6 | **/ | |
| 7 | ||
| 8 | namespace BO\Zmsadmin; | |
| 9 | ||
| 10 | use BO\Slim\Render; | |
| 11 | use BO\Zmsentities\Exception\UserAccountMissingRights; | |
| 12 | ||
| 13 | class OwnerOverview extends BaseController | |
| 14 | { | |
| 15 | /** | |
| 16 | * @SuppressWarnings(Param) | |
| 17 | * @return \Psr\Http\Message\ResponseInterface | |
| 18 | */ | |
| 19 | #[\Override] | |
| 20 | public function readResponse( | |
| 21 | \Psr\Http\Message\RequestInterface $request, | |
| 22 | \Psr\Http\Message\ResponseInterface $response, | |
| 23 | array $args | |
| 24 | ): \Psr\Http\Message\ResponseInterface { | |
| 25 | $workstation = \App::$http->readGetResult('/workstation/', ['resolveReferences' => 1])->getEntity(); | |
| 26 | if (!$workstation->getUseraccount()->hasAnyPermission(['restrictedscope','scope','organisation','department','cluster','jurisdiction'])) { | |
| 27 | throw new UserAccountMissingRights(); | |
| 28 | } | |
| 29 | $ownerList = \App::$http->readGetResult('/owner/', array('resolveReferences' => 4))->getCollection(); | |
| 30 | $success = $request->getAttribute('validator')->getParameter('success')->isString()->setDefault('')->getValue(); | |
| 31 | $scopeName = $request->getAttribute('validator')->getParameter('scopeName')->isString()->setDefault('')->getValue(); | |
| 32 | $departmentName = $request->getAttribute('validator')->getParameter('departmentName')->isString()->setDefault('')->getValue(); | |
| 33 | return Render::withHtml( | |
| 34 | $response, | |
| 35 | 'page/ownerOverview.twig', | |
| 36 | array( | |
| 37 | 'title' => 'Behörden und Standorte', | |
| 38 | 'menuActive' => 'owner', | |
| 39 | 'workstation' => $workstation, | |
| 40 | 'ownerList' => $ownerList, | |
| 41 | 'success' => $success, | |
| 42 | 'scopeName' => $scopeName, | |
| 43 | 'departmentName' => $departmentName | |
| 44 | ) | |
| 45 | ); | |
| 46 | } | |
| 47 | } |