Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
76.19% |
16 / 21 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
| WarehousePeriod | |
76.19% |
16 / 21 |
|
0.00% |
0 / 1 |
2.05 | |
0.00% |
0 / 1 |
| readResponse | |
76.19% |
16 / 21 |
|
0.00% |
0 / 1 |
2.05 | |||
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * @package Zmsadmin |
| 5 | * @copyright BerlinOnline Stadtportal GmbH & Co. KG |
| 6 | **/ |
| 7 | |
| 8 | namespace BO\Zmsstatistic; |
| 9 | |
| 10 | use BO\Slim\Render; |
| 11 | use Psr\Http\Message\RequestInterface; |
| 12 | use Psr\Http\Message\ResponseInterface; |
| 13 | |
| 14 | class WarehousePeriod 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 | $periodList = \App::$http |
| 26 | ->readGetResult('/warehouse/' . $args['subject'] . '/' . $args['subjectid'] . '/') |
| 27 | ->getEntity(); |
| 28 | if (count($periodList['data']) == 1) { |
| 29 | return Render::redirect("WarehouseReport", [ |
| 30 | 'subject' => $args['subject'], |
| 31 | 'subjectid' => $args['subjectid'], |
| 32 | 'period' => $periodList['data'][0][0], |
| 33 | ]); |
| 34 | } |
| 35 | |
| 36 | return Render::withHtml( |
| 37 | $response, |
| 38 | 'page/warehousePeriod.twig', |
| 39 | array( |
| 40 | 'title' => 'Kategorien', |
| 41 | 'menuActive' => 'warehouse', |
| 42 | 'periodList' => $periodList, |
| 43 | 'category' => $args['subject'], |
| 44 | 'subjectId' => $args['subjectid'], |
| 45 | 'workstation' => $this->workstation->getArrayCopy() |
| 46 | ) |
| 47 | ); |
| 48 | } |
| 49 | } |