Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
24 / 24 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
1 / 1 |
| UseraccountByDepartment | |
100.00% |
24 / 24 |
|
100.00% |
1 / 1 |
2 | |
100.00% |
1 / 1 |
| readResponse | |
100.00% |
24 / 24 |
|
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\Zmsentities\Collection\UseraccountList as Collection; |
| 11 | use Psr\Http\Message\RequestInterface; |
| 12 | use Psr\Http\Message\ResponseInterface; |
| 13 | |
| 14 | class UseraccountByDepartment extends BaseController |
| 15 | { |
| 16 | /** |
| 17 | * @SuppressWarnings(Param) |
| 18 | * @return ResponseInterface |
| 19 | */ |
| 20 | public function readResponse( |
| 21 | RequestInterface $request, |
| 22 | ResponseInterface $response, |
| 23 | array $args |
| 24 | ) { |
| 25 | $departmentId = $args['id']; |
| 26 | $workstation = \App::$http->readGetResult('/workstation/', ['resolveReferences' => 2])->getEntity(); |
| 27 | $success = $request->getAttribute('validator')->getParameter('success')->isString()->getValue(); |
| 28 | $department = \App::$http->readGetResult("/department/$departmentId/")->getEntity(); |
| 29 | |
| 30 | $useraccountList = new Collection(); |
| 31 | $useraccountList = \App::$http->readGetResult("/department/$departmentId/useraccount/")->getCollection(); |
| 32 | $workstationList = \App::$http->readGetResult("/department/$departmentId/workstation/")->getCollection(); |
| 33 | |
| 34 | $ownerList = \App::$http->readGetResult('/owner/', array('resolveReferences' => 2))->getCollection(); |
| 35 | |
| 36 | return \BO\Slim\Render::withHtml( |
| 37 | $response, |
| 38 | 'page/useraccount.twig', |
| 39 | array( |
| 40 | 'title' => 'Nutzer', |
| 41 | 'menuActive' => 'useraccount', |
| 42 | 'workstation' => $workstation, |
| 43 | 'department' => $department, |
| 44 | 'workstationList' => $workstationList, |
| 45 | 'useraccountListByDepartment' => ($useraccountList) ? |
| 46 | $useraccountList->sortByCustomStringKey('id') : |
| 47 | new Collection(), |
| 48 | 'ownerlist' => $ownerList, |
| 49 | 'success' => $success, |
| 50 | ) |
| 51 | ); |
| 52 | } |
| 53 | } |