Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
20 / 20 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
1 / 1 |
| WorkstationProcess | |
100.00% |
20 / 20 |
|
100.00% |
1 / 1 |
5 | |
100.00% |
1 / 1 |
| readResponse | |
100.00% |
20 / 20 |
|
100.00% |
1 / 1 |
5 | |||
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * @package Zmsadmin |
| 5 | * @copyright BerlinOnline Stadtportal GmbH & Co. KG |
| 6 | **/ |
| 7 | |
| 8 | namespace BO\Zmsadmin; |
| 9 | |
| 10 | use DateTime; |
| 11 | |
| 12 | /** |
| 13 | * Init Controller to display next Button Template only |
| 14 | * |
| 15 | */ |
| 16 | class WorkstationProcess extends BaseController |
| 17 | { |
| 18 | /** |
| 19 | * @SuppressWarnings(Param) |
| 20 | * @return String |
| 21 | */ |
| 22 | public function readResponse( |
| 23 | \Psr\Http\Message\RequestInterface $request, |
| 24 | \Psr\Http\Message\ResponseInterface $response, |
| 25 | array $args |
| 26 | ) { |
| 27 | $workstation = \App::$http->readGetResult('/workstation/', ['resolveReferences' => 2])->getEntity(); |
| 28 | $template = ($workstation->process->hasId() && 'processing' == $workstation->process->status) ? 'info' : 'next'; |
| 29 | $selectedDate = (new DateTime())->format('Y-m-d'); |
| 30 | if ($workstation->process->hasId() && 'called' == $workstation->process->getStatus()) { |
| 31 | return \BO\Slim\Render::redirect( |
| 32 | 'workstationProcessCalled', |
| 33 | array( |
| 34 | 'id' => $workstation->process->id |
| 35 | ) |
| 36 | ); |
| 37 | } |
| 38 | $workstationInfo = Helper\WorkstationInfo::getInfoBoxData($workstation, $selectedDate); |
| 39 | return \BO\Slim\Render::withHtml( |
| 40 | $response, |
| 41 | 'block/process/' . $template . '.twig', |
| 42 | array( |
| 43 | 'workstation' => $workstation, |
| 44 | 'workstationInfo' => $workstationInfo, |
| 45 | 'selectedDate' => $selectedDate |
| 46 | ) |
| 47 | ); |
| 48 | } |
| 49 | } |