Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
100.00% |
18 / 18 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
1 / 1 |
ProcessQueueReset | |
100.00% |
18 / 18 |
|
100.00% |
1 / 1 |
3 | |
100.00% |
1 / 1 |
readResponse | |
100.00% |
18 / 18 |
|
100.00% |
1 / 1 |
3 |
1 | <?php |
2 | |
3 | /** |
4 | * |
5 | * @package Zmsadmin |
6 | * @copyright BerlinOnline Stadtportal GmbH & Co. KG |
7 | * |
8 | */ |
9 | |
10 | namespace BO\Zmsadmin; |
11 | |
12 | use BO\Mellon\Validator; |
13 | use BO\Slim\Render; |
14 | |
15 | /** |
16 | * Queue a process |
17 | */ |
18 | class ProcessQueueReset extends BaseController |
19 | { |
20 | /** |
21 | * @SuppressWarnings(Param) |
22 | * @return String |
23 | */ |
24 | public function readResponse( |
25 | \Psr\Http\Message\RequestInterface $request, |
26 | \Psr\Http\Message\ResponseInterface $response, |
27 | array $args |
28 | ) { |
29 | \App::$http->readGetResult('/workstation/', ['resolveReferences' => 1]); |
30 | $validator = $request->getAttribute('validator'); |
31 | $processId = $validator->getParameter('selectedprocess')->isNumber()->getValue(); |
32 | $selectedDate = $validator->getParameter('selecteddate')->isString()->getValue(); |
33 | if ($processId) { |
34 | $selectedProcess = \App::$http->readGetResult('/process/' . $processId . '/')->getEntity(); |
35 | } |
36 | |
37 | if (isset($selectedProcess->queue)) { |
38 | $selectedProcess->queue->arrivalTime = time(); |
39 | } |
40 | |
41 | \App::$http->readPostResult('/process/status/queued/', $selectedProcess); |
42 | |
43 | return \BO\Slim\Render::redirect( |
44 | 'queue_table', |
45 | array(), |
46 | array( |
47 | 'selecteddate' => $selectedDate, |
48 | 'selectedprocess' => $processId, |
49 | 'success' => 'process_reset_queued' |
50 | ) |
51 | ); |
52 | } |
53 | } |