Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
19 / 19 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
1 / 1 |
| CounterQueueInfo | |
100.00% |
19 / 19 |
|
100.00% |
1 / 1 |
2 | |
100.00% |
1 / 1 |
| readResponse | |
100.00% |
19 / 19 |
|
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 CounterQueueInfo extends BaseController |
| 11 | { |
| 12 | /** |
| 13 | * @SuppressWarnings(Param) |
| 14 | * @return String |
| 15 | */ |
| 16 | public function readResponse( |
| 17 | \Psr\Http\Message\RequestInterface $request, |
| 18 | \Psr\Http\Message\ResponseInterface $response, |
| 19 | array $args |
| 20 | ) { |
| 21 | $validator = $request->getAttribute('validator'); |
| 22 | $selectedDate = $validator->getParameter('selecteddate')->isString()->getValue(); |
| 23 | $ghostWorkstation = $validator->getParameter('ghostworkstationcount')->isNumber()->getValue(); |
| 24 | $workstation = \App::$http->readGetResult('/workstation/', ['resolveReferences' => 2])->getEntity(); |
| 25 | |
| 26 | if ($ghostWorkstation >= -1) { |
| 27 | $scope = $workstation->getScope(); |
| 28 | $scope->setStatusQueue('ghostWorkstationCount', $ghostWorkstation); |
| 29 | $workstation->scope = \App::$http |
| 30 | ->readPostResult("/scope/$scope->id/ghostworkstation/", $scope)->getEntity(); |
| 31 | } |
| 32 | $workstationInfo = Helper\WorkstationInfo::getInfoBoxData($workstation, $selectedDate); |
| 33 | |
| 34 | return \BO\Slim\Render::withHtml( |
| 35 | $response, |
| 36 | 'block/queue/info.twig', |
| 37 | array( |
| 38 | 'workstation' => $workstation, |
| 39 | 'workstationInfo' => $workstationInfo, |
| 40 | 'selectedDate' => $selectedDate |
| 41 | ) |
| 42 | ); |
| 43 | } |
| 44 | } |