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